Compare commits
23 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
d6dfeac244 | ||
|
51bb1b8d6d | ||
|
cba287d62a | ||
|
fe6c26dc50 | ||
|
9294c8f774 | ||
|
905b0e3175 | ||
|
a743814be9 | ||
|
efe9d99730 | ||
|
471a2ca0bf | ||
|
f97095fada | ||
|
22e7073865 | ||
|
d21ddc4f17 | ||
|
51004f1cf9 | ||
|
0ef598d064 | ||
|
fbd0023f75 | ||
|
2783b13ce6 | ||
|
cee2b5567d | ||
|
d7a28edad2 | ||
|
7337535943 | ||
|
359cdde7ed | ||
|
2bc6f71528 | ||
|
a2456ed88a | ||
|
98f5d739e3 |
@@ -26,7 +26,7 @@ set path [file normalize .]
|
||||
set THE_CASROOT ""
|
||||
set fBranch ""
|
||||
if { [info exists ::env(CASROOT)] } {
|
||||
set THE_CASROOT "$::env(CASROOT)"
|
||||
set THE_CASROOT [file normalize "$::env(CASROOT)"]
|
||||
}
|
||||
|
||||
proc _get_options { platform type branch } {
|
||||
@@ -344,6 +344,22 @@ proc genproj {theFormat args} {
|
||||
genAllResources
|
||||
}
|
||||
|
||||
# copy file providing warning if the target file exists and has
|
||||
# different date or size; if it is newer than source, save it as .bak
|
||||
proc copy_with_warning {from to} {
|
||||
if { [file exists "$to"] &&
|
||||
([file size "$to"] != [file size "$from"] ||
|
||||
[file mtime "$to"] != [file mtime "$from"]) } {
|
||||
puts "Warning: file $to is updated (copied from $from)!"
|
||||
if { [file mtime $to] > [file mtime $from] } {
|
||||
puts "Info: old content of file $to is saved in ${to}.bak"
|
||||
file copy -force -- "$to" "${to}.bak"
|
||||
}
|
||||
}
|
||||
|
||||
file copy -force -- "$from" "$to"
|
||||
}
|
||||
|
||||
proc genprojbat {theFormat thePlatform} {
|
||||
set aTargetPlatformExt sh
|
||||
if { $thePlatform == "wnt" || $thePlatform == "uwp" } {
|
||||
@@ -369,11 +385,11 @@ proc genprojbat {theFormat thePlatform} {
|
||||
close $anEnvFile
|
||||
}
|
||||
|
||||
file copy -force -- "$::THE_CASROOT/adm/templates/draw.${aTargetPlatformExt}" "$::path/draw.${aTargetPlatformExt}"
|
||||
copy_with_warning "$::THE_CASROOT/adm/templates/draw.${aTargetPlatformExt}" "$::path/draw.${aTargetPlatformExt}"
|
||||
}
|
||||
|
||||
if { [regexp {^vc} $theFormat] } {
|
||||
file copy -force -- "$::THE_CASROOT/adm/templates/msvc.bat" "$::path/msvc.bat"
|
||||
copy_with_warning "$::THE_CASROOT/adm/templates/msvc.bat" "$::path/msvc.bat"
|
||||
} else {
|
||||
switch -exact -- "$theFormat" {
|
||||
"cbp" {
|
||||
|
31
adm/svgdiff.bat
Normal file
@@ -0,0 +1,31 @@
|
||||
@echo off
|
||||
rem Script to diff SVG images visually (as PNG) in TortoiseGit client
|
||||
rem
|
||||
rem It assumes that Inkscape and TortoiseGitIDiff executables are either
|
||||
rem installed in default locations in Program Files, or are accessible by PATH
|
||||
rem
|
||||
rem To use this script for diffing SVG images, open TortoiseGit settings
|
||||
rem (Start -> Programs -> TortoiseGit -> Settings), select "Diff Viewer",
|
||||
rem click button "Advanced..." on the right tab and then add new record:
|
||||
rem - Extension: .svg
|
||||
rem - External program: <path to OCCT>\adm\svgdiff.bat %base %mine %bname %yname
|
||||
|
||||
rem Remove double quotes around arguments
|
||||
set "f1=%1"
|
||||
set "f2=%2"
|
||||
set "f1=%f1:~1,-1%.png"
|
||||
set "f2=%f2:~1,-1%.png"
|
||||
|
||||
rem Check if Inkscape and TortoiseGit are installed in default locations in
|
||||
rem ProgramFiles; if not, assume they still may be accessible by PATH
|
||||
set "inkscape=%ProgramFiles%\Inkscape\inkscape.exe"
|
||||
if not exist "%inkscape%" set inkscape=inkscape.exe
|
||||
set "tgitidiff=%ProgramFiles%\TortoiseGit\bin\TortoiseGitIDiff.exe"
|
||||
if not exist "%tgitidiff%" set tgitidiff=TortoiseGitIDiff.exe
|
||||
|
||||
rem Convert SVG to PNG using Inkscape
|
||||
"%inkscape%" -e "%f1%" %1
|
||||
"%inkscape%" -e "%f2%" %2
|
||||
|
||||
rem Call Tortoise differ
|
||||
"%tgitidiff%" /left:"%f1%" /right:"%f2%" /lefttitle:%3 /righttitle:%4
|
@@ -56,6 +56,6 @@ To build all toolkits, click **Build->Build workspace** in the menu bar.
|
||||
|
||||
To start *DRAWEXE*, which has been built with **Code::Blocks** on Mac OS X, run the script
|
||||
~~~~~
|
||||
./draw_cbp.sh cbp [d]
|
||||
./draw.sh cbp [d]
|
||||
~~~~~
|
||||
Option *d* is used if OCCT has been built in **Debug** mode.
|
||||
|
@@ -82,7 +82,7 @@ The official repository contains:
|
||||
|
||||
@subsection occt_gitguide_1_5 Version of Git
|
||||
|
||||
The repository is tested to work with Git 1.7.6 to 1.7.9.
|
||||
The repository is tested to work with Git 1.7.6 and above.
|
||||
Please do not use versions below 1.7.1 as they are known to cause troubles.
|
||||
|
||||
@section occt_gitguide_2 Installing Tools for Work with Git
|
||||
@@ -139,6 +139,13 @@ The official repository contains:
|
||||
|
||||
@figure{OCCT_GitGuide_V2_image006.png,"",320}
|
||||
|
||||
Optionally, you can set up TortoiseGit to use visual diff utility for SVG images used in OCCT documentation.
|
||||
For that, click on item "Diff Viewer" in the Settings dialog, then click button "Advanced..." on the right tab add new record with the following parameters:
|
||||
- Extension: <code>.svg</code>
|
||||
- External program: <code><path_to_OCCT>\\adm\\svgdiff.bat %%base %%mine %%bname %%yname</code>
|
||||
|
||||
@figure{OCCT_GitGuide_V2_svgdiff.png,"",709}
|
||||
|
||||
@subsection occt_gitguide_2_2 Linux platform
|
||||
|
||||
We assume that Linux users have Git already installed and available in the *PATH*.
|
||||
|
BIN
dox/dev_guides/git_guide/images/OCCT_GitGuide_V2_svgdiff.png
Normal file
After Width: | Height: | Size: 54 KiB |
@@ -324,6 +324,15 @@ The methods *V3d_View::Convert* and *V3d_View::ConvertWithProj()* have ceased to
|
||||
|
||||
Porting of user applications from an earlier OCCT version to version 7.0.0 requires taking into account the following major changes.
|
||||
|
||||
Building OCCT now requires compiler supporting some C++11 features.
|
||||
The supported compilers are:
|
||||
- MSVC: version 10 (Visual Studio 2010) or later
|
||||
- GCC: version 4.3 or later
|
||||
- CLang: version 3.6 or later
|
||||
- ICC: version XE 2013 SP 1 or later
|
||||
|
||||
When compiling code that uses OCCT with GCC and CLang compilers, it is necessary to use compiler option -std=c++0x (or its siblings) to enable C++11 features.
|
||||
|
||||
@subsection upgrade_700_persist Removal of legacy persistence
|
||||
|
||||
Legacy persistence for shapes and OCAF data based on *Storage_Schema* (toolkits *TKPShape*, *TKPLCAF*, *TKPCAF*, *TKShapeShcema, TLStdLSchema, TKStdSchema*, and *TKXCAFSchema*) has been removed in OCCT 7.0.0.
|
||||
@@ -1195,6 +1204,9 @@ Management of highlight attributes has been revised and might require modificati
|
||||
it is now possible to customize default highlight attributes like *Display Mode* and *ZLayer*, which previously could be defined only on Object level.
|
||||
* Properties *Prs3d_Drawer::HighlightStyle()* and *Prs3d_Drawer::SelectionStyle()* have been removed.
|
||||
Instead, *AIS_InteractiveObject* now defines *DynamicHilightAttributes()* for dynamic highlighting in addition to *HilightAttributes()* used for highlighting in selected state.
|
||||
Note that *AIS_InteractiveObject::HilightAttributes()* and *AIS_InteractiveObject::DynamicHilightAttributes()* override highlighting properties for both - entire object and for part coming from decomposition.
|
||||
This includes Z-layer settings, which will be the same when overriding properties through AIS_InteractiveObject, while *AIS_InteractiveContext::HighlightStyle()* allows customizing properties for local and global selection independently
|
||||
(with Graphic3d_ZLayerId_Top used for dynamic highlighting of entire object and Graphic3d_ZLayerId_Topmost for dynamic highlighting of object part by default).
|
||||
* The following protected fields have been removed from class *AIS_InteractiveObject*:
|
||||
- *myOwnColor*, replaced by *myDrawer->Color()*
|
||||
- *myTransparency*, replaced by *myDrawer->Transparency()*
|
||||
@@ -1410,3 +1422,10 @@ The history of the changing of the initial shape was corrected:
|
||||
@subsection upgrade_720_Change_In_RWStl Changes in STL Reader / Writer
|
||||
|
||||
Class RWStl now uses class Poly_Triangulation for storing triangular mesh instead of StlMesh data classes; the latter have been removed.
|
||||
|
||||
@subsection upgrade_720_New_Error_Warning_system_in_BOA Refactoring of the Error/Warning reporting system in Boolean Component
|
||||
|
||||
The Error/Warning reporting system of the algorithms in Boolean Component (in all BOPAlgo_* and BRepAlgoAPI_* algorithms) has been refactored.
|
||||
The methods returning the status of errors and warnings of the algorithms (ErrorStatus() and WarningStatus()) have been removed.
|
||||
Instead use methods HasErrors() and HasWarnings() to check for presence of errors and warnings, respectively.
|
||||
The full list of errors and warnings, with associated data such as problematic sub-shapes, can be obtained by method GetReport().
|
||||
|
@@ -540,6 +540,23 @@ The structure *BOPDS_FaceInfo* has the following contents.
|
||||
|
||||
The objects of type *BOPDS_FaceInfo* are stored in one container of array type. The array allows getting the access to the information by index. This index (if exists) is stored in the field *myReference*.
|
||||
|
||||
@section occt_algorithms_root_classes Root Classes
|
||||
|
||||
@subsection occt_algorithms_root_classes_1 Class BOPAlgo_Options
|
||||
The class *BOPAlgo_Options* provides the following options for the algorithms:
|
||||
* Set the appropriate memory allocator;
|
||||
* Check the presence of the Errors and Warnings;
|
||||
* Turn on/off the parallel processing;
|
||||
* Set the additional tolerance for the operation;
|
||||
* Break the operations by user request.
|
||||
|
||||
@subsection occt_algorithms_root_classes_2 Class BOPAlgo_Algo
|
||||
|
||||
The class *BOPAlgo_Algo* provides the base interface for all algorithms:
|
||||
* Perform the operation;
|
||||
* Check the input data;
|
||||
* Check the result.
|
||||
|
||||
@section occt_algorithms_5 Intersection Part
|
||||
|
||||
Intersection Part (IP) is used to
|
||||
@@ -553,17 +570,7 @@ Intersection Part (IP) is used to
|
||||
|
||||
IP is implemented in the class *BOPAlgo_PaveFiller*.
|
||||
|
||||
@figure{/user_guides/boolean_operations/images/operations_image064.svg,"Diagram for Class BOPAlgo_PaveFiller",230}
|
||||
|
||||
@subsection occt_algorithms_5_1a Class BOPAlgo_Algo
|
||||
The class *BOPAlgo_Algo* provides the base interface for all algorithms to provide the possibility to:
|
||||
* Get Error status;
|
||||
* Get Warning status;
|
||||
* Turn on/off the parallel processing
|
||||
* Break the operations by user request
|
||||
* Check data;
|
||||
* Check the result;
|
||||
* Set the appropriate memory allocator.
|
||||
@figure{/user_guides/boolean_operations/images/operations_image064.png,"Diagram for Class BOPAlgo_PaveFiller",230}
|
||||
|
||||
The description provided in the next paragraphs is coherent with the implementation of the method *BOPAlgo_PaveFiller::Perform()*.
|
||||
|
||||
@@ -745,8 +752,11 @@ BP is implemented in the following classes:
|
||||
* *BOPAlgo_Builder* -- for the General Fuse operator (GFA).
|
||||
* *BOPAlgo_BOP* -- for the Boolean Operation operator (BOA).
|
||||
* *BOPAlgo_Section* -- for the Section operator (SA).
|
||||
* *BOPAlgo_MakerVolume* -- for the Volume Maker operator.
|
||||
* *BOPAlgo_Splitter* -- for the Splitter operator.
|
||||
* *BOPAlgo_CellsBuilder* -- for the Cells Builder operator.
|
||||
|
||||
@figure{/user_guides/boolean_operations/images/operations_image020.svg,"Diagram for BP classes",300}
|
||||
@figure{/user_guides/boolean_operations/images/operations_image020.png,"Diagram for BP classes",300}
|
||||
|
||||
The class *BOPAlgo_BuilderShape* provides the interface for algorithms that have:
|
||||
* A Shape as the result;
|
||||
@@ -1088,7 +1098,7 @@ aSplitter.SetNonDestructive(bSafeMode);
|
||||
aSplitter.SetGlue(aGlue);
|
||||
//
|
||||
aSplitter.Perform(); //perform the operation
|
||||
if (aSplitter.ErrorStatus()) { //check error status
|
||||
if (aSplitter.HasErrors()) { //check error status
|
||||
return;
|
||||
}
|
||||
//
|
||||
@@ -2061,7 +2071,7 @@ aMV.SetGlue(aGlue);
|
||||
aMV.SetAvoidInternalShapes(bAvoidInternalShapes);
|
||||
//
|
||||
aMV.Perform(); //perform the operation
|
||||
if (aMV.ErrorStatus()) { //check error status
|
||||
if (aMV.HasErrors()) { //check error status
|
||||
return;
|
||||
}
|
||||
//
|
||||
@@ -2151,7 +2161,7 @@ aCBuilder.SetNonDestructive(bSafeMode);
|
||||
aCBuilder.SetGlue(aGlue);
|
||||
//
|
||||
aCBuilder.Perform(); // build splits of all arguments (GF)
|
||||
if (aCBuilder.ErrorStatus()) { // check error status
|
||||
if (aCBuilder.HasErrors()) { // check error status
|
||||
return;
|
||||
}
|
||||
//
|
||||
@@ -2804,7 +2814,6 @@ The following example illustrates how to use General Fuse operator:
|
||||
#include <BRepAlgoAPI_BuilderAlgo.hxx>
|
||||
{…
|
||||
Standard_Boolean bRunParallel;
|
||||
Standard_Integer iErr;
|
||||
Standard_Real aFuzzyValue;
|
||||
BRepAlgoAPI_BuilderAlgo aBuilder;
|
||||
//
|
||||
@@ -2841,8 +2850,7 @@ The following example illustrates how to use General Fuse operator:
|
||||
//
|
||||
// run the algorithm
|
||||
aBuilder.Build();
|
||||
iErr=aBuilder.ErrorStatus();
|
||||
if (iErr) {
|
||||
if (aBuilder.HasErrors()) {
|
||||
// an error treatment
|
||||
return;
|
||||
}
|
||||
@@ -2945,7 +2953,7 @@ aSplitter.SetGlue(aGlueOpt);
|
||||
// run the algorithm
|
||||
aSplitter.Build();
|
||||
// check error status
|
||||
if (aSplitter.ErrorStatus()) {
|
||||
if (aSplitter.HasErrors()) {
|
||||
return;
|
||||
}
|
||||
//
|
||||
@@ -3012,7 +3020,6 @@ The following example illustrates how to use Common operation:
|
||||
#include < BRepAlgoAPI_Common.hxx>
|
||||
{…
|
||||
Standard_Boolean bRunParallel;
|
||||
Standard_Integer iErr;
|
||||
Standard_Real aFuzzyValue;
|
||||
BRepAlgoAPI_Common aBuilder;
|
||||
|
||||
@@ -3052,8 +3059,7 @@ The following example illustrates how to use Common operation:
|
||||
//
|
||||
// run the algorithm
|
||||
aBuilder.Build();
|
||||
iErr=aBuilder.ErrorStatus();
|
||||
if (iErr) {
|
||||
if (aBuilder.HasErrors()) {
|
||||
// an error treatment
|
||||
return;
|
||||
}
|
||||
@@ -3119,7 +3125,6 @@ The following example illustrates how to use Fuse operation:
|
||||
#include < BRepAlgoAPI_Fuse.hxx>
|
||||
{…
|
||||
Standard_Boolean bRunParallel;
|
||||
Standard_Integer iErr;
|
||||
Standard_Real aFuzzyValue;
|
||||
BRepAlgoAPI_Fuse aBuilder;
|
||||
|
||||
@@ -3159,8 +3164,7 @@ The following example illustrates how to use Fuse operation:
|
||||
//
|
||||
// run the algorithm
|
||||
aBuilder.Build();
|
||||
iErr=aBuilder.ErrorStatus();
|
||||
if (iErr) {
|
||||
if (aBuilder.HasErrors()) {
|
||||
// an error treatment
|
||||
return;
|
||||
}
|
||||
@@ -3226,7 +3230,6 @@ The following example illustrates how to use Cut operation:
|
||||
#include < BRepAlgoAPI_Cut.hxx>
|
||||
{…
|
||||
Standard_Boolean bRunParallel;
|
||||
Standard_Integer iErr;
|
||||
Standard_Real aFuzzyValue;
|
||||
BRepAlgoAPI_Cut aBuilder;
|
||||
|
||||
@@ -3266,8 +3269,7 @@ The following example illustrates how to use Cut operation:
|
||||
//
|
||||
// run the algorithm
|
||||
aBuilder.Build();
|
||||
iErr=aBuilder.ErrorStatus();
|
||||
if (iErr) {
|
||||
if (aBuilder.HasErrors()) {
|
||||
// an error treatment
|
||||
return;
|
||||
}
|
||||
@@ -3334,7 +3336,6 @@ The following example illustrates how to use Section operation:
|
||||
#include < BRepAlgoAPI_Section.hxx>
|
||||
{…
|
||||
Standard_Boolean bRunParallel;
|
||||
Standard_Integer iErr;
|
||||
Standard_Real aFuzzyValue;
|
||||
BRepAlgoAPI_Section aBuilder;
|
||||
|
||||
@@ -3374,8 +3375,7 @@ The following example illustrates how to use Section operation:
|
||||
//
|
||||
// run the algorithm
|
||||
aBuilder.Build();
|
||||
iErr=aBuilder.ErrorStatus();
|
||||
if (iErr) {
|
||||
if (aBuilder.HasErrors()) {
|
||||
// an error treatment
|
||||
return;
|
||||
}
|
||||
|
After Width: | Height: | Size: 11 KiB |
@@ -1,296 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="488.59842"
|
||||
height="239.24245"
|
||||
id="svg2"
|
||||
version="1.1"
|
||||
inkscape:version="0.48.4 r9939"
|
||||
sodipodi:docname="operations_image020.svg">
|
||||
<defs
|
||||
id="defs4">
|
||||
<marker
|
||||
inkscape:stockid="Arrow2Lstart"
|
||||
orient="auto"
|
||||
refY="0.0"
|
||||
refX="0.0"
|
||||
id="Arrow2Lstart"
|
||||
style="overflow:visible">
|
||||
<path
|
||||
id="path7116"
|
||||
style="fill-rule:evenodd;stroke-width:0.62500000;stroke-linejoin:round"
|
||||
d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
|
||||
transform="scale(1.1) translate(1,0)" />
|
||||
</marker>
|
||||
<marker
|
||||
inkscape:stockid="Arrow2Mend"
|
||||
orient="auto"
|
||||
refY="0.0"
|
||||
refX="0.0"
|
||||
id="Arrow2Mend"
|
||||
style="overflow:visible;">
|
||||
<path
|
||||
id="path7125"
|
||||
style="fill-rule:evenodd;stroke-width:0.62500000;stroke-linejoin:round;"
|
||||
d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
|
||||
transform="scale(0.6) rotate(180) translate(0,0)" />
|
||||
</marker>
|
||||
<clipPath
|
||||
id="clipEmfPath1"
|
||||
clipPathUnits="userSpaceOnUse">
|
||||
<rect
|
||||
id="rect2990"
|
||||
height="19.040462"
|
||||
width="177.28004"
|
||||
y="73.463196"
|
||||
x="191.21669" />
|
||||
</clipPath>
|
||||
<clipPath
|
||||
id="clipEmfPath2"
|
||||
clipPathUnits="userSpaceOnUse">
|
||||
<rect
|
||||
id="rect2993"
|
||||
height="19.040462"
|
||||
width="176.83047"
|
||||
y="12.743616"
|
||||
x="192.41554" />
|
||||
</clipPath>
|
||||
<clipPath
|
||||
id="clipEmfPath3"
|
||||
clipPathUnits="userSpaceOnUse">
|
||||
<rect
|
||||
id="rect2996"
|
||||
height="18.890537"
|
||||
width="177.28004"
|
||||
y="133.13332"
|
||||
x="191.21669" />
|
||||
</clipPath>
|
||||
<clipPath
|
||||
id="clipEmfPath4"
|
||||
clipPathUnits="userSpaceOnUse">
|
||||
<rect
|
||||
id="rect2999"
|
||||
height="18.890537"
|
||||
width="149.10706"
|
||||
y="204.34763"
|
||||
x="130.52487" />
|
||||
</clipPath>
|
||||
<clipPath
|
||||
id="clipEmfPath5"
|
||||
clipPathUnits="userSpaceOnUse">
|
||||
<rect
|
||||
id="rect3002"
|
||||
height="18.890537"
|
||||
width="148.9572"
|
||||
y="204.34763"
|
||||
x="292.81927" />
|
||||
</clipPath>
|
||||
<marker
|
||||
inkscape:stockid="Arrow2Lstart"
|
||||
orient="auto"
|
||||
refY="0"
|
||||
refX="0"
|
||||
id="Arrow2Lstart-3"
|
||||
style="overflow:visible">
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
id="path7116-4"
|
||||
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round"
|
||||
d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
|
||||
transform="matrix(1.1,0,0,1.1,1.1,0)" />
|
||||
</marker>
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="2.1979709"
|
||||
inkscape:cx="318.63273"
|
||||
inkscape:cy="137.81983"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="g3004"
|
||||
showgrid="false"
|
||||
fit-margin-top="0"
|
||||
fit-margin-left="0"
|
||||
fit-margin-right="0"
|
||||
fit-margin-bottom="0"
|
||||
inkscape:window-width="1670"
|
||||
inkscape:window-height="723"
|
||||
inkscape:window-x="42"
|
||||
inkscape:window-y="158"
|
||||
inkscape:window-maximized="0" />
|
||||
<metadata
|
||||
id="metadata7">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(-153.88697,-412.74096)">
|
||||
<g
|
||||
id="g3004"
|
||||
transform="translate(153.4374,405.50687)">
|
||||
<text
|
||||
id="text3006"
|
||||
style="font-size:13.78678322px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Calibri"
|
||||
y="246.47653"
|
||||
x="0.44956902"
|
||||
xml:space="preserve"> </text>
|
||||
<path
|
||||
id="path3008"
|
||||
d="m 279.61319,66.547912 -0.0468,-23.360172 c -0.009,-0.346702 0.27162,-0.627811 0.61816,-0.627811 0.34654,0 0.62752,0.281109 0.62752,0.61844 l 0.0468,23.369543 c 0,0.337331 -0.28098,0.61844 -0.61815,0.61844 -0.34655,0.0094 -0.62753,-0.271738 -0.62753,-0.61844 z m -3.17508,-22.104551 3.73704,-7.505615 3.75578,7.486874 z"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.14985634px;stroke-linecap:butt;stroke-linejoin:bevel;stroke-opacity:1;stroke-dasharray:none"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
id="path3010"
|
||||
d="m 281.04619,126.53661 -0.59005,-22.61992 c 0,-0.3467 0.27161,-0.62781 0.60879,-0.63718 0.34654,-0.009 0.63689,0.26237 0.64625,0.60907 l 0.5807,22.61055 c 0.009,0.3467 -0.26225,0.62781 -0.59943,0.63718 -0.34654,0.009 -0.63689,-0.26237 -0.64626,-0.5997 z m -3.67148,-21.28933 3.54973,-7.589952 3.93373,7.393172 z"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.14985634px;stroke-linecap:butt;stroke-linejoin:bevel;stroke-opacity:1;stroke-dasharray:none"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
id="path3016"
|
||||
d="m 190.63599,68.421973 0,28.916764 178.32904,0 0,-28.916764 -178.32904,0 z"
|
||||
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
id="path3018"
|
||||
d="m 190.647,68.432978 0,28.894754 186.95136,0 0,-28.894754 z"
|
||||
style="fill:none;stroke:#000000;stroke-width:0.95861244px;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
inkscape:connector-curvature="0" />
|
||||
<text
|
||||
id="text3020"
|
||||
style="font-size:13.68622589px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Courier New"
|
||||
y="84.089729"
|
||||
x="203.04033"
|
||||
xml:space="preserve"
|
||||
transform="scale(0.99270628,1.0073473)">BOPAlgo_BuilderShape</text>
|
||||
<text
|
||||
id="text3024"
|
||||
style="font-size:13.78678322px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Courier New"
|
||||
y="102.69855"
|
||||
x="283.97775"
|
||||
xml:space="preserve"> </text>
|
||||
<path
|
||||
id="path3026"
|
||||
d="m 191.75992,7.7023914 0,28.9167636 177.9544,0 0,-28.9167636 -177.9544,0 z"
|
||||
clip-path="url(#clipEmfPath1)"
|
||||
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
id="path3028"
|
||||
d="m 191.7698,7.7122711 0,28.8970039 185.66905,0 0,-28.8970039 z"
|
||||
style="fill:none;stroke:#000000;stroke-width:0.95636153px;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
inkscape:connector-curvature="0" />
|
||||
<text
|
||||
id="text3030"
|
||||
style="font-size:13.78678322px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Courier New"
|
||||
y="23.987984"
|
||||
x="231.37817"
|
||||
xml:space="preserve">BOPAlgo_Algo</text>
|
||||
<text
|
||||
id="text3032"
|
||||
style="font-size:13.78678322px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Courier New"
|
||||
y="23.987984"
|
||||
x="330.28336"
|
||||
xml:space="preserve"> </text>
|
||||
<path
|
||||
id="path3034"
|
||||
d="m 190.63599,128.01712 0,28.91676 178.32904,0 0,-28.91676 -178.32904,0 z"
|
||||
clip-path="url(#clipEmfPath2)"
|
||||
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
id="path3036"
|
||||
d="m 190.64871,128.02984 0,28.89132 188.31283,0 0,-28.89132 z"
|
||||
style="fill:none;stroke:#000000;stroke-width:0.96203959px;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
inkscape:connector-curvature="0" />
|
||||
<text
|
||||
id="text3038"
|
||||
style="font-size:13.78678322px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Courier New"
|
||||
y="144.37767"
|
||||
x="218.04097"
|
||||
xml:space="preserve">BOPAlgo_Builder</text>
|
||||
<text
|
||||
id="text3040"
|
||||
style="font-size:13.78678322px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Courier New"
|
||||
y="144.37767"
|
||||
x="341.67245"
|
||||
xml:space="preserve"> </text>
|
||||
<path
|
||||
id="path3042"
|
||||
d="m 129.94418,199.23144 0,28.91677 150.04365,0 0,-28.91677 -150.04365,0 z"
|
||||
clip-path="url(#clipEmfPath3)"
|
||||
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
inkscape:connector-curvature="0" />
|
||||
<text
|
||||
id="text3050"
|
||||
style="font-size:13.78678322px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Courier New"
|
||||
y="233.43306"
|
||||
x="213.24557"
|
||||
xml:space="preserve"> </text>
|
||||
<path
|
||||
id="path3052"
|
||||
d="m 292.16366,199.23144 0,28.91677 150.04366,0 0,-28.91677 -150.04366,0 z"
|
||||
clip-path="url(#clipEmfPath4)"
|
||||
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
id="path3054"
|
||||
d="m 67.466014,185.63759 0,28.80655 188.150506,0 0,-28.80655 z"
|
||||
style="fill:none;stroke:#000000;stroke-width:1.04681468px;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
inkscape:connector-curvature="0" />
|
||||
<text
|
||||
id="text3056"
|
||||
style="font-size:13.78678322px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Courier New"
|
||||
y="204.21788"
|
||||
x="124.58641"
|
||||
xml:space="preserve">BOPAlgo_BOP</text>
|
||||
<text
|
||||
id="text3058"
|
||||
style="font-size:13.78678322px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Courier New"
|
||||
y="215.592"
|
||||
x="412.70435"
|
||||
xml:space="preserve"> </text>
|
||||
<path
|
||||
id="path3054-8"
|
||||
d="m 300.37408,185.70141 0,28.80655 188.1505,0 0,-28.80655 z"
|
||||
style="fill:none;stroke:#000000;stroke-width:1.04681468px;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
inkscape:connector-curvature="0" />
|
||||
<text
|
||||
id="text3056-9"
|
||||
style="font-size:13.78678322px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Courier New"
|
||||
y="203.31017"
|
||||
x="336.76245"
|
||||
xml:space="preserve">BOPAlgo_Section</text>
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.95747238px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-start:url(#Arrow2Lstart);marker-end:none"
|
||||
d="m 267.10914,158.63892 -77.87032,26.89356"
|
||||
id="path13459"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.88220716px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-start:url(#Arrow2Lstart);marker-end:none"
|
||||
d="m 316.41379,158.50756 65.91804,26.97147"
|
||||
id="path13459-4"
|
||||
inkscape:connector-curvature="0" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 2.9 KiB |
@@ -1,238 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="500.70731"
|
||||
height="102.98"
|
||||
id="svg3731"
|
||||
version="1.1"
|
||||
inkscape:version="0.48.4 r9939"
|
||||
sodipodi:docname="operations_image064.svg">
|
||||
<defs
|
||||
id="defs3733">
|
||||
<marker
|
||||
inkscape:stockid="Arrow2Mstart"
|
||||
orient="auto"
|
||||
refY="0"
|
||||
refX="0"
|
||||
id="Arrow2Mstart"
|
||||
style="overflow:visible">
|
||||
<path
|
||||
id="path4673"
|
||||
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round"
|
||||
d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
|
||||
transform="scale(0.6,0.6)"
|
||||
inkscape:connector-curvature="0" />
|
||||
</marker>
|
||||
<marker
|
||||
inkscape:stockid="Arrow1Lstart"
|
||||
orient="auto"
|
||||
refY="0"
|
||||
refX="0"
|
||||
id="Arrow1Lstart"
|
||||
style="overflow:visible">
|
||||
<path
|
||||
id="path4649"
|
||||
d="M 0,0 5,-5 -12.5,0 5,5 0,0 z"
|
||||
style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt"
|
||||
transform="matrix(0.8,0,0,0.8,10,0)"
|
||||
inkscape:connector-curvature="0" />
|
||||
</marker>
|
||||
<clipPath
|
||||
id="clipEmfPath1"
|
||||
clipPathUnits="userSpaceOnUse">
|
||||
<rect
|
||||
id="rect3744"
|
||||
height="157.5"
|
||||
width="566.85828"
|
||||
y="0"
|
||||
x="0" />
|
||||
</clipPath>
|
||||
<clipPath
|
||||
id="clipEmfPath2"
|
||||
clipPathUnits="userSpaceOnUse">
|
||||
<rect
|
||||
id="rect3747"
|
||||
height="15"
|
||||
width="134.10196"
|
||||
y="14.7"
|
||||
x="215.55315" />
|
||||
</clipPath>
|
||||
<clipPath
|
||||
id="clipEmfPath3"
|
||||
clipPathUnits="userSpaceOnUse">
|
||||
<rect
|
||||
id="rect3750"
|
||||
height="13.95"
|
||||
width="158.85233"
|
||||
y="118.5"
|
||||
x="53.850784" />
|
||||
</clipPath>
|
||||
<clipPath
|
||||
id="clipEmfPath4"
|
||||
clipPathUnits="userSpaceOnUse">
|
||||
<rect
|
||||
id="rect3753"
|
||||
height="15"
|
||||
width="189.90277"
|
||||
y="68.849998"
|
||||
x="185.10271" />
|
||||
</clipPath>
|
||||
<clipPath
|
||||
id="clipEmfPath5"
|
||||
clipPathUnits="userSpaceOnUse">
|
||||
<rect
|
||||
id="rect3756"
|
||||
height="13.95"
|
||||
width="180.15263"
|
||||
y="118.2"
|
||||
x="315.3046" />
|
||||
</clipPath>
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="1.7435336"
|
||||
inkscape:cx="250.35365"
|
||||
inkscape:cy="74.48907"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="g3758"
|
||||
showgrid="false"
|
||||
fit-margin-top="0"
|
||||
fit-margin-left="0"
|
||||
fit-margin-right="0"
|
||||
fit-margin-bottom="0"
|
||||
inkscape:window-width="1037"
|
||||
inkscape:window-height="615"
|
||||
inkscape:window-x="38"
|
||||
inkscape:window-y="209"
|
||||
inkscape:window-maximized="0" />
|
||||
<metadata
|
||||
id="metadata3736">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(204.63937,-395.29983)">
|
||||
<g
|
||||
id="g3758"
|
||||
transform="translate(-262.09021,339.42982)">
|
||||
<text
|
||||
id="text3760"
|
||||
style="font-size:12.45018196px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial"
|
||||
y="142.64999"
|
||||
x="558.15814"
|
||||
xml:space="preserve"> </text>
|
||||
<path
|
||||
id="path3762"
|
||||
d="m 214.87814,10.5 0,23.4375 135.43322,0 0,-23.4375 z"
|
||||
clip-path="url(#clipEmfPath1)"
|
||||
style="fill:none;stroke:#000000;stroke-width:1.25626838px;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
inkscape:connector-curvature="0"
|
||||
transform="translate(-1.4412873,56.78124)" />
|
||||
<text
|
||||
id="text3764"
|
||||
style="font-size:12.45018196px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Courier New"
|
||||
y="80.110596"
|
||||
x="236.44154"
|
||||
xml:space="preserve">BOPAlgo_Algo</text>
|
||||
<text
|
||||
id="text3766"
|
||||
style="font-size:12.45018196px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Courier New"
|
||||
y="25.049999"
|
||||
x="327.60477"
|
||||
xml:space="preserve"> </text>
|
||||
<path
|
||||
id="path3768"
|
||||
d="m 53.175776,114.3 0,22.37812 160.127334,0 0,-22.37812 z"
|
||||
clip-path="url(#clipEmfPath2)"
|
||||
style="fill:none;stroke:#000000;stroke-width:1.24689317px;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
inkscape:connector-curvature="0" />
|
||||
<text
|
||||
id="text3772"
|
||||
style="font-size:12.45018196px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Courier New"
|
||||
y="128.85001"
|
||||
x="204.603"
|
||||
xml:space="preserve"> </text>
|
||||
<text
|
||||
id="text3774"
|
||||
style="font-size:12.45018196px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial"
|
||||
y="158.85001"
|
||||
x="57.45084"
|
||||
xml:space="preserve"> </text>
|
||||
<path
|
||||
id="path3776"
|
||||
d="m 280.56035,62.94375 -0.59064,-22.621875 c -0.009,-0.346875 0.26251,-0.6375 0.60939,-0.646875 0.34688,-0.0094 0.62813,0.2625 0.63751,0.609375 l 0.59063,22.63125 c 0.009,0.346875 -0.2625,0.628125 -0.60938,0.6375 -0.34688,0.0094 -0.62814,-0.2625 -0.63751,-0.609375 z m -3.68443,-21.290625 3.55317,-7.603125 3.94694,7.40625 z"
|
||||
clip-path="url(#clipEmfPath3)"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.1500022px;stroke-linecap:butt;stroke-linejoin:bevel;stroke-opacity:1;stroke-dasharray:none"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
id="path3778"
|
||||
d="m 185.00124,121.96729 0,23.4375 191.2528,0 0,-23.4375 z"
|
||||
style="fill:none;stroke:#000000;stroke-width:1.25626838px;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
inkscape:connector-curvature="0" />
|
||||
<text
|
||||
id="text3780"
|
||||
style="font-size:12.45018196px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Courier New"
|
||||
y="135.98123"
|
||||
x="213.3766"
|
||||
xml:space="preserve">BOPAlgo_PaveFiller</text>
|
||||
<text
|
||||
id="text3782"
|
||||
style="font-size:12.45018196px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Courier New"
|
||||
y="79.199997"
|
||||
x="351.30511"
|
||||
xml:space="preserve"> </text>
|
||||
<text
|
||||
id="text3784"
|
||||
style="font-size:12.45018196px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Courier New"
|
||||
y="108.3"
|
||||
x="188.70276"
|
||||
xml:space="preserve"> </text>
|
||||
<path
|
||||
id="path3786"
|
||||
d="m 198.98728,113.10938 20.70968,-20.700005 c 0.24375,-0.24375 0.63751,-0.24375 0.88126,0 0.24375,0.24375 0.24375,0.6375 0,0.88125 L 199.87792,114 c -0.24376,0.24375 -0.64689,0.24375 -0.89064,0 -0.24375,-0.24375 -0.24375,-0.64688 0,-0.89062 z m 17.61588,-22.031255 7.95012,-2.653125 -2.64379,7.959375 z"
|
||||
clip-path="url(#clipEmfPath4)"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.1500022px;stroke-linecap:butt;stroke-linejoin:bevel;stroke-opacity:1;stroke-dasharray:none"
|
||||
inkscape:connector-curvature="0" />
|
||||
<text
|
||||
id="text3794"
|
||||
style="font-size:12.45018196px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Courier New"
|
||||
y="128.55"
|
||||
x="480.30701"
|
||||
xml:space="preserve"> </text>
|
||||
<text
|
||||
id="text3796"
|
||||
style="font-size:12.45018196px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial"
|
||||
y="158.39999"
|
||||
x="318.75464"
|
||||
xml:space="preserve"> </text>
|
||||
<path
|
||||
style="fill:#916f6f;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-start:url(#Arrow2Mstart)"
|
||||
d="m 281.70806,91.744904 0,30.398036"
|
||||
id="path3875"
|
||||
inkscape:connector-curvature="0" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 8.9 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 86 KiB |
BIN
dox/user_guides/xde/images/assm_wheel_axle.png
Normal file
After Width: | Height: | Size: 6.0 KiB |
BIN
dox/user_guides/xde/images/assm_wheel_axle_root.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
dox/user_guides/xde/images/assm_wheel_axle_sa.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
dox/user_guides/xde/images/xde_as1.png
Normal file
After Width: | Height: | Size: 49 KiB |
BIN
dox/user_guides/xde/images/xde_as1_bracket_subassembly.png
Normal file
After Width: | Height: | Size: 44 KiB |
BIN
dox/user_guides/xde/images/xde_as1_bracket_subassembly_graph.png
Normal file
After Width: | Height: | Size: 37 KiB |
BIN
dox/user_guides/xde/images/xde_as1_part_of_graph.png
Normal file
After Width: | Height: | Size: 74 KiB |
BIN
dox/user_guides/xde/images/xde_as1_part_of_tree.png
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
dox/user_guides/xde/images/xde_as1_parts.png
Normal file
After Width: | Height: | Size: 46 KiB |
BIN
dox/user_guides/xde/images/xde_assembly_design.png
Normal file
After Width: | Height: | Size: 51 KiB |
BIN
dox/user_guides/xde/images/xde_assembly_ocaf.png
Normal file
After Width: | Height: | Size: 14 KiB |
@@ -5,32 +5,116 @@
|
||||
|
||||
@section occt_xde_1 Introduction
|
||||
|
||||
This manual explains how to use the Extended Data Exchange (XDE). It provides basic documentation on setting up and using XDE. For advanced information on XDE and its applications, see our <a href="http://www.opencascade.com/content/tutorial-learning">E-learning & Training</a> offerings.
|
||||
For hierarchically organizing engineering data, OCCT provides application framework (OCAF). A specialization of OCAF for representing CAD product information is XDE (eXtended Data Exchange) toolset. XDE is capable of associating geometry with metadata (PMI, names, colors, layers, etc.). This framework uses the component-level abstraction of an assembly (see \ref occt_xde_references_ShahMantyla95 "[Shah and Mantyla 1995]" for the overview of possible abstractions). The leaf nodes in the XDE hierarchy are the _part instances_. The interior nodes are the _subassemblies_. The root node represents the _entire assembly_ (several roots are allowed).
|
||||
|
||||
The Extended Data Exchange (XDE) module allows extending the scope of exchange by translating additional data attached to geometric BREP data, thereby improving the interoperability with external software.
|
||||
|
||||
Data types such as colors, layers, assembly descriptions and validation properties (i.e. center of gravity, etc.) are supported. These data are stored together with shapes in an XCAF document. It is also possible to add a new types of data taking the existing tools as prototypes.
|
||||
|
||||
Finally, the XDE provides reader and writer tools for reading and writing the data supported by XCAF to and from IGES and STEP files.
|
||||
|
||||
@figure{/user_guides/xde/images/646_xde_11_400.png,"Shape imported using XDE",240}
|
||||
|
||||
The XDE component requires @ref occt_user_guides__shape_healing "Shape Healing" toolkit for operation.
|
||||
@figure{/user_guides/xde/images/646_xde_11_400.png,"Shape imported using XDE (courtesy of Dave Goetsch via GrabCAD).",240}
|
||||
|
||||
@subsection occt_xde_1_1 Basic terms
|
||||
|
||||
For better understanding of XDE, certain key terms are defined:
|
||||
* **Shape** -- a standalone shape, which does not belong to the assembly structure.
|
||||
* **Instance** -- a replication of another shape with a location that can be the same location or a different one.
|
||||
* **Assembly** -- a construction that is either a root or a sub-assembly.
|
||||
We use the following terminology throughout this documentation:
|
||||
|
||||
* **Assembly:** a hierarchy of elements representing a complex product.
|
||||
|
||||
* **Subassembly:** a group of elements inside an assembly. Typically, a subassembly is a set of components that are physically assembled into a unit and then assembled with other components.
|
||||
|
||||
* **Part:** a piece of data representing a simple individual product.
|
||||
|
||||
* **Instance:** a *usage occurrence* of a part or a subassembly. An instance is usually mounted to a parent component by specifying relative transformation. It should be noted that whenever term "instance" is used, it may refer to either a part or a subassembly. When an individual part is mentioned, we use a more precise "part instance" term.
|
||||
|
||||
* **Assembly item:** any element in the component hierarchy of an assembly. If visualization is employed, an assembly item typically corresponds to an element in a scene graph.
|
||||
|
||||
* **Component:** any *nested* assembly item.
|
||||
|
||||
The key terms are illustrated in the figure below.
|
||||
|
||||
@figure{/user_guides/xde/images/xde_assembly_design.png,"Parts and instances.",240}
|
||||
|
||||
The example above assumes that two parts (a plate and a cylinder) are created independently in some part design system. Then an assembly is constructed by instantiating these parts with some user-defined mutual placements (probably driven by assembly constraints). In this example, the root assembly item "MyAssembly" contains the following components:
|
||||
|
||||
* "Plate" as the only instance of the plate part.
|
||||
* "Cylinders" as the subassembly which includes three instances of a cylinder part.
|
||||
|
||||
A CAD part in a design system has usually no link to other parts in a product unless it is dropped to an assembly structure. To become an assembly component, the part has to be instantiated. An instance is technically a reference to the part with a proper location. The distinction between *parts* and *instances* is one of the fundamental principles in assembly design. A single part may have multiple instances all sharing the same product information (geometry and metadata). It is also valid to associate metadata with the instances themselves, though the latter is not very common (and not fully supported in OCCT).
|
||||
|
||||
\note The important point is the distinction between parts and instances. A part is a single product which may several times occur in an assembly. An instance is a particular occurrence of a part in an assembly.
|
||||
|
||||
@subsection occt_xde_1_2 XDE Organization
|
||||
|
||||
The basis of XDE, called XCAF, is a framework based on OCAF (Open CASCADE Technology Application Framework) and is intended to be used with assemblies and with various kinds of attached data (attributes). Attributes can be Individual attributes for a shape, specifying some characteristics of a shape, or they can be Grouping attributes, specifying that a shape belongs to a given group whose definition is specified apart from the shapes.
|
||||
@subsubsection occt_xde_1_2_1 Assemblies
|
||||
|
||||
XDE works in an OCAF document with a specific organization defined in a dedicated XCAF module. This organization is used by various functions of XDE to exchange standardized data other than shapes and geometry.
|
||||
Assembly components are represented as nodes in a directed graph. The arcs of the graph represent "part-of" relations between the components (read like "component A is part of component B"). The following figure illustrates a conventional assembly from \ref occt_xde_references_cax_if "[CAx-IF STEP Library]" composed of five unique parts.
|
||||
|
||||
The Assembly Structure and attributes assigned to shapes are stored in the OCAF tree. It is possible to obtain TopoDS representation for each level of the assembly in the form of *TopoDS_Compound* or *TopoDS_Shape* using the API.
|
||||
@figure{/user_guides/xde/images/xde_as1.png,"Sample assembly.",240}
|
||||
|
||||
Each part is defined in its local coordinate system and dropped to an assembly with a suitable placement. As such, the bolt has six instances, while a nut is instantiated eight times.
|
||||
|
||||
@figure{/user_guides/xde/images/xde_as1_parts.png,"Parts of sample assembly.",240}
|
||||
|
||||
The "part-of" graph is sketched in the following figure.
|
||||
|
||||
@figure{/user_guides/xde/images/xde_as1_part_of_graph.png,"\"Part-of\" assembly graph.",240}
|
||||
|
||||
There are as many component occurrences in an assembly as many paths exist to each leaf from the root nodes. Starting from the root node "as1", 18 unique ways are giving the total number of part occurrences in the component structure.
|
||||
|
||||
Technically, each node of the graph is represented by a label in the underlying OCAF structure. However, an OCAF label (TDF_Label) cannot be used as an identifier of an assembly item. In general case, one label can be reached from several "directions" of traversal. Thus, to address a single component occurrence unambiguously, one should use a full path to the occurrence in a component graph as an identifier. The following figure illustrates the result of assembly graph traversal which can be represented as a user-friendly tree (scene graph).
|
||||
|
||||
@figure{/user_guides/xde/images/xde_as1_part_of_tree.png,"\"Part-of\" assembly tree.",240}
|
||||
|
||||
Such a tree stands for the hierarchy of the components which can be shown to the user. A child-parent relation has "part-of" meaning. Notice that an individual node in the assembly tree is associated with a unique path to the item in the component graph. The following figure illustrates a simple bracket subassembly which is used twice as a component in the sample model.
|
||||
|
||||
@figure{/user_guides/xde/images/xde_as1_bracket_subassembly.png,"Bracket subassembly instantiated twice in sample model.",240}
|
||||
|
||||
The following figure outlines the component graph for this subassembly.
|
||||
|
||||
@figure{/user_guides/xde/images/xde_as1_bracket_subassembly_graph.png,"\"Part-of\" graph for bracket subassembly.",240}
|
||||
|
||||
Assembly structure is not directly related to any geometry. Therefore, assembly structure gives only a conceptual view of a product. According to \ref occt_xde_references_ShahMantyla95 "[Shah and Mantyla 1995]" (p. 9), many design tasks are not related to geometry at all, but to other characteristics of a product. Some problems involve idealized or simplified geometry, and it often happens that a detailed geometry is not even required (at least during some design phases). At the same time, the geometric model for a subassembly in XDE can be directly accessed at any time in the form of *TopoDS_Compound*.
|
||||
|
||||
XDE defines the specific organization of the assembly content. All elements are stored at sub-labels of label 0:1:1. There can be one or more roots. The hierarchy of labels is always two-levels nested. The first level (direct children of 0:1:1) declares all products within an assembly. The second level determines the "part-of" relations between the assembly elements.
|
||||
|
||||
@figure{/user_guides/xde/images/xde_assembly_ocaf.png,"Internal (OCAF) representation of XDE document.",240}
|
||||
|
||||
@subsubsection occt_xde_1_2_2 How to explore assembly structure
|
||||
|
||||
To explore the assembly structure, you may use a specialized *XCAFDoc_AssemblyGraph* tool. The following code snippet illustrates the construction of explicit assembly graph from XDE document.
|
||||
|
||||
\code
|
||||
Handle(TDocStd_Document) doc = ...; // Your XDE document
|
||||
|
||||
// Prepare assembly graph
|
||||
Handle(XCAFDoc_AssemblyGraph) asmGraph = new XCAFDoc_AssemblyGraph(doc, true);
|
||||
\endcode
|
||||
|
||||
*XCAFDoc_AssemblyGraph* does not contain geometry of the assembly being explored. It is a formal graph structure which makes explicit the "part-of" relations between the assembly components. Each node in a graph is associated with one of the following types:
|
||||
|
||||
* **Root:**
|
||||
* **Subassembly**
|
||||
* **Part occurrence**
|
||||
* **Part**
|
||||
|
||||
A node contains a persistent ID which points to the corresponding OCAF label. The persistent ID is a key to access geometric representations and metadata associated with the corresponding element of assembly.
|
||||
|
||||
@subsubsection occt_xde_1_2_3 Multiple component occurrences
|
||||
|
||||
Consider two parts: wheel and axle shown in the picture below.
|
||||
|
||||
@figure{/user_guides/xde/images/assm_wheel_axle.png,"Two parts: wheel and axle.",240}
|
||||
|
||||
Consider a wheel-axle subassembly composed of one axle and two wheels.
|
||||
|
||||
@figure{/user_guides/xde/images/assm_wheel_axle_sa.png,"Subassembly composed of two wheels and one axle.",240}
|
||||
|
||||
A higher-level chassis assembly is in turn composed of two wheel-axle subassemblies, the front, and the rear.
|
||||
|
||||
@figure{/user_guides/xde/images/assm_wheel_axle_root.png,"Chassis assembly with multiple component occurrences.",240}
|
||||
|
||||
There is a requirement to identify individual components such as the left-front wheel. However, a wheel part has only two instances in the owner wheel-axle subassembly. The necessity to uniquely identify all component occurrences requires introducing a *transient* key for the corresponding assembly item. This key is essentially a path in the component graph which unambiguously addresses the element in question.
|
||||
|
||||
\note As reported by \ref occt_xde_references_Ungerer02 "[Ungerer and Buchanan 2002]", STEP PDM Schema is capable of tracking specific usages of assembly components. However, OCCT makes no assumption on the used STEP schema, so multiple component occurrences should be implemented at the level of XDE-based application.
|
||||
|
||||
\todo mention Grab Instance
|
||||
|
||||
//////////////////////////////////////////////////////////
|
||||
|
||||
Basic elements used by XDE are introduced in the XCAF sub-module by the package XCAFDoc. These elements consist in descriptions of commonly used data structures (apart from the shapes themselves) in normalized data exchanges. They are not attached to specific applications and do not bring specific semantics, but are structured according to the use and needs of data exchanges.
|
||||
The Document used by XDE usually starts as a *TDocStd_Document*.
|
||||
@@ -45,9 +129,7 @@ For example, a mechanical assembly can be defined as follows:
|
||||
@figure{/user_guides/xde/images/xde_image004.png,"Assembly View",240}
|
||||
|
||||
|
||||
XDE defines the specific organization of the assembly content. Shapes are stored on sub-labels of label 0:1:1. There can be one or more roots (called free shapes) whether they are true trees or simple shapes. A shape can be considered to be an Assembly (such as AS1 under 0:1:1:1 in Figure1) if it is defined with Components (sub-shapes, located or not).
|
||||
|
||||
*XCAFDoc_ShapeTool* is a tool that allows managing the Shape section of the XCAF document. This tool is implemented as an attribute and located at the root label of the shape section.
|
||||
|
||||
@subsection occt_xde_1_4 Validation Properties
|
||||
Validation properties are geometric characteristics of Shapes (volume, centroid, surface area) written to STEP files by the sending system. These characteristics are read by the receiving system to validate the quality of the translation. This is done by comparing the values computed by the original system with the same values computed by the receiving system on the resulting model.
|
||||
@@ -685,3 +767,14 @@ As a result, if an application works on Assemblies, on Colors or Layers, on Vali
|
||||
|
||||
In addition, if an application has a data structure far from these notions, it can get data (such as Colors and Names on Shapes) according to its needs, but without having to consider the whole.
|
||||
|
||||
@section occt_xde_references References
|
||||
|
||||
-# \anchor occt_xde_references_ShahMantyla95
|
||||
Shah J., Mantyla M. Parametric and Feature Based CAD/CAM. 1995.
|
||||
|
||||
-# \anchor occt_xde_references_cax_if
|
||||
CAx-IF STEP File Library // URL: https://cax-if.org/library/index.html
|
||||
|
||||
-# \anchor occt_xde_references_Ungerer02
|
||||
Ungerer, M. and Buchanan, K. 2002. Usage Guide for the STEP PDM Schema Release 4.3. PDM Implementor Forum, Darmstadt January.
|
||||
|
||||
|
@@ -15,7 +15,7 @@
|
||||
#ifndef _GeoAlgo_Sol_HeaderFile
|
||||
#define _GeoAlgo_Sol_HeaderFile
|
||||
|
||||
#ifndef _Handle_Geom_BSplineSurface_HeaderFile
|
||||
#ifndef _Geom_BSplineSurface_HeaderFile
|
||||
#include <Geom_BSplineSurface.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_Boolean_HeaderFile
|
||||
|
@@ -462,10 +462,10 @@
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\..\src\Handle_TOcaf_Application.hxx" />
|
||||
<ClInclude Include="..\..\..\src\Handle_TOcafFunction_BoxDriver.hxx" />
|
||||
<ClInclude Include="..\..\..\src\Handle_TOcafFunction_CutDriver.hxx" />
|
||||
<ClInclude Include="..\..\..\src\Handle_TOcafFunction_CylDriver.hxx" />
|
||||
<ClInclude Include="..\..\..\src\TOcaf_Application.hxx" />
|
||||
<ClInclude Include="..\..\..\src\TOcafFunction_BoxDriver.hxx" />
|
||||
<ClInclude Include="..\..\..\src\TOcafFunction_CutDriver.hxx" />
|
||||
<ClInclude Include="..\..\..\src\TOcafFunction_CylDriver.hxx" />
|
||||
<ClInclude Include="..\..\..\src\NewBoxDlg.h" />
|
||||
<ClInclude Include="..\..\..\src\NewCylDlg.h" />
|
||||
<ClInclude Include="..\..\..\src\OcafApp.h" />
|
||||
|
@@ -58,16 +58,16 @@
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\..\src\Handle_TOcaf_Application.hxx">
|
||||
<ClInclude Include="..\..\..\src\TOcaf_Application.hxx">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\src\Handle_TOcafFunction_BoxDriver.hxx">
|
||||
<ClInclude Include="..\..\..\src\TOcafFunction_BoxDriver.hxx">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\src\Handle_TOcafFunction_CutDriver.hxx">
|
||||
<ClInclude Include="..\..\..\src\TOcafFunction_CutDriver.hxx">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\src\Handle_TOcafFunction_CylDriver.hxx">
|
||||
<ClInclude Include="..\..\..\src\TOcafFunction_CylDriver.hxx">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\src\NewBoxDlg.h">
|
||||
|
@@ -34,6 +34,9 @@
|
||||
#define OPERATION_NOT_DONE 8
|
||||
#define NULL_OPERATION 9
|
||||
|
||||
// OCCT RTTI
|
||||
IMPLEMENT_STANDARD_RTTIEXT (OCAFSample_CommonDriver, OCAFSample_Driver)
|
||||
|
||||
//=======================================================================
|
||||
//function : Constructor
|
||||
//purpose :
|
||||
|
@@ -16,84 +16,22 @@
|
||||
#ifndef _OCAFSample_CommonDriver_HeaderFile
|
||||
#define _OCAFSample_CommonDriver_HeaderFile
|
||||
|
||||
#ifndef _Standard_HeaderFile
|
||||
#include <Standard.hxx>
|
||||
#endif
|
||||
#ifndef _Handle_OCAFSample_CommonDriver_HeaderFile
|
||||
#endif
|
||||
|
||||
#ifndef _OCAFSample_Driver_HeaderFile
|
||||
#include <Standard_Type.hxx>
|
||||
#include <OCAFSample_Driver.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_Integer_HeaderFile
|
||||
#include <Standard_Integer.hxx>
|
||||
#endif
|
||||
|
||||
class TFunction_Logbook;
|
||||
|
||||
|
||||
class OCAFSample_CommonDriver : public OCAFSample_Driver {
|
||||
|
||||
class OCAFSample_CommonDriver : public OCAFSample_Driver
|
||||
{
|
||||
public:
|
||||
|
||||
inline void* operator new(size_t,void* anAddress)
|
||||
{
|
||||
return anAddress;
|
||||
}
|
||||
inline void* operator new(size_t size)
|
||||
{
|
||||
return Standard::Allocate(size);
|
||||
}
|
||||
inline void operator delete(void *anAddress)
|
||||
{
|
||||
if (anAddress) Standard::Free((Standard_Address&)anAddress);
|
||||
}
|
||||
// inline void operator delete(void *anAddress, size_t size)
|
||||
// {
|
||||
// if (anAddress) Standard::Free((Standard_Address&)anAddress,size);
|
||||
// }
|
||||
// Methods PUBLIC
|
||||
//
|
||||
Standard_EXPORT OCAFSample_CommonDriver();
|
||||
Standard_EXPORT virtual Standard_Integer Execute(Handle(TFunction_Logbook)& theLogbook) const;
|
||||
Standard_EXPORT ~OCAFSample_CommonDriver();
|
||||
|
||||
|
||||
|
||||
|
||||
// Type management
|
||||
//
|
||||
Standard_EXPORT friend Handle(Standard_Type)& OCAFSample_CommonDriver_Type_();
|
||||
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
|
||||
Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
|
||||
|
||||
protected:
|
||||
|
||||
// Methods PROTECTED
|
||||
//
|
||||
|
||||
|
||||
// Fields PROTECTED
|
||||
//
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// Methods PRIVATE
|
||||
//
|
||||
|
||||
|
||||
// Fields PRIVATE
|
||||
//
|
||||
|
||||
Standard_EXPORT OCAFSample_CommonDriver ();
|
||||
Standard_EXPORT virtual Standard_Integer Execute (Handle (TFunction_Logbook)& theLogbook) const;
|
||||
Standard_EXPORT ~OCAFSample_CommonDriver ();
|
||||
|
||||
// OCCT RTTI
|
||||
DEFINE_STANDARD_RTTIEXT (OCAFSample_CommonDriver, OCAFSample_Driver)
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// other inline functions and methods (like "C++: function call" methods)
|
||||
//
|
||||
|
||||
|
||||
#endif
|
||||
|
@@ -16,92 +16,29 @@
|
||||
#ifndef _OCAFSample_Driver_HeaderFile
|
||||
#define _OCAFSample_Driver_HeaderFile
|
||||
|
||||
#ifndef _Standard_HeaderFile
|
||||
#include <Standard.hxx>
|
||||
#endif
|
||||
#ifndef _Handle_OCAFSample_Driver_HeaderFile
|
||||
#endif
|
||||
|
||||
#ifndef _TFunction_Driver_HeaderFile
|
||||
#include <TFunction_Driver.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_Boolean_HeaderFile
|
||||
#include <Standard_Boolean.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_Integer_HeaderFile
|
||||
#include <Standard_Integer.hxx>
|
||||
#endif
|
||||
class TFunction_Logbook;
|
||||
#include <TDF_LabelMap.hxx>
|
||||
|
||||
class TFunction_Logbook;
|
||||
|
||||
class OCAFSample_Driver : public TFunction_Driver {
|
||||
|
||||
class OCAFSample_Driver : public TFunction_Driver
|
||||
{
|
||||
public:
|
||||
|
||||
inline void* operator new(size_t,void* anAddress)
|
||||
{
|
||||
return anAddress;
|
||||
}
|
||||
inline void* operator new(size_t size)
|
||||
{
|
||||
return Standard::Allocate(size);
|
||||
}
|
||||
inline void operator delete(void *anAddress)
|
||||
{
|
||||
if (anAddress) Standard::Free((Standard_Address&)anAddress);
|
||||
}
|
||||
// inline void operator delete(void *anAddress, size_t size)
|
||||
// {
|
||||
// if (anAddress) Standard::Free((Standard_Address&)anAddress,size);
|
||||
// }
|
||||
// Methods PUBLIC
|
||||
//
|
||||
Standard_EXPORT void Validate(TFunction_Logbook& log) const;
|
||||
Standard_EXPORT virtual Standard_Boolean MustExecute(const Handle(TFunction_Logbook)& log) const;
|
||||
Standard_EXPORT virtual Standard_Integer Execute(Handle(TFunction_Logbook)& log) const;
|
||||
Standard_EXPORT virtual Standard_Boolean Arguments(TDF_LabelMap& theArgs) const;
|
||||
Standard_EXPORT virtual Standard_Boolean Results(TDF_LabelMap& theRes) const;
|
||||
Standard_EXPORT ~OCAFSample_Driver();
|
||||
Standard_EXPORT void Validate (TFunction_Logbook& log) const;
|
||||
Standard_EXPORT virtual Standard_Boolean MustExecute (const Handle (TFunction_Logbook)& log) const;
|
||||
Standard_EXPORT virtual Standard_Integer Execute (Handle (TFunction_Logbook)& log) const;
|
||||
Standard_EXPORT virtual Standard_Boolean Arguments (TDF_LabelMap& theArgs) const;
|
||||
Standard_EXPORT virtual Standard_Boolean Results (TDF_LabelMap& theRes) const;
|
||||
Standard_EXPORT ~OCAFSample_Driver ();
|
||||
|
||||
|
||||
|
||||
|
||||
// Type management
|
||||
//
|
||||
Standard_EXPORT friend Handle(Standard_Type)& OCAFSample_Driver_Type_();
|
||||
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
|
||||
Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
|
||||
// OCCT RTTI
|
||||
DEFINE_STANDARD_RTTIEXT(OCAFSample_Driver,TFunction_Driver)
|
||||
|
||||
protected:
|
||||
|
||||
// Methods PROTECTED
|
||||
//
|
||||
Standard_EXPORT OCAFSample_Driver();
|
||||
|
||||
|
||||
// Fields PROTECTED
|
||||
//
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// Methods PRIVATE
|
||||
//
|
||||
|
||||
|
||||
// Fields PRIVATE
|
||||
//
|
||||
|
||||
|
||||
Standard_EXPORT OCAFSample_Driver ();
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// other inline functions and methods (like "C++: function call" methods)
|
||||
//
|
||||
|
||||
|
||||
#endif
|
||||
|
@@ -1,68 +0,0 @@
|
||||
// File generated by CPPExt (Transient)
|
||||
// Copyright (C) 1991,1995 by
|
||||
//
|
||||
// MATRA DATAVISION, FRANCE
|
||||
//
|
||||
// This software is furnished in accordance with the terms and conditions
|
||||
// of the contract and with the inclusion of the above copyright notice.
|
||||
// This software or any other copy thereof may not be provided or otherwise
|
||||
// be made available to any other person. No title to an ownership of the
|
||||
// software is hereby transferred.
|
||||
//
|
||||
// At the termination of the contract, the software and all copies of this
|
||||
// software must be deleted.
|
||||
//
|
||||
#include <OCAFSample_Driver.jxx>
|
||||
|
||||
#ifndef _Standard_TypeMismatch_HeaderFile
|
||||
#include <Standard_TypeMismatch.hxx>
|
||||
#endif
|
||||
|
||||
OCAFSample_Driver::~OCAFSample_Driver() {}
|
||||
|
||||
|
||||
|
||||
Standard_EXPORT Handle_Standard_Type& OCAFSample_Driver_Type_()
|
||||
{
|
||||
|
||||
static Handle_Standard_Type aType1 = STANDARD_TYPE(TFunction_Driver);
|
||||
if ( aType1.IsNull()) aType1 = STANDARD_TYPE(TFunction_Driver);
|
||||
static Handle_Standard_Type aType2 = STANDARD_TYPE(Standard_Transient);
|
||||
if ( aType2.IsNull()) aType2 = STANDARD_TYPE(Standard_Transient);
|
||||
|
||||
static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,NULL};
|
||||
static Handle_Standard_Type _aType = new Standard_Type("OCAFSample_Driver",
|
||||
sizeof(OCAFSample_Driver),
|
||||
1,
|
||||
(Standard_Address)_Ancestors,
|
||||
(Standard_Address)NULL);
|
||||
|
||||
return _aType;
|
||||
}
|
||||
|
||||
|
||||
// DownCast method
|
||||
// allow safe downcasting
|
||||
//
|
||||
const Handle(OCAFSample_Driver) Handle(OCAFSample_Driver)::DownCast(const Handle(Standard_Transient)& AnObject)
|
||||
{
|
||||
Handle(OCAFSample_Driver) _anOtherObject;
|
||||
|
||||
if (!AnObject.IsNull()) {
|
||||
if (AnObject->IsKind(STANDARD_TYPE(OCAFSample_Driver))) {
|
||||
_anOtherObject = Handle(OCAFSample_Driver)((Handle(OCAFSample_Driver)&)AnObject);
|
||||
}
|
||||
}
|
||||
|
||||
return _anOtherObject ;
|
||||
}
|
||||
const Handle(Standard_Type)& OCAFSample_Driver::DynamicType() const
|
||||
{
|
||||
return STANDARD_TYPE(OCAFSample_Driver) ;
|
||||
}
|
||||
Standard_Boolean OCAFSample_Driver::IsKind(const Handle(Standard_Type)& AType) const
|
||||
{
|
||||
return (STANDARD_TYPE(OCAFSample_Driver) == AType || TFunction_Driver::IsKind(AType));
|
||||
}
|
||||
Handle_OCAFSample_Driver::~Handle_OCAFSample_Driver() {}
|
||||
|
@@ -1,9 +0,0 @@
|
||||
#ifndef _TFunction_Logbook_HeaderFile
|
||||
#include <TFunction_Logbook.hxx>
|
||||
#endif
|
||||
#ifndef _TDF_LabelMap_HeaderFile
|
||||
#include <TDF_LabelMap.hxx>
|
||||
#endif
|
||||
#ifndef _OCAFSample_Driver_HeaderFile
|
||||
#include <OCAFSample_Driver.hxx>
|
||||
#endif
|
@@ -10,7 +10,6 @@
|
||||
|
||||
#include <OCC_App.h>
|
||||
#include "OcafDoc.h"
|
||||
#include "TOCAF_Application.hxx"
|
||||
#include <TOcaf_Application.hxx>
|
||||
|
||||
|
||||
|
@@ -12,6 +12,8 @@
|
||||
#include "BRepPrimAPI_MakeBox.hxx"
|
||||
#include "TNaming_Builder.hxx"
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT (TOcafFunction_BoxDriver, TFunction_Driver)
|
||||
|
||||
//=======================================================================
|
||||
//function : GetID
|
||||
//purpose :
|
||||
@@ -118,32 +120,3 @@ Standard_Integer TOcafFunction_BoxDriver::Execute(Handle(TFunction_Logbook)& /*l
|
||||
// If there are no any mistakes we return 0:
|
||||
return 0;
|
||||
}
|
||||
|
||||
TOcafFunction_BoxDriver::~TOcafFunction_BoxDriver() {}
|
||||
|
||||
// DownCast method
|
||||
// allow safe downcasting
|
||||
//
|
||||
const Handle(TOcafFunction_BoxDriver) TOcafFunction_BoxDriver::DownCast(const Handle(Standard_Transient)& AnObject)
|
||||
{
|
||||
Handle(TOcafFunction_BoxDriver) _anOtherObject;
|
||||
|
||||
if (!AnObject.IsNull()) {
|
||||
if (AnObject->IsKind(STANDARD_TYPE(TOcafFunction_BoxDriver))) {
|
||||
_anOtherObject = Handle(TOcafFunction_BoxDriver)::DownCast (AnObject);
|
||||
}
|
||||
}
|
||||
|
||||
return _anOtherObject ;
|
||||
}
|
||||
const Handle(Standard_Type)& TOcafFunction_BoxDriver::DynamicType() const
|
||||
{
|
||||
return STANDARD_TYPE(TOcafFunction_BoxDriver) ;
|
||||
}
|
||||
Standard_Boolean TOcafFunction_BoxDriver::IsKind(const Handle(Standard_Type)& AType) const
|
||||
{
|
||||
return (STANDARD_TYPE(TOcafFunction_BoxDriver) == AType || TFunction_Driver::IsKind(AType));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@@ -31,74 +31,19 @@
|
||||
#endif
|
||||
class TFunction_Logbook;
|
||||
|
||||
|
||||
class TOcafFunction_BoxDriver : public TFunction_Driver {
|
||||
|
||||
class TOcafFunction_BoxDriver : public TFunction_Driver
|
||||
{
|
||||
public:
|
||||
|
||||
inline void* operator new(size_t,void* anAddress)
|
||||
{
|
||||
return anAddress;
|
||||
}
|
||||
inline void* operator new(size_t size)
|
||||
{
|
||||
return Standard::Allocate(size);
|
||||
}
|
||||
inline void operator delete(void *anAddress)
|
||||
{
|
||||
if (anAddress) Standard::Free((Standard_Address&)anAddress);
|
||||
}
|
||||
// inline void operator delete(void *anAddress, size_t size)
|
||||
// {
|
||||
// if (anAddress) Standard::Free((Standard_Address&)anAddress,size);
|
||||
// }
|
||||
// Methods PUBLIC
|
||||
//
|
||||
Standard_EXPORT static const Standard_GUID& GetID() ;
|
||||
Standard_EXPORT TOcafFunction_BoxDriver();
|
||||
Standard_EXPORT virtual void Validate(Handle(TFunction_Logbook)& log) const;
|
||||
Standard_EXPORT virtual Standard_Boolean MustExecute(const Handle(TFunction_Logbook)& log) const;
|
||||
Standard_EXPORT virtual Standard_Integer Execute(Handle(TFunction_Logbook)& log) const;
|
||||
Standard_EXPORT ~TOcafFunction_BoxDriver();
|
||||
|
||||
|
||||
|
||||
|
||||
// Type management
|
||||
//
|
||||
//Standard_EXPORT friend Handle(Standard_Type)& TOcafFunction_BoxDriver_Type_();
|
||||
Standard_EXPORT const Handle(TOcafFunction_BoxDriver) DownCast(const Handle(Standard_Transient)& AnObject);
|
||||
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
|
||||
Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
|
||||
|
||||
protected:
|
||||
|
||||
// Methods PROTECTED
|
||||
//
|
||||
|
||||
|
||||
// Fields PROTECTED
|
||||
//
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// Methods PRIVATE
|
||||
//
|
||||
|
||||
|
||||
// Fields PRIVATE
|
||||
//
|
||||
|
||||
Standard_EXPORT static const Standard_GUID& GetID ();
|
||||
Standard_EXPORT TOcafFunction_BoxDriver ();
|
||||
Standard_EXPORT virtual void Validate (Handle (TFunction_Logbook)& log) const;
|
||||
Standard_EXPORT virtual Standard_Boolean MustExecute (const Handle (TFunction_Logbook)& log) const;
|
||||
Standard_EXPORT virtual Standard_Integer Execute (Handle (TFunction_Logbook)& log) const;
|
||||
|
||||
// OCCT RTTI
|
||||
DEFINE_STANDARD_RTTIEXT(TOcafFunction_BoxDriver,TFunction_Driver)
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// other inline functions and methods (like "C++: function call" methods)
|
||||
//
|
||||
|
||||
|
||||
#endif
|
||||
|
@@ -17,6 +17,8 @@
|
||||
#include "TFunction_Logbook.hxx"
|
||||
#include "TDF_Reference.hxx"
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT (TOcafFunction_CutDriver, TFunction_Driver)
|
||||
|
||||
//=======================================================================
|
||||
//function : GetID
|
||||
//purpose :
|
||||
@@ -139,32 +141,3 @@ Standard_Integer TOcafFunction_CutDriver::Execute(Handle(TFunction_Logbook)& /*l
|
||||
// If there are no any mistakes we return 0:
|
||||
return 0;
|
||||
}
|
||||
|
||||
TOcafFunction_CutDriver::~TOcafFunction_CutDriver() {}
|
||||
|
||||
// DownCast method
|
||||
// allow safe downcasting
|
||||
//
|
||||
const Handle(TOcafFunction_CutDriver) TOcafFunction_CutDriver::DownCast(const Handle(Standard_Transient)& AnObject)
|
||||
{
|
||||
Handle(TOcafFunction_CutDriver) _anOtherObject;
|
||||
|
||||
if (!AnObject.IsNull()) {
|
||||
if (AnObject->IsKind(STANDARD_TYPE(TOcafFunction_CutDriver))) {
|
||||
_anOtherObject = Handle(TOcafFunction_CutDriver)::DownCast (AnObject);
|
||||
}
|
||||
}
|
||||
|
||||
return _anOtherObject ;
|
||||
}
|
||||
const Handle(Standard_Type)& TOcafFunction_CutDriver::DynamicType() const
|
||||
{
|
||||
return STANDARD_TYPE(TOcafFunction_CutDriver) ;
|
||||
}
|
||||
Standard_Boolean TOcafFunction_CutDriver::IsKind(const Handle(Standard_Type)& AType) const
|
||||
{
|
||||
return (STANDARD_TYPE(TOcafFunction_CutDriver) == AType || TFunction_Driver::IsKind(AType));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@@ -32,73 +32,18 @@
|
||||
class TFunction_Logbook;
|
||||
|
||||
|
||||
class TOcafFunction_CutDriver : public TFunction_Driver {
|
||||
|
||||
class TOcafFunction_CutDriver : public TFunction_Driver
|
||||
{
|
||||
public:
|
||||
|
||||
inline void* operator new(size_t,void* anAddress)
|
||||
{
|
||||
return anAddress;
|
||||
}
|
||||
inline void* operator new(size_t size)
|
||||
{
|
||||
return Standard::Allocate(size);
|
||||
}
|
||||
inline void operator delete(void *anAddress)
|
||||
{
|
||||
if (anAddress) Standard::Free((Standard_Address&)anAddress);
|
||||
}
|
||||
// inline void operator delete(void *anAddress, size_t size)
|
||||
// {
|
||||
// if (anAddress) Standard::Free((Standard_Address&)anAddress,size);
|
||||
// }
|
||||
// Methods PUBLIC
|
||||
//
|
||||
Standard_EXPORT static const Standard_GUID& GetID() ;
|
||||
Standard_EXPORT TOcafFunction_CutDriver();
|
||||
Standard_EXPORT virtual void Validate(Handle(TFunction_Logbook)& log) const;
|
||||
Standard_EXPORT virtual Standard_Boolean MustExecute(const Handle(TFunction_Logbook)& log) const;
|
||||
Standard_EXPORT virtual Standard_Integer Execute(Handle(TFunction_Logbook)& log) const;
|
||||
Standard_EXPORT ~TOcafFunction_CutDriver();
|
||||
|
||||
|
||||
|
||||
|
||||
// Type management
|
||||
//
|
||||
//Standard_EXPORT friend Handle(Standard_Type)& TOcafFunction_CutDriver_Type_();
|
||||
Standard_EXPORT const Handle(TOcafFunction_CutDriver) DownCast(const Handle(Standard_Transient)& AnObject);
|
||||
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
|
||||
Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
|
||||
|
||||
protected:
|
||||
|
||||
// Methods PROTECTED
|
||||
//
|
||||
|
||||
|
||||
// Fields PROTECTED
|
||||
//
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// Methods PRIVATE
|
||||
//
|
||||
|
||||
|
||||
// Fields PRIVATE
|
||||
//
|
||||
|
||||
Standard_EXPORT static const Standard_GUID& GetID() ;
|
||||
Standard_EXPORT TOcafFunction_CutDriver ();
|
||||
Standard_EXPORT virtual void Validate (Handle (TFunction_Logbook)& log) const;
|
||||
Standard_EXPORT virtual Standard_Boolean MustExecute (const Handle (TFunction_Logbook)& log) const;
|
||||
Standard_EXPORT virtual Standard_Integer Execute (Handle (TFunction_Logbook)& log) const;
|
||||
|
||||
// OCCT RTTI
|
||||
DEFINE_STANDARD_RTTIEXT(TOcafFunction_CutDriver,TFunction_Driver)
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// other inline functions and methods (like "C++: function call" methods)
|
||||
//
|
||||
|
||||
|
||||
#endif
|
||||
|
@@ -13,6 +13,7 @@
|
||||
#include "TDataStd_Real.hxx"
|
||||
#include "TNaming_Builder.hxx"
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT (TOcafFunction_CylDriver, TFunction_Driver)
|
||||
|
||||
//=======================================================================
|
||||
//function : GetID
|
||||
@@ -113,32 +114,3 @@ Standard_Integer TOcafFunction_CylDriver::Execute(Handle(TFunction_Logbook)& /*l
|
||||
// If there are no any mistakes we return 0:
|
||||
return 0;
|
||||
}
|
||||
|
||||
TOcafFunction_CylDriver::~TOcafFunction_CylDriver() {}
|
||||
|
||||
// DownCast method
|
||||
// allow safe downcasting
|
||||
//
|
||||
const Handle(TOcafFunction_CylDriver) TOcafFunction_CylDriver::DownCast(const Handle(Standard_Transient)& AnObject)
|
||||
{
|
||||
Handle(TOcafFunction_CylDriver) _anOtherObject;
|
||||
|
||||
if (!AnObject.IsNull()) {
|
||||
if (AnObject->IsKind(STANDARD_TYPE(TOcafFunction_CylDriver))) {
|
||||
_anOtherObject = Handle(TOcafFunction_CylDriver)::DownCast (AnObject);
|
||||
}
|
||||
}
|
||||
|
||||
return _anOtherObject ;
|
||||
}
|
||||
const Handle(Standard_Type)& TOcafFunction_CylDriver::DynamicType() const
|
||||
{
|
||||
return STANDARD_TYPE(TOcafFunction_CylDriver) ;
|
||||
}
|
||||
Standard_Boolean TOcafFunction_CylDriver::IsKind(const Handle(Standard_Type)& AType) const
|
||||
{
|
||||
return (STANDARD_TYPE(TOcafFunction_CylDriver) == AType || TFunction_Driver::IsKind(AType));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@@ -32,73 +32,18 @@
|
||||
class TFunction_Logbook;
|
||||
|
||||
|
||||
class TOcafFunction_CylDriver : public TFunction_Driver {
|
||||
|
||||
class TOcafFunction_CylDriver : public TFunction_Driver
|
||||
{
|
||||
public:
|
||||
|
||||
inline void* operator new(size_t,void* anAddress)
|
||||
{
|
||||
return anAddress;
|
||||
}
|
||||
inline void* operator new(size_t size)
|
||||
{
|
||||
return Standard::Allocate(size);
|
||||
}
|
||||
inline void operator delete(void *anAddress)
|
||||
{
|
||||
if (anAddress) Standard::Free((Standard_Address&)anAddress);
|
||||
}
|
||||
// inline void operator delete(void *anAddress, size_t size)
|
||||
// {
|
||||
// if (anAddress) Standard::Free((Standard_Address&)anAddress,size);
|
||||
// }
|
||||
// Methods PUBLIC
|
||||
//
|
||||
Standard_EXPORT static const Standard_GUID& GetID() ;
|
||||
Standard_EXPORT TOcafFunction_CylDriver();
|
||||
Standard_EXPORT virtual void Validate(Handle(TFunction_Logbook)& log) const;
|
||||
Standard_EXPORT virtual Standard_Boolean MustExecute(const Handle(TFunction_Logbook)& log) const;
|
||||
Standard_EXPORT virtual Standard_Integer Execute(Handle(TFunction_Logbook)& log) const;
|
||||
Standard_EXPORT ~TOcafFunction_CylDriver();
|
||||
|
||||
|
||||
|
||||
|
||||
// Type management
|
||||
//
|
||||
//Standard_EXPORT friend Handle(Standard_Type)& TOcafFunction_CylDriver_Type_();
|
||||
Standard_EXPORT const Handle(TOcafFunction_CylDriver) DownCast(const Handle(Standard_Transient)& AnObject);
|
||||
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
|
||||
Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
|
||||
|
||||
protected:
|
||||
|
||||
// Methods PROTECTED
|
||||
//
|
||||
|
||||
|
||||
// Fields PROTECTED
|
||||
//
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// Methods PRIVATE
|
||||
//
|
||||
|
||||
|
||||
// Fields PRIVATE
|
||||
//
|
||||
|
||||
Standard_EXPORT static const Standard_GUID& GetID ();
|
||||
Standard_EXPORT TOcafFunction_CylDriver ();
|
||||
Standard_EXPORT virtual void Validate (Handle (TFunction_Logbook)& log) const;
|
||||
Standard_EXPORT virtual Standard_Boolean MustExecute (const Handle (TFunction_Logbook)& log) const;
|
||||
Standard_EXPORT virtual Standard_Integer Execute (Handle (TFunction_Logbook)& log) const;
|
||||
|
||||
// OCCT RTTI
|
||||
DEFINE_STANDARD_RTTIEXT(TOcafFunction_CylDriver,TFunction_Driver)
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// other inline functions and methods (like "C++: function call" methods)
|
||||
//
|
||||
|
||||
|
||||
#endif
|
||||
|
@@ -5,7 +5,7 @@
|
||||
//Modified by Sergey RUIN (An instanciation of the drivers)
|
||||
|
||||
#include <stdafx.h>
|
||||
#include <TOcaf_Application.ixx>
|
||||
#include <TOcaf_Application.hxx>
|
||||
#include <TDF_Label.hxx>
|
||||
#include <TPrsStd_AISPresentation.hxx>
|
||||
#include <TPrsStd_AISViewer.hxx>
|
||||
@@ -15,6 +15,8 @@
|
||||
#include "TOcafFunction_CylDriver.hxx"
|
||||
#include "TOcafFunction_CutDriver.hxx"
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT (TOcaf_Application, TDocStd_Application)
|
||||
|
||||
//=======================================================================
|
||||
//function : TOcaf_Application
|
||||
//purpose :
|
||||
|
@@ -26,49 +26,13 @@
|
||||
class TDocStd_Document;
|
||||
|
||||
|
||||
class TOcaf_Application : public TDocStd_Application {
|
||||
|
||||
class TOcaf_Application : public TDocStd_Application
|
||||
{
|
||||
public:
|
||||
Standard_EXPORT TOcaf_Application ();
|
||||
|
||||
// Methods PUBLIC
|
||||
//
|
||||
Standard_EXPORT TOcaf_Application();
|
||||
|
||||
// Type management
|
||||
//
|
||||
//Standard_EXPORT friend Handle(Standard_Type)& TOcaf_Application_Type_();
|
||||
Standard_EXPORT const Handle(TOcaf_Application) DownCast(const Handle(Standard_Transient)& AnObject);
|
||||
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
|
||||
Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
|
||||
|
||||
protected:
|
||||
|
||||
// Methods PROTECTED
|
||||
//
|
||||
|
||||
|
||||
// Fields PROTECTED
|
||||
//
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// Methods PRIVATE
|
||||
//
|
||||
|
||||
|
||||
// Fields PRIVATE
|
||||
//
|
||||
|
||||
|
||||
// OCCT RTTI
|
||||
DEFINE_STANDARD_RTTIEXT (TOcaf_Application, TDocStd_Application)
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// other inline functions and methods (like "C++: function call" methods)
|
||||
//
|
||||
|
||||
|
||||
#endif
|
||||
|
@@ -1,45 +0,0 @@
|
||||
// File generated by CPPExt (Transient)
|
||||
// Copyright (C) 1991,1995 by
|
||||
//
|
||||
// MATRA DATAVISION, FRANCE
|
||||
//
|
||||
// This software is furnished in accordance with the terms and conditions
|
||||
// of the contract and with the inclusion of the above copyright notice.
|
||||
// This software or any other copy thereof may not be provided or otherwise
|
||||
// be made available to any other person. No title to an ownership of the
|
||||
// software is hereby transferred.
|
||||
//
|
||||
// At the termination of the contract, the software and all copies of this
|
||||
// software must be deleted.
|
||||
//
|
||||
#include <TOcaf_Application.jxx>
|
||||
|
||||
#ifndef _Standard_TypeMismatch_HeaderFile
|
||||
#include <Standard_TypeMismatch.hxx>
|
||||
#endif
|
||||
|
||||
// DownCast method
|
||||
// allow safe downcasting
|
||||
//
|
||||
const Handle(TOcaf_Application) TOcaf_Application::DownCast(const Handle(Standard_Transient)& AnObject)
|
||||
{
|
||||
Handle(TOcaf_Application) _anOtherObject;
|
||||
|
||||
if (!AnObject.IsNull()) {
|
||||
if (AnObject->IsKind(STANDARD_TYPE(TOcaf_Application))) {
|
||||
_anOtherObject = Handle(TOcaf_Application)((Handle(TOcaf_Application)&)AnObject);
|
||||
}
|
||||
}
|
||||
|
||||
return _anOtherObject ;
|
||||
}
|
||||
const Handle(Standard_Type)& TOcaf_Application::DynamicType() const
|
||||
{
|
||||
return STANDARD_TYPE(TOcaf_Application) ;
|
||||
}
|
||||
Standard_Boolean TOcaf_Application::IsKind(const Handle(Standard_Type)& AType) const
|
||||
{
|
||||
return (STANDARD_TYPE(TOcaf_Application) == AType || TDocStd_Application::IsKind(AType));
|
||||
}
|
||||
|
||||
|
@@ -1,9 +0,0 @@
|
||||
#ifndef _TColStd_SequenceOfExtendedString_HeaderFile
|
||||
#include <TColStd_SequenceOfExtendedString.hxx>
|
||||
#endif
|
||||
#ifndef _TDocStd_Document_HeaderFile
|
||||
#include <TDocStd_Document.hxx>
|
||||
#endif
|
||||
#ifndef _TOcaf_Application_HeaderFile
|
||||
#include <TOcaf_Application.hxx>
|
||||
#endif
|
@@ -1,8 +1,8 @@
|
||||
@echo off
|
||||
|
||||
call "custom.bat" %1 %2 %3
|
||||
|
||||
call "%~dp0..\..\..\env.bat" %1 %2 %3
|
||||
|
||||
call "custom.bat" %1 %2 %3
|
||||
|
||||
set "PATH=%QTDIR%/bin;%PATH%"
|
||||
set "QT_QPA_PLATFORM_PLUGIN_PATH=%QTDIR%\plugins\platforms"
|
@@ -1,9 +1,9 @@
|
||||
@echo off
|
||||
|
||||
call "custom.bat" %1 %2 %3
|
||||
|
||||
call "%~dp0..\..\..\env.bat" %1 %2 %3
|
||||
|
||||
call "custom.bat" %1 %2 %3
|
||||
|
||||
set "RES_DIR=%~dp0win%ARCH%\%VCVER%\res"
|
||||
set "CSF_ResourcesDefaults=%RES_DIR%"
|
||||
set "CSF_IEResourcesDefaults=%RES_DIR%"
|
||||
|
@@ -1,9 +1,9 @@
|
||||
@echo off
|
||||
|
||||
call "custom.bat" %1 %2 %3
|
||||
|
||||
call "%~dp0..\..\..\env.bat" %1 %2 %3
|
||||
|
||||
call "custom.bat" %1 %2 %3
|
||||
|
||||
set "RES_DIR=%~dp0win%ARCH%\%VCVER%\res"
|
||||
set "CSF_ResourcesDefaults=%RES_DIR%"
|
||||
set "CSF_TutorialResourcesDefaults=%RES_DIR%"
|
||||
|
@@ -2336,6 +2336,9 @@ void AIS_InteractiveContext::EraseGlobal (const Handle(AIS_InteractiveObject)& t
|
||||
clearDynamicHighlight();
|
||||
}
|
||||
|
||||
// make sure highlighting presentations are properly erased
|
||||
theIObj->ErasePresentations (false);
|
||||
|
||||
if (IsSelected (theIObj)
|
||||
&& aStatus->DisplayMode() != aDispMode)
|
||||
{
|
||||
@@ -2396,6 +2399,7 @@ void AIS_InteractiveContext::ClearGlobal (const Handle(AIS_InteractiveObject)& t
|
||||
unhighlightOwners (theIObj);
|
||||
|
||||
myMainPM->Erase (theIObj, -1);
|
||||
theIObj->ErasePresentations (true); // make sure highlighting presentations are properly erased
|
||||
|
||||
// Object removes from Detected sequence
|
||||
Standard_DISABLE_DEPRECATION_WARNINGS
|
||||
@@ -2611,11 +2615,9 @@ Standard_Boolean AIS_InteractiveContext::IsoOnTriangulation() const
|
||||
return myDefaultDrawer->IsoOnTriangulation();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetPixelTolerance
|
||||
//purpose : Disables the mechanism of adaptive tolerance calculation in
|
||||
// SelectMgr_ViewerSelector and sets the given tolerance for ALL
|
||||
// sensitive entities activated. For more information, see
|
||||
// SelectMgr_ViewerSelector.hxx
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_InteractiveContext::SetPixelTolerance (const Standard_Integer thePrecision)
|
||||
{
|
||||
@@ -2781,24 +2783,6 @@ Standard_Boolean AIS_InteractiveContext::PlaneSize (Standard_Real& theX,
|
||||
return (Abs (theX - theY) <= Precision::Confusion());
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetAutoActivateSelection
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_InteractiveContext::SetAutoActivateSelection (const Standard_Boolean theIsAuto)
|
||||
{
|
||||
myIsAutoActivateSelMode = theIsAuto;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetAutoActivateSelection
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean AIS_InteractiveContext::GetAutoActivateSelection() const
|
||||
{
|
||||
return myIsAutoActivateSelMode;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetZLayer
|
||||
//purpose :
|
||||
|
@@ -1661,6 +1661,22 @@ void AIS_InteractiveContext::NextDetected()
|
||||
myCurDetected++;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : DetectedCurrentOwner
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Handle(SelectMgr_EntityOwner) AIS_InteractiveContext::DetectedCurrentOwner() const
|
||||
{
|
||||
if (HasOpenedContext())
|
||||
{
|
||||
return myLocalContexts (myCurLocalIndex)->DetectedCurrentOwner();
|
||||
}
|
||||
|
||||
return MoreDetected()
|
||||
? myMainSel->Picked (myDetectedSeq (myCurDetected))
|
||||
: Handle(SelectMgr_EntityOwner)();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : DetectedCurrentShape
|
||||
//purpose :
|
||||
|
@@ -237,12 +237,13 @@ public:
|
||||
//! Gets next current object during iteration through mouse-detected
|
||||
//! interactive objects.
|
||||
Standard_EXPORT void NextDetected();
|
||||
|
||||
|
||||
//! @return current mouse-detected Owner or null object if there is no current detected.
|
||||
Standard_EXPORT Handle(SelectMgr_EntityOwner) DetectedCurrentOwner() const;
|
||||
|
||||
//! @return current mouse-detected shape or empty (null) shape, if current interactive object
|
||||
//! is not a shape (AIS_Shape) or there is no current mouse-detected interactive object at all.
|
||||
Standard_EXPORT const TopoDS_Shape& DetectedCurrentShape() const;
|
||||
|
||||
|
||||
//! @return current mouse-detected interactive object or null object if there is no current detected.
|
||||
Standard_EXPORT Handle(AIS_InteractiveObject) DetectedCurrentObject() const;
|
||||
@@ -424,7 +425,6 @@ private:
|
||||
Standard_Integer myCurrentOwner;
|
||||
TColStd_SequenceOfInteger myDetectedSeq;
|
||||
Standard_Integer myCurDetected;
|
||||
AIS_SequenceOfInteractive myAISDetectedSeq;
|
||||
Standard_Integer myAISCurDetected;
|
||||
Handle(Prs3d_Drawer) mySubintStyle;
|
||||
|
||||
|
@@ -73,7 +73,6 @@ AIS_StatusOfDetection AIS_LocalContext::MoveTo (const Standard_Integer theXpix,
|
||||
}
|
||||
|
||||
myAISCurDetected = 0;
|
||||
myAISDetectedSeq.Clear();
|
||||
|
||||
myCurDetected = 0;
|
||||
myDetectedSeq.Clear();
|
||||
@@ -84,17 +83,10 @@ AIS_StatusOfDetection AIS_LocalContext::MoveTo (const Standard_Integer theXpix,
|
||||
for (Standard_Integer aDetIter = 1; aDetIter <= aDetectedNb; ++aDetIter)
|
||||
{
|
||||
Handle(SelectMgr_EntityOwner) anOwner = myMainVS->Picked (aDetIter);
|
||||
if (anOwner.IsNull()
|
||||
|| !myFilters->IsOk (anOwner))
|
||||
if (!anOwner.IsNull()
|
||||
&& myFilters->IsOk (anOwner))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
myDetectedSeq.Append (aDetIter); // normally they are already arranged in correct order...
|
||||
Handle(AIS_InteractiveObject) anObj = Handle(AIS_InteractiveObject)::DownCast (anOwner->Selectable());
|
||||
if (!anObj.IsNull())
|
||||
{
|
||||
myAISDetectedSeq.Append (anObj);
|
||||
myDetectedSeq.Append (aDetIter); // normally they are already arranged in correct order...
|
||||
}
|
||||
}
|
||||
|
||||
@@ -868,15 +860,17 @@ void AIS_LocalContext::ClearOutdatedSelection (const Handle(AIS_InteractiveObjec
|
||||
}
|
||||
|
||||
myDetectedSeq.Remove (anIdx--);
|
||||
|
||||
if (anIdx < myCurDetected)
|
||||
if (myCurDetected > anIdx)
|
||||
{
|
||||
myCurDetected--;
|
||||
--myCurDetected;
|
||||
}
|
||||
if (myAISCurDetected > anIdx)
|
||||
{
|
||||
--myAISCurDetected;
|
||||
}
|
||||
}
|
||||
myCurDetected = Max (myCurDetected, 1);
|
||||
|
||||
Standard_Boolean isAISRemainsDetected = Standard_False;
|
||||
myCurDetected = Max (myCurDetected, 1);
|
||||
myAISCurDetected = Max (myAISCurDetected, 1);
|
||||
|
||||
// 3. AIS_Selection : remove entity owners from AIS_Selection
|
||||
const Handle(V3d_Viewer)& aViewer = myCTX->CurrentViewer();
|
||||
@@ -889,11 +883,7 @@ void AIS_LocalContext::ClearOutdatedSelection (const Handle(AIS_InteractiveObjec
|
||||
continue;
|
||||
}
|
||||
|
||||
if (aValidOwners.Contains (anOwner))
|
||||
{
|
||||
isAISRemainsDetected = Standard_True;
|
||||
}
|
||||
else
|
||||
if (!aValidOwners.Contains (anOwner))
|
||||
{
|
||||
aRemoveEntites.Append (anOwner);
|
||||
anOwner->SetSelected (Standard_False);
|
||||
@@ -968,28 +958,6 @@ void AIS_LocalContext::ClearOutdatedSelection (const Handle(AIS_InteractiveObjec
|
||||
Standard_False);
|
||||
}
|
||||
}
|
||||
|
||||
// Renew iterator of ::DetectedCurrentObject()
|
||||
if (!isAISRemainsDetected)
|
||||
{
|
||||
// Remove the interactive object from detected sequences
|
||||
for (Standard_Integer anIdx = 1; anIdx <= myAISDetectedSeq.Length(); ++anIdx)
|
||||
{
|
||||
Handle(AIS_InteractiveObject) aDetectedIO = myAISDetectedSeq.Value (anIdx);
|
||||
if (aDetectedIO.IsNull() || aDetectedIO != theIO)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
myAISDetectedSeq.Remove (anIdx--);
|
||||
|
||||
if (anIdx < myAISCurDetected)
|
||||
{
|
||||
myAISCurDetected--;
|
||||
}
|
||||
}
|
||||
myAISCurDetected = Max (myAISCurDetected, 1);
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -1454,7 +1422,7 @@ Handle(SelectMgr_EntityOwner) AIS_LocalContext::FindSelectedOwnerFromShape(const
|
||||
//=======================================================================
|
||||
void AIS_LocalContext::InitDetected()
|
||||
{
|
||||
myAISCurDetected = myAISDetectedSeq.Length()? 1 : 0;
|
||||
myAISCurDetected = !myDetectedSeq.IsEmpty() ? myDetectedSeq.Lower() : 0;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -1463,7 +1431,8 @@ void AIS_LocalContext::InitDetected()
|
||||
//=======================================================================
|
||||
Standard_Boolean AIS_LocalContext::MoreDetected() const
|
||||
{
|
||||
return (myAISCurDetected > 0 && myAISCurDetected <= myAISDetectedSeq.Length());
|
||||
return myAISCurDetected >= myDetectedSeq.Lower()
|
||||
&& myAISCurDetected <= myDetectedSeq.Upper();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -1490,13 +1459,29 @@ const TopoDS_Shape& AIS_LocalContext::DetectedCurrentShape() const
|
||||
|
||||
return aCurrentShape->Shape();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : DetectedCurrentOwner
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Handle(SelectMgr_EntityOwner) AIS_LocalContext::DetectedCurrentOwner() const
|
||||
{
|
||||
return MoreDetected()
|
||||
? myMainVS->Picked (myDetectedSeq (myAISCurDetected))
|
||||
: Handle(SelectMgr_EntityOwner)();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : DetectedCurrentObject
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Handle(AIS_InteractiveObject) AIS_LocalContext::DetectedCurrentObject() const
|
||||
{
|
||||
return MoreDetected() ? myAISDetectedSeq(myAISCurDetected) : NULL;
|
||||
if (!MoreDetected())
|
||||
{
|
||||
return Handle(AIS_InteractiveObject)();
|
||||
}
|
||||
return Handle(AIS_InteractiveObject)::DownCast (myMainVS->Picked (myDetectedSeq (myAISCurDetected))->Selectable());
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
@@ -102,8 +102,8 @@ class BOPAlgo_PaveFiller;
|
||||
//! aMV.SetIntersect(bIntersect); //intersect or not the shapes from <aLS>
|
||||
//! //
|
||||
//! aMV.Perform(); //perform the operation
|
||||
//! if (aMV.ErrorStatus()) { //check error status
|
||||
//! return;
|
||||
//! if (aMV.HasErrors()) { //check error status
|
||||
//! return;
|
||||
//! }
|
||||
//! //
|
||||
//! const TopoDS_Shape& aResult = aMV.Shape(); //result of the operation
|
||||
|
@@ -2602,21 +2602,27 @@ void BOPAlgo_PaveFiller::UpdatePaveBlocks
|
||||
}
|
||||
//
|
||||
if (bRebuild) {
|
||||
Standard_Boolean isDegEdge = myDS->ShapeInfo(aPB->Edge()).HasFlag();
|
||||
Standard_Integer nE = aPB->Edge();
|
||||
// Check if the Pave Block has the edge set
|
||||
if (nE < 0) {
|
||||
// untouched edge
|
||||
nE = aPB->OriginalEdge();
|
||||
}
|
||||
Standard_Boolean isDegEdge = myDS->ShapeInfo(nE).HasFlag();
|
||||
if (wasRegularEdge && !isDegEdge && nV[0] == nV[1]) {
|
||||
// now edge has the same vertex on both ends;
|
||||
// check if it is not a regular closed curve.
|
||||
const TopoDS_Edge& aE = TopoDS::Edge(myDS->Shape(aPB->Edge()));
|
||||
const TopoDS_Edge& aE = TopoDS::Edge(myDS->Shape(nE));
|
||||
const TopoDS_Vertex& aV = TopoDS::Vertex(myDS->Shape(nV[0]));
|
||||
Standard_Real aLength = IntTools::Length(aE);
|
||||
Standard_Real aTolV = BRep_Tool::Tolerance(aV);
|
||||
if (aLength <= aTolV * 2.) {
|
||||
// micro edge, so mark it for removal
|
||||
aMicroEdges.Add(aPB->Edge());
|
||||
aMicroEdges.Add(nE);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
nSp = SplitEdge(aPB->Edge(), nV[0], aT[0], nV[1], aT[1]);
|
||||
nSp = SplitEdge(nE, nV[0], aT[0], nV[1], aT[1]);
|
||||
if (bCB)
|
||||
aCB->SetEdge(nSp);
|
||||
else
|
||||
|
@@ -3248,8 +3248,7 @@ Standard_Boolean BRepOffset_Tool::EnLargeFace
|
||||
const Standard_Boolean UpdatePCurve,
|
||||
const Standard_Boolean enlargeU,
|
||||
const Standard_Boolean enlargeVfirst,
|
||||
const Standard_Boolean enlargeVlast,
|
||||
const Standard_Boolean UseInfini)
|
||||
const Standard_Boolean enlargeVlast)
|
||||
{
|
||||
//---------------------------
|
||||
// extension de la geometrie.
|
||||
@@ -3271,20 +3270,8 @@ Standard_Boolean BRepOffset_Tool::EnLargeFace
|
||||
}
|
||||
|
||||
S->Bounds (US1,US2,VS1,VS2);
|
||||
if (UseInfini)
|
||||
{
|
||||
UU1 = VV1 = - TheInfini;
|
||||
UU2 = VV2 = TheInfini;
|
||||
}
|
||||
else
|
||||
{
|
||||
Standard_Real FaceDU = UF2 - UF1;
|
||||
Standard_Real FaceDV = VF2 - VF1;
|
||||
UU1 = UF1 - FaceDU;
|
||||
UU2 = UF2 + FaceDU;
|
||||
VV1 = VF1 - FaceDV;
|
||||
VV2 = VF2 + FaceDV;
|
||||
}
|
||||
UU1 = VV1 = - TheInfini;
|
||||
UU2 = VV2 = TheInfini;
|
||||
|
||||
if (CanExtentSurface) {
|
||||
SurfaceChange = EnlargeGeometry( S, UU1, UU2, VV1, VV2, isVV1degen, isVV2degen, UF1, UF2, VF1, VF2,
|
||||
@@ -4161,4 +4148,4 @@ void PerformPlanes(const TopoDS_Face& theFace1,
|
||||
Standard_Boolean IsInf(const Standard_Real theVal)
|
||||
{
|
||||
return (theVal > TheInfini*0.9);
|
||||
}
|
||||
}
|
@@ -104,14 +104,7 @@ public:
|
||||
//! if <UpdatePCurve> is TRUE, update the pcurves of the
|
||||
//! edges of <F> on the new surface.if the surface has been changed,
|
||||
//! Returns True if The Surface of <NF> has changed.
|
||||
Standard_EXPORT static Standard_Boolean EnLargeFace (const TopoDS_Face& F,
|
||||
TopoDS_Face& NF,
|
||||
const Standard_Boolean ChangeGeom,
|
||||
const Standard_Boolean UpDatePCurve = Standard_False,
|
||||
const Standard_Boolean enlargeU = Standard_True,
|
||||
const Standard_Boolean enlargeVfirst = Standard_True,
|
||||
const Standard_Boolean enlargeVlast = Standard_True,
|
||||
const Standard_Boolean UseInfini = Standard_True);
|
||||
Standard_EXPORT static Standard_Boolean EnLargeFace (const TopoDS_Face& F, TopoDS_Face& NF, const Standard_Boolean ChangeGeom, const Standard_Boolean UpDatePCurve = Standard_False, const Standard_Boolean enlargeU = Standard_True, const Standard_Boolean enlargeVfirst = Standard_True, const Standard_Boolean enlargeVlast = Standard_True);
|
||||
|
||||
Standard_EXPORT static void ExtentFace (const TopoDS_Face& F, TopTools_DataMapOfShapeShape& ConstShapes, TopTools_DataMapOfShapeShape& ToBuild, const TopAbs_State Side, const Standard_Real TolConf, TopoDS_Face& NF);
|
||||
|
||||
|
@@ -1,780 +0,0 @@
|
||||
// Created on: 2012-08-06
|
||||
// Created by: jgv@ROLEX
|
||||
// Copyright (c) 2012-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.
|
||||
|
||||
|
||||
#include <BRepOffsetAPI_PatchFaces.hxx>
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BRepAdaptor_Curve.hxx>
|
||||
#include <BRepAdaptor_Surface.hxx>
|
||||
#include <BRepAdaptor_HSurface.hxx>
|
||||
#include <BRepTopAdaptor_TopolTool.hxx>
|
||||
#include <LocalAnalysis_SurfaceContinuity.hxx>
|
||||
#include <TopOpeBRepTool_TOOL.hxx>
|
||||
#include <BRepLib.hxx>
|
||||
#include <BRepLib_MakeVertex.hxx>
|
||||
#include <BRepLib_MakeEdge.hxx>
|
||||
#include <BRepTools_WireExplorer.hxx>
|
||||
#include <TopExp.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Iterator.hxx>
|
||||
#include <IntTools_Context.hxx>
|
||||
#include <BOPTools_AlgoTools.hxx>
|
||||
#include <BRepOffset_Tool.hxx>
|
||||
#include <ShapeAnalysis_Surface.hxx>
|
||||
#include <ShapeConstruct_ProjectCurveOnSurface.hxx>
|
||||
#include <BRepAlgoAPI_Section.hxx>
|
||||
#include <Extrema_ExtPC.hxx>
|
||||
#include <BRepExtrema_ExtCC.hxx>
|
||||
#include <ShapeFix_Shape.hxx>
|
||||
|
||||
|
||||
static TopoDS_Edge MakeNewEdgeWithOldPcurvesOnNewSurfaces(const TopoDS_Edge& theEdge,
|
||||
const TopoDS_Face& theOldFace1,
|
||||
const TopoDS_Face& theNewFace1,
|
||||
const TopoDS_Face& theOldFace2,
|
||||
const TopoDS_Face& theNewFace2)
|
||||
{
|
||||
TopoDS_Edge aNewEdge;
|
||||
Standard_Real fpar, lpar;
|
||||
BRep_Builder BB;
|
||||
|
||||
Handle(Geom_Curve) aCurve = BRep_Tool::Curve(theEdge, fpar, lpar);
|
||||
aNewEdge = BRepLib_MakeEdge(aCurve, aCurve->FirstParameter(), aCurve->LastParameter()); //???
|
||||
TopoDS_Vertex V1, V2;
|
||||
TopExp::Vertices(aNewEdge, V1, V2);
|
||||
aNewEdge.Free(Standard_True);
|
||||
BB.Remove(aNewEdge, V1);
|
||||
BB.Remove(aNewEdge, V2);
|
||||
|
||||
Standard_Real Etol = BRep_Tool::Tolerance(theEdge);
|
||||
Handle(Geom2d_Curve) aPCurve1 = BRep_Tool::CurveOnSurface(theEdge, theOldFace1, fpar, lpar);
|
||||
BB.UpdateEdge(aNewEdge, aPCurve1, theNewFace1, Etol);
|
||||
Handle(Geom2d_Curve) aPCurve2 = BRep_Tool::CurveOnSurface(theEdge, theOldFace2, fpar, lpar);
|
||||
BB.UpdateEdge(aNewEdge, aPCurve2, theNewFace2, Etol);
|
||||
|
||||
return aNewEdge;
|
||||
}
|
||||
|
||||
static void UpdateEdgeByProjectionOfPCurve(TopoDS_Edge& anEdge,
|
||||
const TopoDS_Face& aNewFace,
|
||||
const TopoDS_Face& aBoundedNewFace)
|
||||
{
|
||||
BRep_Builder BB;
|
||||
Standard_Real fpar, lpar;
|
||||
|
||||
Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge,fpar,lpar);
|
||||
|
||||
Handle(Geom_Surface) NewSurf = BRep_Tool::Surface(aNewFace);
|
||||
Handle(ShapeAnalysis_Surface) SAS = new ShapeAnalysis_Surface(NewSurf);
|
||||
ShapeConstruct_ProjectCurveOnSurface aToolProj;
|
||||
aToolProj.Init(SAS, Precision::Confusion());
|
||||
Handle(Geom2d_Curve) NewPCurve;
|
||||
aToolProj.Perform(aCurve,fpar,lpar,NewPCurve);
|
||||
Standard_Real TolReached = SAS->Gap();
|
||||
//BB.UpdateEdge(anEdge, NullPCurve, aFace, 0.);
|
||||
BB.UpdateEdge(anEdge, NewPCurve, aBoundedNewFace, TolReached);
|
||||
TopoDS_Vertex V1, V2;
|
||||
TopExp::Vertices(anEdge, V1, V2);
|
||||
BB.UpdateVertex(V1, TolReached);
|
||||
BB.UpdateVertex(V2, TolReached);
|
||||
}
|
||||
|
||||
static void ProjectVertexOnNewEdge(const TopoDS_Vertex& theVertex,
|
||||
const TopoDS_Edge& theEdge,
|
||||
const TopoDS_Edge& theNewEdge,
|
||||
Standard_Real& theParam,
|
||||
gp_Pnt& thePnt,
|
||||
Standard_Real& theTolReached)
|
||||
{
|
||||
Standard_Real ParamOnEdge = BRep_Tool::Parameter(theVertex, theEdge);
|
||||
BRepAdaptor_Curve BAcurve(theEdge);
|
||||
BRepAdaptor_Curve BAnewcurve(theNewEdge);
|
||||
gp_Pnt PointOnEdge = BAcurve.Value(ParamOnEdge);
|
||||
Extrema_ExtPC Projector(PointOnEdge, BAnewcurve);
|
||||
Standard_Real Param[4], dist[4];
|
||||
gp_Pnt Pnt[4];
|
||||
Param[1] = BAnewcurve.FirstParameter();
|
||||
Param[2] = BAnewcurve.LastParameter();
|
||||
Projector.TrimmedSquareDistances(dist[1], dist[2], Pnt[1], Pnt[2]);
|
||||
dist[3] = RealLast();
|
||||
if (Projector.IsDone() && Projector.NbExt() > 0)
|
||||
{
|
||||
Standard_Integer imin = 1;
|
||||
for (Standard_Integer i = 2; i <= Projector.NbExt(); i++)
|
||||
if (Projector.SquareDistance(i) < Projector.SquareDistance(imin))
|
||||
imin = i;
|
||||
Param[3] = Projector.Point(imin).Parameter();
|
||||
dist[3] = Projector.SquareDistance(imin);
|
||||
Pnt[3] = Projector.Point(imin).Value();
|
||||
}
|
||||
|
||||
Standard_Integer imin = 1;
|
||||
for (Standard_Integer i = 2; i <= 3; i++)
|
||||
if (dist[i] < dist[imin])
|
||||
imin = i;
|
||||
|
||||
theParam = Param[imin];
|
||||
thePnt = Pnt[imin];
|
||||
theTolReached = sqrt(dist[imin]);
|
||||
}
|
||||
|
||||
static TopoDS_Edge GetGeneratedEdge(const TopoDS_Edge& anEdge,
|
||||
const TopoDS_Face& aFace,
|
||||
const TopoDS_Face& aNewFace)
|
||||
{
|
||||
TopoDS_Edge aNewEdge;
|
||||
|
||||
TopExp_Explorer Explo(aFace, TopAbs_EDGE);
|
||||
TopExp_Explorer ExploNew(aNewFace, TopAbs_EDGE);
|
||||
for (; Explo.More(); Explo.Next(),ExploNew.Next())
|
||||
{
|
||||
const TopoDS_Shape& EdgeInFace = Explo.Current();
|
||||
//const TopoDS_Shape& EdgeInNewFace = ExploNew.Current();
|
||||
if (anEdge == EdgeInFace)
|
||||
{
|
||||
aNewEdge = TopoDS::Edge(ExploNew.Current());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
TopoDS_Vertex V1, V2;
|
||||
TopExp::Vertices(aNewEdge, V1, V2);
|
||||
BRep_Builder BB;
|
||||
aNewEdge.Free(Standard_True);
|
||||
BB.Remove(aNewEdge, V1);
|
||||
BB.Remove(aNewEdge, V2);
|
||||
return aNewEdge;
|
||||
}
|
||||
|
||||
static TopAbs_Orientation OrientationInEdge(const TopoDS_Vertex& theVertex,
|
||||
const TopoDS_Edge& theEdge)
|
||||
{
|
||||
TopoDS_Vertex V1, V2;
|
||||
TopExp::Vertices(theEdge, V1, V2);
|
||||
if (theVertex.IsSame(V1))
|
||||
return TopAbs_FORWARD;
|
||||
|
||||
return TopAbs_REVERSED;
|
||||
}
|
||||
|
||||
static Standard_Boolean EdgeContains(const TopoDS_Edge& theEdge,
|
||||
const TopoDS_Vertex& theVertex)
|
||||
{
|
||||
TopoDS_Iterator ite(theEdge);
|
||||
for (; ite.More(); ite.Next())
|
||||
if (theVertex.IsSame(ite.Value()))
|
||||
return Standard_True;
|
||||
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
|
||||
static Standard_Boolean IsTangentFaces(const TopoDS_Edge& theEdge,
|
||||
const TopoDS_Face& theFace1,
|
||||
const TopoDS_Face& theFace2,
|
||||
const GeomAbs_Shape Order)
|
||||
{
|
||||
if (Order == GeomAbs_G1 &&
|
||||
BRep_Tool::Continuity( theEdge, theFace1, theFace2 ) != GeomAbs_C0)
|
||||
return Standard_True;
|
||||
|
||||
Standard_Real TolC0 = Max(0.001, 1.5*BRep_Tool::Tolerance(theEdge));
|
||||
|
||||
Standard_Real aFirst;
|
||||
Standard_Real aLast;
|
||||
|
||||
// Obtaining of pcurves of edge on two faces.
|
||||
const Handle(Geom2d_Curve) aC2d1 = BRep_Tool::CurveOnSurface
|
||||
(theEdge, theFace1, aFirst, aLast);
|
||||
const Handle(Geom2d_Curve) aC2d2 = BRep_Tool::CurveOnSurface
|
||||
(theEdge, theFace2, aFirst, aLast);
|
||||
if (aC2d1.IsNull() || aC2d2.IsNull())
|
||||
return Standard_False;
|
||||
|
||||
// Obtaining of two surfaces from adjacent faces.
|
||||
Handle(Geom_Surface) aSurf1 = BRep_Tool::Surface(theFace1);
|
||||
Handle(Geom_Surface) aSurf2 = BRep_Tool::Surface(theFace2);
|
||||
|
||||
if (aSurf1.IsNull() || aSurf2.IsNull())
|
||||
return Standard_False;
|
||||
|
||||
// Computation of the number of samples on the edge.
|
||||
BRepAdaptor_Surface aBAS1(theFace1);
|
||||
BRepAdaptor_Surface aBAS2(theFace2);
|
||||
Handle(BRepAdaptor_HSurface) aBAHS1 = new BRepAdaptor_HSurface(aBAS1);
|
||||
Handle(BRepAdaptor_HSurface) aBAHS2 = new BRepAdaptor_HSurface(aBAS2);
|
||||
Handle(BRepTopAdaptor_TopolTool) aTool1 = new BRepTopAdaptor_TopolTool(aBAHS1);
|
||||
Handle(BRepTopAdaptor_TopolTool) aTool2 = new BRepTopAdaptor_TopolTool(aBAHS2);
|
||||
Standard_Integer aNbSamples1 = aTool1->NbSamples();
|
||||
Standard_Integer aNbSamples2 = aTool2->NbSamples();
|
||||
const Standard_Integer aNbSamplesMax = 23;
|
||||
Standard_Integer aNbSamples = Min(aNbSamplesMax, Max(aNbSamples1, aNbSamples2));
|
||||
const Standard_Real aTolAngle = M_PI/18;
|
||||
|
||||
|
||||
// Computation of the continuity.
|
||||
Standard_Real aPar;
|
||||
Standard_Real aDelta = (aLast - aFirst)/(aNbSamples - 1);
|
||||
Standard_Integer i, nbNotDone = 0;
|
||||
|
||||
for (i = 1, aPar = aFirst; i <= aNbSamples; i++, aPar += aDelta) {
|
||||
if (i == aNbSamples) aPar = aLast;
|
||||
|
||||
LocalAnalysis_SurfaceContinuity aCont(aC2d1, aC2d2, aPar,
|
||||
aSurf1, aSurf2, Order,
|
||||
0.001, TolC0, aTolAngle, 0.1, 0.1);
|
||||
if (!aCont.IsDone())
|
||||
{
|
||||
nbNotDone++;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (Order == GeomAbs_G1)
|
||||
{
|
||||
if (!aCont.IsG1())
|
||||
return Standard_False;
|
||||
}
|
||||
else if (!aCont.IsG2())
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
if (nbNotDone == aNbSamples)
|
||||
return Standard_False;
|
||||
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : BRepOffsetAPI_PatchFaces
|
||||
//purpose : Constructor
|
||||
//=======================================================================
|
||||
|
||||
BRepOffsetAPI_PatchFaces::BRepOffsetAPI_PatchFaces(const TopoDS_Shape& theShape)
|
||||
{
|
||||
myInitialShape = theShape;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetOffsetFace
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BRepOffsetAPI_PatchFaces::AddPatchFace(const TopoDS_Face& theFace,
|
||||
const TopoDS_Face& thePatchFace)
|
||||
{
|
||||
// Check the orientation of the patch face and make
|
||||
// it oriented the same way as original
|
||||
TopoDS_Face aFace = TopoDS::Face(theFace.Oriented(TopAbs_FORWARD));
|
||||
TopoDS_Face aPatchFace = TopoDS::Face(thePatchFace.Oriented(TopAbs_FORWARD));
|
||||
|
||||
Handle(IntTools_Context) aCtx = new IntTools_Context;
|
||||
Standard_Boolean bToReverse = BOPTools_AlgoTools::IsSplitToReverse(aFace, aPatchFace, aCtx);
|
||||
TopoDS_Face anOrientedPatchFace = bToReverse ? TopoDS::Face(aPatchFace.Reversed()) : aPatchFace;
|
||||
myFacePatchFace.Add(aFace, anOrientedPatchFace);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Build
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void BRepOffsetAPI_PatchFaces::Build()
|
||||
{
|
||||
TopExp::MapShapesAndUniqueAncestors(myInitialShape, TopAbs_EDGE, TopAbs_FACE, myEFmap);
|
||||
|
||||
//Draft filling of <myFaceNewFace>
|
||||
for (Standard_Integer i = 1; i <= myFacePatchFace.Extent(); i++)
|
||||
{
|
||||
const TopoDS_Face& aFace = TopoDS::Face(myFacePatchFace.FindKey(i));
|
||||
const TopoDS_Shape& aPatchFace = myFacePatchFace(i);
|
||||
myFaceNewFace.Add(aFace, aPatchFace);
|
||||
TopExp_Explorer Explo(aFace, TopAbs_EDGE);
|
||||
for (; Explo.More(); Explo.Next())
|
||||
{
|
||||
const TopoDS_Edge& anEdge = TopoDS::Edge(Explo.Current());
|
||||
const TopTools_ListOfShape& Lfaces = myEFmap.FindFromKey(anEdge);
|
||||
TopoDS_Face aNeighborFace = (aFace.IsSame(Lfaces.First()))?
|
||||
TopoDS::Face(Lfaces.Last()) : TopoDS::Face(Lfaces.First());
|
||||
if (myFacePatchFace.Contains(aNeighborFace))
|
||||
continue;
|
||||
if (myFaceNewFace.Contains(aNeighborFace))
|
||||
continue;
|
||||
Standard_Boolean IsTangentEdge = IsTangentFaces(anEdge, aFace, aNeighborFace, GeomAbs_G1);
|
||||
if (IsTangentEdge)
|
||||
{
|
||||
myTangentEdges.Add(anEdge);
|
||||
continue;
|
||||
}
|
||||
|
||||
aNeighborFace.Orientation(TopAbs_FORWARD);
|
||||
TopoDS_Face aNewFace;
|
||||
BRepOffset_Tool::EnLargeFace(aNeighborFace, aNewFace,
|
||||
Standard_True,Standard_True,Standard_True,Standard_True,Standard_True,
|
||||
Standard_False); //not too big
|
||||
myFaceNewFace.Add(aNeighborFace, aNewFace);
|
||||
}
|
||||
}
|
||||
|
||||
//Make draft intersection edges: draft filling of <myEdgeNewEdge>
|
||||
BRep_Builder BB;
|
||||
TopTools_MapOfShape UpdatedConstEdges;
|
||||
for (Standard_Integer i = 1; i <= myFaceNewFace.Extent(); i++)
|
||||
{
|
||||
TopoDS_Face aFace = TopoDS::Face(myFaceNewFace.FindKey(i));
|
||||
TopoDS_Face aNewFace = TopoDS::Face(myFaceNewFace(i));
|
||||
TopoDS_Face aBoundedNewFace;
|
||||
if (myNewFaceBoundedFace.IsBound(aNewFace))
|
||||
aBoundedNewFace = TopoDS::Face(myNewFaceBoundedFace(aNewFace));
|
||||
else
|
||||
{
|
||||
aBoundedNewFace = TopoDS::Face(aNewFace.EmptyCopied());
|
||||
myNewFaceBoundedFace.Bind(aNewFace, aBoundedNewFace);
|
||||
}
|
||||
|
||||
TopoDS_Iterator itf(aFace);
|
||||
for (; itf.More(); itf.Next())
|
||||
{
|
||||
const TopoDS_Wire& aWire = TopoDS::Wire(itf.Value());
|
||||
TopoDS_Wire F_Wire = TopoDS::Wire(aWire.Oriented(TopAbs_FORWARD));
|
||||
BRepTools_WireExplorer wexp(F_Wire, aFace);
|
||||
for (; wexp.More(); wexp.Next())
|
||||
{
|
||||
TopoDS_Edge anEdge = wexp.Current();
|
||||
Standard_Boolean ToReverse = Standard_False;
|
||||
TopoDS_Edge aNewEdge;
|
||||
if (myEdgeNewEdge.IsBound(anEdge))
|
||||
//aNewEdge = TopoDS::Edge(myEdgeNewEdge(anEdge));
|
||||
continue;
|
||||
|
||||
Handle(Geom2d_Curve) NullPCurve;
|
||||
Standard_Real fpar, lpar;
|
||||
|
||||
const TopTools_ListOfShape& Lfaces = myEFmap.FindFromKey(anEdge);
|
||||
if (Lfaces.Extent() == 1) //seam edge
|
||||
{
|
||||
cout<<endl<<"Seam edge or degenerated edge !!!"<<endl;
|
||||
TopoDS_Edge GeneratedEdge = GetGeneratedEdge(anEdge, aFace, aNewFace);
|
||||
myOrientedEdgeNewEdge.Bind(anEdge, GeneratedEdge);
|
||||
continue;
|
||||
}
|
||||
|
||||
TopoDS_Face aNeighborFace = (aFace.IsSame(Lfaces.First()))?
|
||||
TopoDS::Face(Lfaces.Last()) : TopoDS::Face(Lfaces.First());
|
||||
|
||||
if (myTangentEdges.Contains(anEdge)&&
|
||||
!UpdatedConstEdges.Contains(anEdge)) //project onto patch
|
||||
{
|
||||
UpdateEdgeByProjectionOfPCurve(anEdge, aNewFace, aBoundedNewFace);
|
||||
|
||||
//aNewEdge = anEdge;
|
||||
UpdatedConstEdges.Add(anEdge);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (myFaceNewFace.Contains(aNeighborFace))//intersect
|
||||
{
|
||||
TopoDS_Face aNewNeighborFace = TopoDS::Face(myFaceNewFace.FindFromKey(aNeighborFace));
|
||||
TopoDS_Face aBoundedNewNeighborFace;
|
||||
if (myNewFaceBoundedFace.IsBound(aNewNeighborFace))
|
||||
aBoundedNewNeighborFace = TopoDS::Face(myNewFaceBoundedFace(aNewNeighborFace));
|
||||
else
|
||||
{
|
||||
aBoundedNewNeighborFace = TopoDS::Face(aNewNeighborFace.EmptyCopied());
|
||||
myNewFaceBoundedFace.Bind(aNewNeighborFace, aBoundedNewNeighborFace);
|
||||
}
|
||||
|
||||
if (!myFacePatchFace.Contains(aFace) &&
|
||||
!myFacePatchFace.Contains(aNeighborFace) &&
|
||||
IsTangentFaces(anEdge, aFace, aNeighborFace, GeomAbs_G1)) //smooth edge
|
||||
{
|
||||
//make new edge with pcurves on new surfaces
|
||||
aNewEdge = MakeNewEdgeWithOldPcurvesOnNewSurfaces(anEdge,
|
||||
aFace, aBoundedNewFace,
|
||||
aNeighborFace, aBoundedNewNeighborFace);
|
||||
|
||||
myEdgeNewEdge.Bind(anEdge.Oriented(TopAbs_FORWARD), aNewEdge);
|
||||
continue;
|
||||
}
|
||||
|
||||
BRepLib::BuildCurves3d(aNewFace);
|
||||
BRepLib::BuildCurves3d(aNewNeighborFace);
|
||||
|
||||
BRepAlgoAPI_Section SecBuilder(aNewFace, aNewNeighborFace, Standard_False);
|
||||
SecBuilder.Approximation(Standard_True);
|
||||
SecBuilder.ComputePCurveOn1(Standard_True);
|
||||
SecBuilder.ComputePCurveOn2(Standard_True);
|
||||
SecBuilder.Build();
|
||||
TopoDS_Shape aSection = SecBuilder.Shape();
|
||||
Standard_Boolean Success = Standard_True;
|
||||
TopExp_Explorer ExpSec(aSection, TopAbs_EDGE);
|
||||
if (ExpSec.More())
|
||||
aNewEdge = TopoDS::Edge(ExpSec.Current());
|
||||
else //no intersection
|
||||
{
|
||||
cout<<endl<<"No intersecion => smooth edge"<<endl;
|
||||
Success = Standard_False;
|
||||
}
|
||||
ExpSec.Next();
|
||||
if (ExpSec.More())
|
||||
{
|
||||
cout<<endl<<"More than one intersecion => smooth edge"<<endl;
|
||||
Success = Standard_False;
|
||||
}
|
||||
if (!Success) //a smooth edge with bigger angle
|
||||
{
|
||||
if (myFacePatchFace.Contains(aFace)) //project onto patch
|
||||
{
|
||||
UpdateEdgeByProjectionOfPCurve(anEdge, aNewFace, aBoundedNewFace);
|
||||
|
||||
//Remove neighbor face from <myFaceNewFace>
|
||||
myFaceNewFace.RemoveKey(aNeighborFace);
|
||||
|
||||
myTangentEdges.Add(anEdge);
|
||||
UpdatedConstEdges.Add(anEdge);
|
||||
}
|
||||
else
|
||||
{
|
||||
aNewEdge = MakeNewEdgeWithOldPcurvesOnNewSurfaces(anEdge,
|
||||
aFace, aBoundedNewFace,
|
||||
aNeighborFace, aBoundedNewNeighborFace);
|
||||
myEdgeNewEdge.Bind(anEdge.Oriented(TopAbs_FORWARD), aNewEdge);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
TopoDS_Vertex V1, V2;
|
||||
TopExp::Vertices(aNewEdge, V1, V2);
|
||||
aNewEdge.Free(Standard_True);
|
||||
BB.Remove(aNewEdge, V1);
|
||||
BB.Remove(aNewEdge, V2);
|
||||
aNewEdge.Orientation(TopAbs_FORWARD);
|
||||
|
||||
//Make pcurves on new surfaces
|
||||
Handle(Geom2d_Curve) PCurve1 = BRep_Tool::CurveOnSurface(aNewEdge, aNewFace, fpar, lpar);
|
||||
BB.UpdateEdge(aNewEdge, NullPCurve, aNewFace, 0.);
|
||||
BB.UpdateEdge(aNewEdge, PCurve1, aBoundedNewFace, 0.);
|
||||
Handle(Geom2d_Curve) PCurve2 = BRep_Tool::CurveOnSurface(aNewEdge, aNewNeighborFace, fpar, lpar);
|
||||
BB.UpdateEdge(aNewEdge, NullPCurve, aNewNeighborFace, 0.);
|
||||
BB.UpdateEdge(aNewEdge, PCurve2, aBoundedNewNeighborFace, 0.);
|
||||
|
||||
//Check orientation of new edge
|
||||
BRepAdaptor_Curve BAcurve(anEdge);
|
||||
BRepAdaptor_Curve BAnewcurve(aNewEdge);
|
||||
gp_Pnt FirstPnt, FirstNewPnt;
|
||||
gp_Vec DirOnCurve, DirOnNewCurve;
|
||||
BAcurve.D1(BAcurve.FirstParameter(), FirstPnt, DirOnCurve);
|
||||
Standard_Real ParamOnNewEdge = BAnewcurve.FirstParameter();
|
||||
Extrema_ExtPC Projector(FirstPnt, BAnewcurve);
|
||||
if (!Projector.IsDone() || Projector.NbExt() == 0)
|
||||
{
|
||||
cout<<endl<<"Define orientation of new edge: extrema point-curve is not done"<<endl;
|
||||
}
|
||||
if (Projector.IsDone() && Projector.NbExt() > 0)
|
||||
{
|
||||
Standard_Integer indmin = 1;
|
||||
for (Standard_Integer ind = 2; ind <= Projector.NbExt(); ind++)
|
||||
if (Projector.SquareDistance(ind) < Projector.SquareDistance(indmin))
|
||||
indmin = ind;
|
||||
ParamOnNewEdge = Projector.Point(indmin).Parameter();
|
||||
}
|
||||
BAnewcurve.D1(ParamOnNewEdge, FirstNewPnt, DirOnNewCurve);
|
||||
Standard_Real ScalProd = DirOnCurve * DirOnNewCurve;
|
||||
if (ScalProd < 0.)
|
||||
ToReverse = Standard_True;
|
||||
|
||||
myEdgeNewEdge.Bind(anEdge.Oriented(TopAbs_FORWARD),
|
||||
(ToReverse)? aNewEdge.Oriented(TopAbs_REVERSED) : aNewEdge);
|
||||
} //intersect
|
||||
else //borders on constant face: change surface of pcurve on existing edge
|
||||
{
|
||||
Handle(Geom2d_Curve) aPCurve = BRep_Tool::CurveOnSurface(anEdge, aFace, fpar, lpar);
|
||||
//BB.UpdateEdge(anEdge, NullPCurve, aFace, 0.);
|
||||
BB.UpdateEdge(anEdge, aPCurve, aBoundedNewFace, 0.);
|
||||
|
||||
aNewEdge = anEdge;
|
||||
}
|
||||
} //for (; wexp.More(); wexp.Next())
|
||||
} //for (; itf.More(); itf.Next())
|
||||
} //for (Standard_Integer i = 1; i <= myFaceNewFace.Extent(); i++)
|
||||
|
||||
//Intersect edges and make new wires
|
||||
for (Standard_Integer i = 1; i <= myFaceNewFace.Extent(); i++)
|
||||
{
|
||||
TopoDS_Face aFace = TopoDS::Face(myFaceNewFace.FindKey(i));
|
||||
TopoDS_Shape aNewFace = myFaceNewFace(i);
|
||||
TopoDS_Face aBoundedNewFace = TopoDS::Face(myNewFaceBoundedFace(aNewFace));
|
||||
|
||||
TopoDS_Iterator itf(aFace);
|
||||
for (; itf.More(); itf.Next())
|
||||
{
|
||||
const TopoDS_Wire& aWire = TopoDS::Wire(itf.Value());
|
||||
TopAbs_Orientation aWireOr = aWire.Orientation();
|
||||
|
||||
TopoDS_Wire aNewWire;
|
||||
BB.MakeWire(aNewWire);
|
||||
|
||||
TopoDS_Wire F_Wire = TopoDS::Wire(aWire.Oriented(TopAbs_FORWARD));
|
||||
BRepTools_WireExplorer wexp(F_Wire, aFace);
|
||||
TopoDS_Vertex CurVertex = wexp.CurrentVertex();
|
||||
TopoDS_Edge FirstEdge = wexp.Current();
|
||||
TopoDS_Edge FirstNewEdge = FirstEdge;
|
||||
if (myOrientedEdgeNewEdge.IsBound(FirstEdge))
|
||||
FirstNewEdge = TopoDS::Edge(myOrientedEdgeNewEdge(FirstEdge));
|
||||
else if (myEdgeNewEdge.IsBound(FirstEdge))
|
||||
FirstNewEdge = TopoDS::Edge(myEdgeNewEdge(FirstEdge));
|
||||
TopoDS_Edge CurEdge, PrevEdge = FirstEdge;
|
||||
TopoDS_Edge CurNewEdge, PrevNewEdge = FirstNewEdge;
|
||||
wexp.Next();
|
||||
if (!wexp.More() && //only one edge in wire
|
||||
!myVertexNewVertex.IsBound(CurVertex))
|
||||
{
|
||||
TopoDS_Vertex CurNewVertex;
|
||||
if (myVertexNewVertex.IsBound(CurVertex))
|
||||
CurNewVertex = TopoDS::Vertex(myVertexNewVertex(CurVertex));
|
||||
|
||||
if (myEdgeNewEdge.IsBound(FirstEdge))//new edge: update
|
||||
{
|
||||
Standard_Real fpar, lpar;
|
||||
BRep_Tool::Range(FirstEdge, fpar, lpar);
|
||||
BB.Range(FirstNewEdge, fpar, lpar);
|
||||
BRepAdaptor_Curve BAcurve(FirstNewEdge);
|
||||
gp_Pnt FirstPnt = BAcurve.Value(BAcurve.FirstParameter());
|
||||
if (CurNewVertex.IsNull())
|
||||
CurNewVertex = BRepLib_MakeVertex(FirstPnt);
|
||||
BB.Add(FirstNewEdge, CurNewVertex);
|
||||
BB.Add(FirstNewEdge, CurNewVertex.Oriented(TopAbs_REVERSED));
|
||||
myVertexNewVertex.Bind(CurVertex, CurNewVertex);
|
||||
}
|
||||
}
|
||||
for (; wexp.More(); wexp.Next())
|
||||
{
|
||||
CurEdge = wexp.Current();
|
||||
if (myOrientedEdgeNewEdge.IsBound(CurEdge))
|
||||
CurNewEdge = TopoDS::Edge(myOrientedEdgeNewEdge(CurEdge));
|
||||
else if (myEdgeNewEdge.IsBound(CurEdge))
|
||||
CurNewEdge = TopoDS::Edge(myEdgeNewEdge(CurEdge));
|
||||
else
|
||||
CurNewEdge = CurEdge;
|
||||
CurVertex = wexp.CurrentVertex();
|
||||
UpdateEdgesAndVertex(PrevEdge, PrevNewEdge,
|
||||
CurEdge, CurNewEdge,
|
||||
CurVertex);
|
||||
if (!PrevEdge.IsSame(PrevNewEdge) &&
|
||||
PrevEdge.Orientation() == TopAbs_REVERSED)
|
||||
PrevNewEdge.Reverse();
|
||||
BB.Add(aNewWire, PrevNewEdge);
|
||||
|
||||
PrevEdge = CurEdge;
|
||||
PrevNewEdge = CurNewEdge;
|
||||
}
|
||||
CurEdge = FirstEdge;
|
||||
CurNewEdge = FirstNewEdge;
|
||||
CurVertex = wexp.CurrentVertex();
|
||||
UpdateEdgesAndVertex(PrevEdge, PrevNewEdge,
|
||||
CurEdge, CurNewEdge,
|
||||
CurVertex);
|
||||
if (!PrevEdge.IsSame(PrevNewEdge) &&
|
||||
PrevEdge.Orientation() == TopAbs_REVERSED)
|
||||
PrevNewEdge.Reverse();
|
||||
BB.Add(aNewWire, PrevNewEdge);
|
||||
|
||||
aNewWire.Orientation(aWireOr);
|
||||
BB.Add(aBoundedNewFace, aNewWire);
|
||||
} //for (; itf.More(); itf.Next()) (iterator on face)
|
||||
}
|
||||
|
||||
//Assemble resulting shape
|
||||
TopoDS_Solid aSolid;
|
||||
BB.MakeSolid(aSolid);
|
||||
TopoDS_Shell aShell;
|
||||
BB.MakeShell(aShell);
|
||||
TopExp_Explorer Explo(myInitialShape, TopAbs_FACE);
|
||||
for (; Explo.More(); Explo.Next())
|
||||
{
|
||||
const TopoDS_Shape& aFace = Explo.Current();
|
||||
TopoDS_Shape aBoundedNewFace;
|
||||
if (myFaceNewFace.Contains(aFace))
|
||||
{
|
||||
const TopoDS_Shape& aNewFace = myFaceNewFace.FindFromKey(aFace);
|
||||
aBoundedNewFace = myNewFaceBoundedFace(aNewFace);
|
||||
if (aFace.Orientation() == TopAbs_REVERSED)
|
||||
aBoundedNewFace.Reverse();
|
||||
}
|
||||
else
|
||||
aBoundedNewFace = aFace;
|
||||
BB.Add(aShell, aBoundedNewFace);
|
||||
}
|
||||
BB.Add(aSolid, aShell);
|
||||
|
||||
ShapeFix_Shape Fixer(aSolid);
|
||||
Fixer.Perform();
|
||||
|
||||
myShape = Fixer.Shape();
|
||||
//myShape = aSolid;
|
||||
|
||||
Done();
|
||||
}
|
||||
|
||||
void BRepOffsetAPI_PatchFaces::UpdateEdgesAndVertex(const TopoDS_Edge& thePrevEdge,
|
||||
TopoDS_Edge& thePrevNewEdge,
|
||||
const TopoDS_Edge& theCurEdge,
|
||||
TopoDS_Edge& theCurNewEdge,
|
||||
TopoDS_Vertex& theCurVertex)
|
||||
{
|
||||
BRep_Builder BB;
|
||||
|
||||
TopoDS_Vertex CurNewVertex;
|
||||
if (myVertexNewVertex.IsBound(theCurVertex))
|
||||
CurNewVertex = TopoDS::Vertex(myVertexNewVertex(theCurVertex));
|
||||
else
|
||||
{
|
||||
Standard_Boolean IsConstVertex = (!(myEdgeNewEdge.IsBound(thePrevEdge) || myOrientedEdgeNewEdge.IsBound(thePrevEdge)) ||
|
||||
!(myEdgeNewEdge.IsBound(theCurEdge) || myOrientedEdgeNewEdge.IsBound(theCurEdge)));
|
||||
if (IsConstVertex)
|
||||
CurNewVertex = theCurVertex;
|
||||
}
|
||||
|
||||
Standard_Boolean IsSeamPrev = (myOrientedEdgeNewEdge.IsBound(thePrevEdge));
|
||||
Standard_Boolean IsSeamCur = (myOrientedEdgeNewEdge.IsBound(theCurEdge));
|
||||
|
||||
if ((myEdgeNewEdge.IsBound(thePrevEdge) || myOrientedEdgeNewEdge.IsBound(thePrevEdge)) &&
|
||||
(myEdgeNewEdge.IsBound(theCurEdge) || myOrientedEdgeNewEdge.IsBound(theCurEdge))) //two new edges: intersect
|
||||
{
|
||||
Standard_Real ParamOnPrev, ParamOnCur, TolProj;
|
||||
gp_Pnt PntOnPrev, PntOnCur;
|
||||
ProjectVertexOnNewEdge(theCurVertex, thePrevEdge, thePrevNewEdge,
|
||||
ParamOnPrev, PntOnPrev, TolProj);
|
||||
ProjectVertexOnNewEdge(theCurVertex, theCurEdge, theCurNewEdge,
|
||||
ParamOnCur, PntOnCur, TolProj);
|
||||
|
||||
Standard_Real TolReached;
|
||||
gp_Pnt PntVtx = (CurNewVertex.IsNull())?
|
||||
BRep_Tool::Pnt(theCurVertex) : BRep_Tool::Pnt(CurNewVertex);
|
||||
TolReached = PntOnPrev.Distance(PntOnCur);
|
||||
Standard_Real DistVtoPrev = PntVtx.Distance(PntOnPrev);
|
||||
Standard_Real DistVtoCur = PntVtx.Distance(PntOnCur);
|
||||
TolReached = Max(TolReached, DistVtoPrev);
|
||||
TolReached = Max(TolReached, DistVtoCur);
|
||||
|
||||
BRepExtrema_ExtCC ExtrEE(thePrevNewEdge, theCurNewEdge);
|
||||
if (!ExtrEE.IsDone() || ExtrEE.NbExt() == 0)
|
||||
{
|
||||
cout<<endl<<"Extrema EE is not done"<<endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
Standard_Integer imin = 1;
|
||||
for (Standard_Integer iext = 2; iext <= ExtrEE.NbExt(); iext++)
|
||||
if (ExtrEE.SquareDistance(iext) < ExtrEE.SquareDistance(imin))
|
||||
imin = iext;
|
||||
Standard_Real TolEE = sqrt(ExtrEE.SquareDistance(imin));
|
||||
gp_Pnt PntOnE1 = ExtrEE.PointOnE1(imin);
|
||||
gp_Pnt PntOnE2 = ExtrEE.PointOnE2(imin);
|
||||
Standard_Real DistVtoE1 = PntVtx.Distance(PntOnE1);
|
||||
Standard_Real DistVtoE2 = PntVtx.Distance(PntOnE2);
|
||||
TolEE = Max(TolEE, DistVtoE1);
|
||||
TolEE = Max(TolEE, DistVtoE2);
|
||||
if (TolEE < TolReached)
|
||||
{
|
||||
TolReached = TolEE;
|
||||
PntOnPrev = PntOnE1;
|
||||
PntOnCur = PntOnE2;
|
||||
ParamOnPrev = ExtrEE.ParameterOnE1(imin);
|
||||
ParamOnCur = ExtrEE.ParameterOnE2(imin);
|
||||
}
|
||||
}
|
||||
if (CurNewVertex.IsNull())
|
||||
{
|
||||
gp_Pnt NewPnt((PntOnPrev.XYZ() + PntOnCur.XYZ())/2);
|
||||
CurNewVertex = BRepLib_MakeVertex(NewPnt);
|
||||
myVertexNewVertex.Bind(theCurVertex, CurNewVertex);
|
||||
}
|
||||
BB.UpdateVertex(CurNewVertex, TolReached);
|
||||
if (!EdgeContains(thePrevNewEdge, CurNewVertex))
|
||||
{
|
||||
if (IsSeamCur)
|
||||
ParamOnPrev = RealLast();
|
||||
PutVertexToEdge(CurNewVertex, theCurVertex, thePrevNewEdge, thePrevEdge, ParamOnPrev);
|
||||
}
|
||||
|
||||
if (!EdgeContains(theCurNewEdge, CurNewVertex))
|
||||
{
|
||||
if (IsSeamPrev)
|
||||
ParamOnCur = RealLast();
|
||||
PutVertexToEdge(CurNewVertex, theCurVertex, theCurNewEdge, theCurEdge, ParamOnCur);
|
||||
}
|
||||
} //two new edges: intersect
|
||||
else if ((myEdgeNewEdge.IsBound(thePrevEdge) || myOrientedEdgeNewEdge.IsBound(thePrevEdge)) ||
|
||||
(myEdgeNewEdge.IsBound(theCurEdge) || myOrientedEdgeNewEdge.IsBound(theCurEdge))) //one constant edge: project point onto curve
|
||||
{
|
||||
TopoDS_Edge ConstantEdge, ModifiedEdge, NewEdge;
|
||||
Standard_Boolean IsAdjacentSeam;
|
||||
if (myEdgeNewEdge.IsBound(thePrevEdge) || myOrientedEdgeNewEdge.IsBound(thePrevEdge))
|
||||
{
|
||||
ConstantEdge = theCurEdge;
|
||||
ModifiedEdge = thePrevEdge;
|
||||
NewEdge = thePrevNewEdge;
|
||||
IsAdjacentSeam = IsSeamCur;
|
||||
}
|
||||
else
|
||||
{
|
||||
ConstantEdge = thePrevEdge;
|
||||
ModifiedEdge = theCurEdge;
|
||||
NewEdge = theCurNewEdge;
|
||||
IsAdjacentSeam = IsSeamPrev;
|
||||
}
|
||||
|
||||
Standard_Real ParamOnNewEdge, TolReached;
|
||||
gp_Pnt PntOnNewEdge;
|
||||
ProjectVertexOnNewEdge(theCurVertex, ModifiedEdge, NewEdge,
|
||||
ParamOnNewEdge, PntOnNewEdge, TolReached);
|
||||
BB.UpdateVertex(theCurVertex, TolReached);
|
||||
|
||||
if (!EdgeContains(NewEdge, theCurVertex))
|
||||
PutVertexToEdge(theCurVertex, theCurVertex, NewEdge, ModifiedEdge, ParamOnNewEdge);
|
||||
} //else (one constant edge: project point onto curve)
|
||||
else //two constant edges
|
||||
{
|
||||
//nothing ?
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void BRepOffsetAPI_PatchFaces::PutVertexToEdge(const TopoDS_Vertex& theVertex,
|
||||
const TopoDS_Vertex& theProVertex,
|
||||
TopoDS_Edge& theEdge,
|
||||
const TopoDS_Edge& theProEdge,
|
||||
const Standard_Real theParamOnEdge)
|
||||
{
|
||||
BRep_Builder BB;
|
||||
|
||||
TopAbs_Orientation anOr = OrientationInEdge(theProVertex, theProEdge);
|
||||
if (myEdgeNewEdge.IsBound(theProEdge) &&
|
||||
myEdgeNewEdge(theProEdge).Orientation() == TopAbs_REVERSED)
|
||||
anOr = TopAbs::Reverse(anOr);
|
||||
|
||||
TopoDS_Shape F_Edge = theEdge.Oriented(TopAbs_FORWARD);
|
||||
F_Edge.Free(Standard_True);
|
||||
BB.Add(F_Edge, theVertex.Oriented(anOr));
|
||||
if (!Precision::IsInfinite(theParamOnEdge))
|
||||
{
|
||||
Standard_Real fpar, lpar;
|
||||
BRep_Tool::Range(theEdge, fpar, lpar);
|
||||
if (anOr == TopAbs_FORWARD)
|
||||
BB.Range(theEdge, theParamOnEdge, lpar);
|
||||
else
|
||||
BB.Range(theEdge, fpar, theParamOnEdge);
|
||||
}
|
||||
}
|
@@ -1,99 +0,0 @@
|
||||
// Created on: 2012-08-06
|
||||
// Created by: jgv@ROLEX
|
||||
// Copyright (c) 2012-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.
|
||||
|
||||
#ifndef _BRepOffsetAPI_PatchFaces_HeaderFile
|
||||
#define _BRepOffsetAPI_PatchFaces_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <TopTools_IndexedDataMapOfShapeShape.hxx>
|
||||
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
|
||||
#include <TopTools_DataMapOfShapeShape.hxx>
|
||||
#include <TopTools_DataMapOfOrientedShapeShape.hxx>
|
||||
#include <TopTools_MapOfShape.hxx>
|
||||
#include <BRepBuilderAPI_MakeShape.hxx>
|
||||
class TopoDS_Shape;
|
||||
|
||||
|
||||
//! Describes functions to replace some faces in a shape
|
||||
//! by patches
|
||||
class BRepOffsetAPI_PatchFaces : public BRepBuilderAPI_MakeShape
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! General constructor.
|
||||
Standard_EXPORT BRepOffsetAPI_PatchFaces(const TopoDS_Shape& aShape);
|
||||
|
||||
//! Adds the patch face for the face in the shape.
|
||||
Standard_EXPORT void AddPatchFace (const TopoDS_Face& theFace, const TopoDS_Face& thePatchFace);
|
||||
|
||||
Standard_EXPORT virtual void Build() Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT void UpdateEdgesAndVertex(const TopoDS_Edge& thePrevEdge,
|
||||
TopoDS_Edge& thePrevNewEdge,
|
||||
const TopoDS_Edge& theCurEdge,
|
||||
TopoDS_Edge& theCurNewEdge,
|
||||
TopoDS_Vertex& theCurVertex);
|
||||
|
||||
Standard_EXPORT void PutVertexToEdge(const TopoDS_Vertex& theVertex,
|
||||
const TopoDS_Vertex& theProVertex,
|
||||
TopoDS_Edge& theEdge,
|
||||
const TopoDS_Edge& theProEdge,
|
||||
const Standard_Real theParamOnEdge);
|
||||
|
||||
|
||||
TopoDS_Shape myInitialShape;
|
||||
|
||||
TopTools_IndexedDataMapOfShapeShape myFacePatchFace;
|
||||
TopTools_IndexedDataMapOfShapeShape myFaceNewFace;
|
||||
TopTools_DataMapOfShapeShape myNewFaceBoundedFace;
|
||||
TopTools_DataMapOfShapeShape myEdgeNewEdge;
|
||||
TopTools_DataMapOfOrientedShapeShape myOrientedEdgeNewEdge;
|
||||
TopTools_DataMapOfShapeShape myVertexNewVertex;
|
||||
TopTools_MapOfShape myTangentEdges;
|
||||
|
||||
TopTools_IndexedDataMapOfShapeListOfShape myEFmap;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _BRepOffsetAPI_PatchFaces_HeaderFile
|
@@ -62,8 +62,6 @@
|
||||
#include <DBRep_DrawableShape.hxx>
|
||||
#include <BRepTest.hxx>
|
||||
|
||||
#include <BRepOffsetAPI_PatchFaces.hxx>
|
||||
|
||||
#include <BRepFilletAPI_MakeFillet.hxx>
|
||||
#include <ChFi3d_FilletShape.hxx>
|
||||
|
||||
@@ -2288,36 +2286,6 @@ static Standard_Integer ComputeSimpleOffset(Draw_Interpretor& theCommands,
|
||||
return 0;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : patchfaces
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
static Standard_Integer patchfaces(Draw_Interpretor& /*di*/,
|
||||
Standard_Integer n, const char** a)
|
||||
{
|
||||
if (n < 5) return 1;
|
||||
|
||||
TopoDS_Shape aShape = DBRep::Get(a[2]);
|
||||
if (aShape.IsNull()) return 1;
|
||||
|
||||
TopoDS_Shape aLocalFace = DBRep::Get(a[3], TopAbs_FACE);
|
||||
if (aLocalFace.IsNull()) return 1;
|
||||
TopoDS_Face aFace = TopoDS::Face(aLocalFace);
|
||||
|
||||
TopoDS_Shape aLocalNewFace = DBRep::Get(a[4], TopAbs_FACE);
|
||||
if (aLocalNewFace.IsNull()) return 1;
|
||||
TopoDS_Face aNewFace = TopoDS::Face(aLocalNewFace);
|
||||
|
||||
BRepOffsetAPI_PatchFaces Builder(aShape);
|
||||
Builder.AddPatchFace(aFace, aNewFace);
|
||||
Builder.Build();
|
||||
|
||||
TopoDS_Shape Result = Builder.Shape();
|
||||
DBRep::Set(a[1], Result);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : FeatureCommands
|
||||
//purpose :
|
||||
@@ -2466,7 +2434,4 @@ void BRepTest::FeatureCommands (Draw_Interpretor& theCommands)
|
||||
theCommands.Add("offsetshapesimple",
|
||||
"offsetshapesimple result shape offsetvalue [solid]",
|
||||
__FILE__, ComputeSimpleOffset);
|
||||
|
||||
theCommands.Add("patchfaces", "patchfaces res shape face newface",
|
||||
__FILE__,patchfaces,g);
|
||||
}
|
||||
|
@@ -294,6 +294,8 @@ GccAna_Circ2d3Tan::
|
||||
else {
|
||||
TheSame1(NbrSol) = 0;
|
||||
gp_Dir2d dc(center1.XY()-Center.XY());
|
||||
if (qualifier1(NbrSol) == GccEnt_enclosed)
|
||||
dc.Reverse(); // if tangent circle is inside the source circle, moving to edge of source circle
|
||||
pnttg1sol(NbrSol)=gp_Pnt2d(Center.XY()+Radius(k1)*dc.XY());
|
||||
par1sol(NbrSol)=ElCLib::Parameter(cirsol(NbrSol),
|
||||
pnttg1sol(NbrSol));
|
||||
|
@@ -185,9 +185,10 @@ GccAna_Circ2d3Tan::
|
||||
else {
|
||||
TheSame1(NbrSol) = 0;
|
||||
gp_Dir2d dc(center1.XY()-Center.XY());
|
||||
if (qualifier1(NbrSol) == GccEnt_enclosed)
|
||||
dc.Reverse(); // if tangent circle is inside the source circle, moving to edge of source circle
|
||||
pnttg1sol(NbrSol)=gp_Pnt2d(Center.XY()+Radius(nbsol3)*dc.XY());
|
||||
par1sol(NbrSol)=ElCLib::Parameter(cirsol(NbrSol),
|
||||
pnttg1sol(NbrSol));
|
||||
par1sol(NbrSol)=ElCLib::Parameter(cirsol(NbrSol), pnttg1sol(NbrSol));
|
||||
pararg1(NbrSol)=ElCLib::Parameter(C1,pnttg1sol(NbrSol));
|
||||
}
|
||||
|
||||
|
@@ -22,6 +22,45 @@
|
||||
#include <GccEnt_QualifiedLin.hxx>
|
||||
#include <gp_Circ2d.hxx>
|
||||
#include <gp_Lin2d.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
namespace
|
||||
{
|
||||
static Standard_CString GccEnt_Table_PrintPosition[5] =
|
||||
{
|
||||
"UNQUALIFIED", "ENCLOSING", "ENCLOSED", "OUTSIDE", "NOQUALIFIER"
|
||||
};
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : PositionToString
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_CString GccEnt::PositionToString (GccEnt_Position thePosition)
|
||||
{
|
||||
return GccEnt_Table_PrintPosition[thePosition];
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : PositionFromString
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean GccEnt::PositionFromString (Standard_CString thePositionString,
|
||||
GccEnt_Position& thePosition)
|
||||
{
|
||||
TCollection_AsciiString aName (thePositionString);
|
||||
aName.UpperCase();
|
||||
for (Standard_Integer aTypeIter = 0; aTypeIter <= GccEnt_noqualifier; ++aTypeIter)
|
||||
{
|
||||
Standard_CString aTypeName = GccEnt_Table_PrintPosition[aTypeIter];
|
||||
if (aName == aTypeName)
|
||||
{
|
||||
thePosition = GccEnt_Position(aTypeIter);
|
||||
return Standard_True;
|
||||
}
|
||||
}
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
GccEnt_QualifiedLin
|
||||
GccEnt::Unqualified(const gp_Lin2d& Line) {
|
||||
|
@@ -17,6 +17,7 @@
|
||||
#ifndef _GccEnt_HeaderFile
|
||||
#define _GccEnt_HeaderFile
|
||||
|
||||
#include <GccEnt_Position.hxx>
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
@@ -53,6 +54,34 @@ public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Prints the name of Position type as a String on the Stream.
|
||||
static Standard_OStream& Print (const GccEnt_Position thePosition, Standard_OStream& theStream)
|
||||
{
|
||||
return (theStream << PositionToString (thePosition));
|
||||
}
|
||||
|
||||
//! Returns the string name for a given position.
|
||||
//! @param thePosition position type
|
||||
//! @return string identifier from the list UNQUALIFIED ENCLOSING ENCLOSED OUTSIDE NOQUALIFIER
|
||||
Standard_EXPORT static Standard_CString PositionToString (GccEnt_Position thePosition);
|
||||
|
||||
//! Returns the position from the given string identifier (using case-insensitive comparison).
|
||||
//! @param thePositionString string identifier
|
||||
//! @return position or GccEnt_unqualified if string identifier is invalid
|
||||
static GccEnt_Position PositionFromString (Standard_CString thePositionString)
|
||||
{
|
||||
GccEnt_Position aPosition = GccEnt_unqualified;
|
||||
PositionFromString (thePositionString, aPosition);
|
||||
return aPosition;
|
||||
}
|
||||
|
||||
//! Determines the position from the given string identifier (using case-insensitive comparison).
|
||||
//! @param thePositionString string identifier
|
||||
//! @param thePosition detected shape type
|
||||
//! @return TRUE if string identifier is known
|
||||
Standard_EXPORT static Standard_Boolean PositionFromString (Standard_CString thePositionString,
|
||||
GccEnt_Position& thePosition);
|
||||
|
||||
//! Constructs a qualified line,
|
||||
//! so that the relative position to the circle or line of the
|
||||
|
@@ -5,6 +5,9 @@ GeometryTest_APICommands.cxx
|
||||
GeometryTest_ConstraintCommands.cxx
|
||||
GeometryTest_ContinuityCommands.cxx
|
||||
GeometryTest_CurveCommands.cxx
|
||||
GeometryTest_CurveTanCommands.cxx
|
||||
GeometryTest_DrawableQualifiedCurve2d.cxx
|
||||
GeometryTest_DrawableQualifiedCurve2d.hxx
|
||||
GeometryTest_FairCurveCommands.cxx
|
||||
GeometryTest_PolyCommands.cxx
|
||||
GeometryTest_SurfaceCommands.cxx
|
||||
|
@@ -30,6 +30,7 @@ void GeometryTest::AllCommands(Draw_Interpretor& theCommands)
|
||||
|
||||
GeomliteTest::AllCommands(theCommands);
|
||||
GeometryTest::CurveCommands(theCommands);
|
||||
GeometryTest::CurveTanCommands(theCommands);
|
||||
GeometryTest::FairCurveCommands(theCommands);
|
||||
GeometryTest::SurfaceCommands(theCommands);
|
||||
GeometryTest::ConstraintCommands(theCommands);
|
||||
|
@@ -39,6 +39,9 @@ public:
|
||||
//! defines curve commands.
|
||||
Standard_EXPORT static void CurveCommands (Draw_Interpretor& I);
|
||||
|
||||
//! defines tangent curve commands.
|
||||
Standard_EXPORT static void CurveTanCommands (Draw_Interpretor& I);
|
||||
|
||||
//! defines fair curve commands.
|
||||
Standard_EXPORT static void FairCurveCommands (Draw_Interpretor& I);
|
||||
|
||||
|
340
src/GeometryTest/GeometryTest_CurveTanCommands.cxx
Normal file
@@ -0,0 +1,340 @@
|
||||
// Created on: 2017-06-16
|
||||
// Created by: Natalia ERMOLAEVA
|
||||
// Copyright (c) 2017 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.
|
||||
|
||||
#include <Draw.hxx>
|
||||
#include <DrawTrSurf.hxx>
|
||||
#include <Draw_Interpretor.hxx>
|
||||
#include <GccAna_Circ2d3Tan.hxx>
|
||||
#include <GccEnt.hxx>
|
||||
#include <GccEnt_QualifiedLin.hxx>
|
||||
#include <GccEnt_QualifiedCirc.hxx>
|
||||
#include <Geom2d_Line.hxx>
|
||||
#include <Geom2d_Circle.hxx>
|
||||
#include <Geom2dAdaptor_Curve.hxx>
|
||||
#include <GeometryTest.hxx>
|
||||
#include <GeometryTest_DrawableQualifiedCurve2d.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
#include <stdio.h>
|
||||
|
||||
//=======================================================================
|
||||
//function : qcircle
|
||||
//purpose : Parses command: "qcircle name x y radius [-unqualified|-enclosing|-enclosed|-outside|-noqualifier]"
|
||||
//=======================================================================
|
||||
static Standard_Integer qcurve (Draw_Interpretor&, Standard_Integer theArgsNb, const char** theArgVec)
|
||||
{
|
||||
if (theArgsNb < 5)
|
||||
{
|
||||
cout << "Error: wrong number of arguments.\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
Handle(Geom2d_Curve) aResult2d;
|
||||
TCollection_AsciiString aPositionType;
|
||||
if (!strcmp (theArgVec[0], "qcircle"))
|
||||
{
|
||||
if (theArgsNb == 5 || theArgsNb == 6)
|
||||
aResult2d = new Geom2d_Circle (gp_Ax22d (gp_Pnt2d (Draw::Atof (theArgVec[2]), Draw::Atof (theArgVec[3])),
|
||||
gp_Dir2d (1,0)), Draw::Atof (theArgVec[4]));
|
||||
else if (theArgsNb == 7 || theArgsNb == 8)
|
||||
aResult2d = new Geom2d_Circle (gp_Ax22d (gp_Pnt2d (Draw::Atof (theArgVec[2]), Draw::Atof (theArgVec[3])),
|
||||
gp_Dir2d (Draw::Atof (theArgVec[4]), Draw::Atof (theArgVec[5]))), Draw::Atof (theArgVec[6]));
|
||||
|
||||
if (theArgsNb == 6)
|
||||
aPositionType = theArgVec[5];
|
||||
else if (theArgsNb == 8)
|
||||
aPositionType = theArgVec[7];
|
||||
}
|
||||
else if(!strcmp (theArgVec[0], "qline"))
|
||||
{
|
||||
if (theArgsNb < 6)
|
||||
{
|
||||
cout << "Error: wrong number of arguments.\n";
|
||||
return 1;
|
||||
}
|
||||
aResult2d = new Geom2d_Line (gp_Pnt2d (Draw::Atof (theArgVec[2]), Draw::Atof (theArgVec[3])),
|
||||
gp_Dir2d (Draw::Atof (theArgVec[4]), Draw::Atof (theArgVec[5])));
|
||||
if (theArgsNb == 7)
|
||||
aPositionType = theArgVec[6];
|
||||
}
|
||||
else
|
||||
{
|
||||
cout << "Error: wrong command name.\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
GccEnt_Position aKindOfPosition = GccEnt_unqualified;
|
||||
if (!aPositionType.IsEmpty())
|
||||
{
|
||||
GccEnt_Position aParameterPosition;
|
||||
if (GccEnt::PositionFromString (aPositionType.ToCString(), aParameterPosition))
|
||||
aKindOfPosition = aParameterPosition;
|
||||
}
|
||||
|
||||
Draw::Set (theArgVec[1], new GeometryTest_DrawableQualifiedCurve2d (aResult2d, aKindOfPosition));
|
||||
return 0;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : solutions
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
static Standard_Integer solutions (Draw_Interpretor& theDI, GccAna_Circ2d3Tan& theCirTan3, const char* theName)
|
||||
{
|
||||
if (!theCirTan3.IsDone())
|
||||
{
|
||||
cout << "GccAna_Circ2d3Tan is not done";
|
||||
return 1;
|
||||
}
|
||||
|
||||
TCollection_AsciiString aName = TCollection_AsciiString (theName) + "_";
|
||||
GccEnt_Position aQualifier1, aQualifier2, aQualifier3;
|
||||
Standard_Real aParSol, aParArg;
|
||||
gp_Pnt2d aPntSol;
|
||||
for (Standard_Integer aSolId = 1; aSolId <= theCirTan3.NbSolutions(); aSolId++)
|
||||
{
|
||||
Handle(Geom2d_Circle) aCircle = new Geom2d_Circle (theCirTan3.ThisSolution (aSolId));
|
||||
TCollection_AsciiString aSolIdName = aName;
|
||||
aSolIdName += TCollection_AsciiString (aSolId);
|
||||
DrawTrSurf::Set (aSolIdName.ToCString(), aCircle);
|
||||
theCirTan3.WhichQualifier (aSolId, aQualifier1, aQualifier2, aQualifier3);
|
||||
theDI << "circle: " << aSolIdName.ToCString() << ", " << "qualifiers: " << GccEnt::PositionToString (aQualifier1)
|
||||
<< ", " << GccEnt::PositionToString (aQualifier2) << ", " << GccEnt::PositionToString (aQualifier3) << "\n";
|
||||
|
||||
theDI << " tangent points: point (parameter on solution, parameter on argument)\n";
|
||||
// the first tangent point
|
||||
if (theCirTan3.IsTheSame1 (aSolId))
|
||||
theDI << " " << "= the solution number " << aSolId << " is equal to the first argument\n";
|
||||
else
|
||||
{
|
||||
theCirTan3.Tangency1 (aSolId, aParSol, aParArg, aPntSol);
|
||||
TCollection_AsciiString aTanPntIdName = aSolIdName + "_tp_1";
|
||||
DrawTrSurf::Set (aTanPntIdName.ToCString(), aPntSol);
|
||||
theDI << " " << aTanPntIdName.ToCString() << " (" << aParSol << ", " << aParArg << ")\n";
|
||||
}
|
||||
// the second tangent point
|
||||
if (theCirTan3.IsTheSame2 (aSolId))
|
||||
theDI << " " << "= the solution number " << aSolId << " is equal to the second argument\n";
|
||||
else
|
||||
{
|
||||
theCirTan3.Tangency2 (aSolId, aParSol, aParArg, aPntSol);
|
||||
TCollection_AsciiString aTanPntIdName = aSolIdName + "_tp_2";
|
||||
DrawTrSurf::Set (aTanPntIdName.ToCString(), aPntSol);
|
||||
theDI << " " << aTanPntIdName.ToCString() << " (" << aParSol << ", " << aParArg << ")\n";
|
||||
}
|
||||
// the third tangent point
|
||||
if (theCirTan3.IsTheSame3 (aSolId))
|
||||
theDI << " " << "= the solution number " << aSolId << " is equal to the third argument\n";
|
||||
else
|
||||
{
|
||||
theCirTan3.Tangency3 (aSolId, aParSol, aParArg, aPntSol);
|
||||
TCollection_AsciiString aTanPntIdName = aSolIdName + "_tp_3";
|
||||
DrawTrSurf::Set (aTanPntIdName.ToCString(), aPntSol);
|
||||
theDI << " " << aTanPntIdName.ToCString() << " (" << aParSol << ", " << aParArg << ")";
|
||||
}
|
||||
if (aSolId != theCirTan3.NbSolutions())
|
||||
theDI << "\n";
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : circ2d3Tan
|
||||
//purpose : Parses command: [circ2d3Tan cname qcicrle1/qlin1/point1 qcicrle2/qlin2/point2 qcicrle3/qlin3/point3
|
||||
// tolerance]
|
||||
//=======================================================================
|
||||
static Standard_Integer circ2d3Tan (Draw_Interpretor& theDI, Standard_Integer theArgsNb, const char** theArgVec)
|
||||
{
|
||||
if (theArgsNb < 5)
|
||||
{
|
||||
cout << "Error: wrong number of arguments.\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
Handle(GeometryTest_DrawableQualifiedCurve2d) aQCurve1 =
|
||||
Handle(GeometryTest_DrawableQualifiedCurve2d)::DownCast (Draw::Get (theArgVec[2]));
|
||||
Handle(GeometryTest_DrawableQualifiedCurve2d) aQCurve2 =
|
||||
Handle(GeometryTest_DrawableQualifiedCurve2d)::DownCast (Draw::Get (theArgVec[3]));
|
||||
Handle(GeometryTest_DrawableQualifiedCurve2d) aQCurve3 =
|
||||
Handle(GeometryTest_DrawableQualifiedCurve2d)::DownCast (Draw::Get (theArgVec[4]));
|
||||
|
||||
gp_Pnt2d aPoint1, aPoint2, aPoint3;
|
||||
Standard_Boolean anIsPoint1 = DrawTrSurf::GetPoint2d (theArgVec[2], aPoint1);
|
||||
Standard_Boolean anIsPoint2 = DrawTrSurf::GetPoint2d (theArgVec[3], aPoint2);
|
||||
Standard_Boolean anIsPoint3 = DrawTrSurf::GetPoint2d (theArgVec[4], aPoint3);
|
||||
|
||||
Standard_Real aTolerance = Precision::Confusion();
|
||||
if (theArgsNb > 5)
|
||||
aTolerance = Draw::Atof (theArgVec[5]);
|
||||
|
||||
if (aQCurve1.IsNull()) // <point, point, point>
|
||||
{
|
||||
if (!anIsPoint1 || !anIsPoint2 || !anIsPoint3)
|
||||
{
|
||||
cout << "Error: wrong points definition.\n";
|
||||
return 1;
|
||||
}
|
||||
GccAna_Circ2d3Tan aCircBuilder (aPoint1, aPoint2, aPoint3, aTolerance);
|
||||
return solutions (theDI, aCircBuilder, theArgVec[1]);
|
||||
}
|
||||
|
||||
// the first curve is not NULL
|
||||
if (aQCurve2.IsNull()) // <qcircle, point, point> or <qlin, point, point>
|
||||
{
|
||||
if (!anIsPoint2 || !anIsPoint3)
|
||||
{
|
||||
cout << "Error: wrong points definition.\n";
|
||||
return 1;
|
||||
}
|
||||
Geom2dAdaptor_Curve anAdaptorCurve1 (aQCurve1->GetCurve());
|
||||
if (anAdaptorCurve1.GetType() == GeomAbs_Circle)
|
||||
{
|
||||
GccEnt_QualifiedCirc aQualifiedCircle1 (anAdaptorCurve1.Circle(), aQCurve1->GetPosition());
|
||||
GccAna_Circ2d3Tan aCircBuilder (aQualifiedCircle1, aPoint2, aPoint3, aTolerance);
|
||||
return solutions (theDI, aCircBuilder, theArgVec[1]);
|
||||
}
|
||||
else if (anAdaptorCurve1.GetType() == GeomAbs_Line)
|
||||
{
|
||||
GccEnt_QualifiedLin aQualifiedLin1 (anAdaptorCurve1.Line(), aQCurve1->GetPosition());
|
||||
GccAna_Circ2d3Tan aCircBuilder (aQualifiedLin1, aPoint2, aPoint3, aTolerance);
|
||||
return solutions (theDI, aCircBuilder, theArgVec[1]);
|
||||
}
|
||||
cout << "Error: wrong curve type.\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
// the first and the second curves are not NULL
|
||||
if (aQCurve3.IsNull()) // <qcircle, qcircle, point> or <qcircle, qlin, point> or <qlin, qlin, point>
|
||||
{
|
||||
if (!anIsPoint3)
|
||||
{
|
||||
cout << "Error: wrong point definition.\n";
|
||||
return 1;
|
||||
}
|
||||
Geom2dAdaptor_Curve anAdaptorCurve1 (aQCurve1->GetCurve());
|
||||
Geom2dAdaptor_Curve anAdaptorCurve2 (aQCurve2->GetCurve());
|
||||
if (anAdaptorCurve1.GetType() == GeomAbs_Circle && anAdaptorCurve2.GetType() == GeomAbs_Circle)
|
||||
{
|
||||
GccEnt_QualifiedCirc aQualifiedCircle1 (anAdaptorCurve1.Circle(), aQCurve1->GetPosition());
|
||||
GccEnt_QualifiedCirc aQualifiedCircle2 (anAdaptorCurve2.Circle(), aQCurve2->GetPosition());
|
||||
GccAna_Circ2d3Tan aCircBuilder (aQualifiedCircle1, aQualifiedCircle2, aPoint3, aTolerance);
|
||||
return solutions (theDI, aCircBuilder, theArgVec[1]);
|
||||
}
|
||||
else if (anAdaptorCurve1.GetType() == GeomAbs_Circle && anAdaptorCurve2.GetType() == GeomAbs_Line)
|
||||
{
|
||||
GccEnt_QualifiedCirc aQualifiedCircle1 (anAdaptorCurve1.Circle(), aQCurve1->GetPosition());
|
||||
GccEnt_QualifiedLin aQualifiedLin2 (anAdaptorCurve2.Line(), aQCurve2->GetPosition());
|
||||
GccAna_Circ2d3Tan aCircBuilder (aQualifiedCircle1, aQualifiedLin2, aPoint3, aTolerance);
|
||||
return solutions (theDI, aCircBuilder, theArgVec[1]);
|
||||
}
|
||||
else if (anAdaptorCurve1.GetType() == GeomAbs_Line && anAdaptorCurve2.GetType() == GeomAbs_Line)
|
||||
{
|
||||
GccEnt_QualifiedLin aQualifiedLin1 (anAdaptorCurve1.Line(), aQCurve1->GetPosition());
|
||||
GccEnt_QualifiedLin aQualifiedLin2 (anAdaptorCurve2.Line(), aQCurve2->GetPosition());
|
||||
GccAna_Circ2d3Tan aCircBuilder (aQualifiedLin1, aQualifiedLin2, aPoint3, aTolerance);
|
||||
return solutions (theDI, aCircBuilder, theArgVec[1]);
|
||||
}
|
||||
cout << "Error: wrong curve type.\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
// the first, the second and the third curves are not NULL
|
||||
// <qcircle, qcircle, qcircle> or <qcircle, qcircle, qlin>, <qcircle, qlin, qlin>, <qlin, qlin, qlin>
|
||||
Geom2dAdaptor_Curve anAdaptorCurve1 (aQCurve1->GetCurve());
|
||||
Geom2dAdaptor_Curve anAdaptorCurve2 (aQCurve2->GetCurve());
|
||||
Geom2dAdaptor_Curve anAdaptorCurve3 (aQCurve3->GetCurve());
|
||||
if (anAdaptorCurve1.GetType() == GeomAbs_Circle && anAdaptorCurve2.GetType() == GeomAbs_Circle &&
|
||||
anAdaptorCurve3.GetType() == GeomAbs_Circle)
|
||||
{
|
||||
GccEnt_QualifiedCirc aQualifiedCircle1 (anAdaptorCurve1.Circle(), aQCurve1->GetPosition());
|
||||
GccEnt_QualifiedCirc aQualifiedCircle2 (anAdaptorCurve2.Circle(), aQCurve2->GetPosition());
|
||||
GccEnt_QualifiedCirc aQualifiedCircle3 (anAdaptorCurve3.Circle(), aQCurve3->GetPosition());
|
||||
GccAna_Circ2d3Tan aCircBuilder (aQualifiedCircle1, aQualifiedCircle2, aQualifiedCircle3, aTolerance);
|
||||
return solutions (theDI, aCircBuilder, theArgVec[1]);
|
||||
}
|
||||
if (anAdaptorCurve1.GetType() == GeomAbs_Circle && anAdaptorCurve2.GetType() == GeomAbs_Circle &&
|
||||
anAdaptorCurve3.GetType() == GeomAbs_Line)
|
||||
{
|
||||
GccEnt_QualifiedCirc aQualifiedCircle1 (anAdaptorCurve1.Circle(), aQCurve1->GetPosition());
|
||||
GccEnt_QualifiedCirc aQualifiedCircle2 (anAdaptorCurve2.Circle(), aQCurve2->GetPosition());
|
||||
GccEnt_QualifiedLin aQualifiedLin3 (anAdaptorCurve3.Line(), aQCurve3->GetPosition());
|
||||
GccAna_Circ2d3Tan aCircBuilder (aQualifiedCircle1, aQualifiedCircle2, aQualifiedLin3, aTolerance);
|
||||
return solutions (theDI, aCircBuilder, theArgVec[1]);
|
||||
}
|
||||
if (anAdaptorCurve1.GetType() == GeomAbs_Circle && anAdaptorCurve2.GetType() == GeomAbs_Line &&
|
||||
anAdaptorCurve3.GetType() == GeomAbs_Line)
|
||||
{
|
||||
GccEnt_QualifiedCirc aQualifiedCircle1 (anAdaptorCurve1.Circle(), aQCurve1->GetPosition());
|
||||
GccEnt_QualifiedLin aQualifiedLin2 (anAdaptorCurve2.Line(), aQCurve2->GetPosition());
|
||||
GccEnt_QualifiedLin aQualifiedLin3 (anAdaptorCurve3.Line(), aQCurve3->GetPosition());
|
||||
GccAna_Circ2d3Tan aCircBuilder (aQualifiedCircle1, aQualifiedLin2, aQualifiedLin3, aTolerance);
|
||||
return solutions (theDI, aCircBuilder, theArgVec[1]);
|
||||
}
|
||||
if (anAdaptorCurve1.GetType() == GeomAbs_Line && anAdaptorCurve2.GetType() == GeomAbs_Line &&
|
||||
anAdaptorCurve3.GetType() == GeomAbs_Line)
|
||||
{
|
||||
GccEnt_QualifiedLin aQualifiedLin1 (anAdaptorCurve1.Line(), aQCurve1->GetPosition());
|
||||
GccEnt_QualifiedLin aQualifiedLin2 (anAdaptorCurve2.Line(), aQCurve2->GetPosition());
|
||||
GccEnt_QualifiedLin aQualifiedLin3 (anAdaptorCurve3.Line(), aQCurve3->GetPosition());
|
||||
GccAna_Circ2d3Tan aCircBuilder (aQualifiedLin1, aQualifiedLin2, aQualifiedLin3, aTolerance);
|
||||
return solutions (theDI, aCircBuilder, theArgVec[1]);
|
||||
}
|
||||
|
||||
cout << "Error: wrong curve type.\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : CurveTanCommands
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GeometryTest::CurveTanCommands (Draw_Interpretor& theCommands)
|
||||
{
|
||||
static Standard_Boolean aLoaded = Standard_False;
|
||||
if (aLoaded) return;
|
||||
aLoaded = Standard_True;
|
||||
|
||||
DrawTrSurf::BasicCommands (theCommands);
|
||||
|
||||
const char* aGroup;
|
||||
aGroup = "GEOMETRY tangent curves creation";
|
||||
|
||||
theCommands.Add ("qcircle",
|
||||
"qcircle name {x y [ux uy] radius} [-unqualified|-enclosing|-enclosed|-outside|-noqualifier]"
|
||||
"\n\t\t: Creates qualified circle.",
|
||||
__FILE__, qcurve, aGroup);
|
||||
|
||||
theCommands.Add ("qline",
|
||||
"qline name x y dx dy [-unqualified|-enclosing|-enclosed|-outside|-noqualifier]"
|
||||
"\n\t\t: Creates qualified line.",
|
||||
__FILE__, qcurve, aGroup);
|
||||
|
||||
theCommands.Add ("circ2d3Tan",
|
||||
"circ2d3Tan cname {qcicrle1|qlin1|point1} {qcicrle2|qlin2|point2} {qcicrle3|qlin3|point3} [tolerance]"
|
||||
"\n\t\t: Creates 2d circles tangent to 3 arguments. The arguments are points, lines or circles."
|
||||
"\n\t\t: Possible arguments combinations:"
|
||||
"\n\t\t: <qcircle, qcircle, qcircle>,"
|
||||
"\n\t\t: <qcircle, qcircle, qlin>,"
|
||||
"\n\t\t: <qcircle, qcircle, point>,"
|
||||
"\n\t\t: <qcircle, qlin, qlin>,"
|
||||
"\n\t\t: <qcircle, qlin, point>,"
|
||||
"\n\t\t: <qcircle, qlin, qlin>,"
|
||||
"\n\t\t: <qcircle, point, point>,"
|
||||
"\n\t\t: <qlin, qlin, qlin>,"
|
||||
"\n\t\t: <qlin, qlin, point>,"
|
||||
"\n\t\t: <qlin, point, point>,"
|
||||
"\n\t\t: <point, point, point>.",
|
||||
__FILE__, circ2d3Tan, aGroup);
|
||||
}
|
96
src/GeometryTest/GeometryTest_DrawableQualifiedCurve2d.cxx
Normal file
@@ -0,0 +1,96 @@
|
||||
// Created on: 2017-06-16
|
||||
// Created by: Natalia ERMOLAEVA
|
||||
// Copyright (c) 2017 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.
|
||||
|
||||
#include <GeometryTest_DrawableQualifiedCurve2d.hxx>
|
||||
|
||||
#include <GccEnt.hxx>
|
||||
#include <Geom2d_Circle.hxx>
|
||||
#include <Geom2d_Curve.hxx>
|
||||
#include <Geom2d_Line.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(GeometryTest_DrawableQualifiedCurve2d, DrawTrSurf_Curve2d)
|
||||
|
||||
//=======================================================================
|
||||
//function : GeometryTest_DrawableQualifiedCurve2d
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
GeometryTest_DrawableQualifiedCurve2d::GeometryTest_DrawableQualifiedCurve2d (const Handle(Geom2d_Curve)& theCurve,
|
||||
const GccEnt_Position thePosition,
|
||||
const Standard_Boolean theDispOrigin)
|
||||
: DrawTrSurf_Curve2d (theCurve, theDispOrigin), myPosition (thePosition)
|
||||
{
|
||||
look = Draw_orange;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GeometryTest_DrawableQualifiedCurve2d
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
GeometryTest_DrawableQualifiedCurve2d::GeometryTest_DrawableQualifiedCurve2d (const Handle(Geom2d_Curve)& theCurve,
|
||||
const Draw_Color& theColor,
|
||||
const Standard_Integer theDiscret,
|
||||
const GccEnt_Position thePosition,
|
||||
const Standard_Boolean theDispOrigin,
|
||||
const Standard_Boolean theDispCurvRadius,
|
||||
const Standard_Real theRadiusMax,
|
||||
const Standard_Real theRatioOfRadius)
|
||||
: DrawTrSurf_Curve2d (theCurve, theColor, theDiscret, theDispOrigin, theDispCurvRadius, theRadiusMax, theRatioOfRadius),
|
||||
myPosition (thePosition)
|
||||
{
|
||||
look = Draw_orange;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : DrawOn
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void GeometryTest_DrawableQualifiedCurve2d::DrawOn (Draw_Display& theDisplay) const
|
||||
{
|
||||
DrawTrSurf_Curve2d::DrawOn (theDisplay);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Dump
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void GeometryTest_DrawableQualifiedCurve2d::Dump (Standard_OStream& theStream) const
|
||||
{
|
||||
theStream << "Qualified curve 2D: \n";
|
||||
theStream << "Position :" << GccEnt::PositionToString (myPosition) << "\n";
|
||||
DrawTrSurf_Curve2d::Dump (theStream);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Whatis
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void GeometryTest_DrawableQualifiedCurve2d::Whatis (Draw_Interpretor& theDI)const
|
||||
{
|
||||
Handle(Standard_Type) aType = GetCurve()->DynamicType();
|
||||
|
||||
if (aType == STANDARD_TYPE (Geom2d_Circle))
|
||||
{
|
||||
theDI << "qualified 2d Circle";
|
||||
}
|
||||
else if (aType == STANDARD_TYPE (Geom2d_Line))
|
||||
{
|
||||
theDI << "qualified 2d Line";
|
||||
}
|
||||
}
|
88
src/GeometryTest/GeometryTest_DrawableQualifiedCurve2d.hxx
Normal file
@@ -0,0 +1,88 @@
|
||||
// Created on: 2017-06-16
|
||||
// Created by: Natalia ERMOLAEVA
|
||||
// Copyright (c) 2017 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.
|
||||
|
||||
#ifndef _GeometryTest_DrawableQualifiedCirc_HeaderFile
|
||||
#define _GeometryTest_DrawableQualifiedCirc_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <DrawTrSurf_Curve2d.hxx>
|
||||
#include <GccEnt_Position.hxx>
|
||||
|
||||
class Geom2d_Curve;
|
||||
|
||||
class GeometryTest_DrawableQualifiedCurve2d;
|
||||
DEFINE_STANDARD_HANDLE(GeometryTest_DrawableQualifiedCurve2d, DrawTrSurf_Curve)
|
||||
|
||||
//! Create geom curve drawable presentation with the position of a solution of a construction algorithm.
|
||||
class GeometryTest_DrawableQualifiedCurve2d : public DrawTrSurf_Curve2d
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates a drawable curve from a curve of package Geom.
|
||||
Standard_EXPORT GeometryTest_DrawableQualifiedCurve2d (const Handle(Geom2d_Curve)& theCurve,
|
||||
const GccEnt_Position thePosition,
|
||||
const Standard_Boolean theDispOrigin = Standard_True);
|
||||
|
||||
//! Creates a drawable curve from a curve of package Geom.
|
||||
Standard_EXPORT GeometryTest_DrawableQualifiedCurve2d (const Handle(Geom2d_Curve)& theCurve,
|
||||
const Draw_Color& theColor,
|
||||
const Standard_Integer theDiscret,
|
||||
const GccEnt_Position thePosition,
|
||||
const Standard_Boolean theDispOrigin = Standard_True,
|
||||
const Standard_Boolean theDispCurvRadius = Standard_False,
|
||||
const Standard_Real theRadiusMax = 1.0e3,
|
||||
const Standard_Real theRatioOfRadius = 0.1);
|
||||
|
||||
//! \returns position of a solution
|
||||
Standard_EXPORT GccEnt_Position GetPosition() const { return myPosition; }
|
||||
|
||||
//! Sets position of a solution
|
||||
//! \param thePosition the value
|
||||
void SetPosition (const GccEnt_Position thePosition) { myPosition = thePosition; }
|
||||
|
||||
//! Paints the drawable presentation in given display
|
||||
//! \param theDisplay
|
||||
Standard_EXPORT void DrawOn (Draw_Display& theDisplay) const Standard_OVERRIDE;
|
||||
|
||||
//! For variable dump.
|
||||
Standard_EXPORT virtual void Dump (Standard_OStream& S) const Standard_OVERRIDE;
|
||||
|
||||
//! For variable whatis command. Set as a result the
|
||||
//! type of the variable.
|
||||
Standard_EXPORT virtual void Whatis (Draw_Interpretor& I) const Standard_OVERRIDE;
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(GeometryTest_DrawableQualifiedCurve2d, DrawTrSurf_Curve2d)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
GccEnt_Position myPosition;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _GeometryTest_DrawableQualifiedCirc_HeaderFile
|
@@ -174,16 +174,26 @@ IntCurvesFace_Intersector::IntCurvesFace_Intersector(const TopoDS_Face& Face,
|
||||
if (nbsu > aMaxSamples) nbsu = aMaxSamples;
|
||||
if (nbsv > aMaxSamples) nbsv = aMaxSamples;
|
||||
|
||||
if (Max(dU, dV) > Min(dU, dV) * aTresh)
|
||||
{
|
||||
aMinSamples = 10;
|
||||
nbsu = (Standard_Integer)(Sqrt(dU / dV) * aMaxSamples);
|
||||
if (nbsu < aMinSamples) nbsu = aMinSamples;
|
||||
nbsv = aMaxSamples2 / nbsu;
|
||||
if (nbsv < aMinSamples)
|
||||
if (dU > gp::Resolution() && dV > gp::Resolution()) {
|
||||
if (Max(dU, dV) > Min(dU, dV) * aTresh)
|
||||
{
|
||||
nbsv = aMinSamples;
|
||||
nbsu = aMaxSamples2 / aMinSamples;
|
||||
aMinSamples = 10;
|
||||
nbsu = (Standard_Integer)(Sqrt(dU / dV) * aMaxSamples);
|
||||
if (nbsu < aMinSamples) nbsu = aMinSamples;
|
||||
nbsv = aMaxSamples2 / nbsu;
|
||||
if (nbsv < aMinSamples)
|
||||
{
|
||||
nbsv = aMinSamples;
|
||||
nbsu = aMaxSamples2 / aMinSamples;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (dU < gp::Resolution()) {
|
||||
nbsu = 1;
|
||||
}
|
||||
if (dV < gp::Resolution()) {
|
||||
nbsv = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -223,12 +223,14 @@ public:
|
||||
Standard_EXPORT virtual void UnsetAttributes();
|
||||
|
||||
//! Returns the hilight attributes settings.
|
||||
//! When not NULL, overrides both Prs3d_TypeOfHighlight_LocalSelected and Prs3d_TypeOfHighlight_Selected defined within AIS_InteractiveContext.
|
||||
const Handle(Prs3d_Drawer)& HilightAttributes() const { return myHilightDrawer; }
|
||||
|
||||
//! Initializes the hilight drawing tool theDrawer.
|
||||
virtual void SetHilightAttributes(const Handle(Prs3d_Drawer)& theDrawer) { myHilightDrawer = theDrawer; }
|
||||
|
||||
//! Returns the hilight attributes settings.
|
||||
//! When not NULL, overrides both Prs3d_TypeOfHighlight_LocalDynamic and Prs3d_TypeOfHighlight_Dynamic defined within AIS_InteractiveContext.
|
||||
const Handle(Prs3d_Drawer)& DynamicHilightAttributes() const { return myDynHilightDrawer; }
|
||||
|
||||
//! Initializes the dynamic hilight drawing tool.
|
||||
|
@@ -80,6 +80,9 @@ namespace
|
||||
//! Creates Poly_Triangulation from collected data
|
||||
Handle(Poly_Triangulation) GetTriangulation()
|
||||
{
|
||||
if (myTriangles.IsEmpty())
|
||||
return Handle(Poly_Triangulation)();
|
||||
|
||||
Handle(Poly_Triangulation) aPoly = new Poly_Triangulation (myNodes.Length(), myTriangles.Length(), Standard_False);
|
||||
for (Standard_Integer aNodeIter = 0; aNodeIter < myNodes.Size(); ++aNodeIter)
|
||||
{
|
||||
@@ -109,10 +112,9 @@ Handle(Poly_Triangulation) RWStl::ReadFile (const Standard_CString theFile,
|
||||
const Handle(Message_ProgressIndicator)& theProgress)
|
||||
{
|
||||
Reader aReader;
|
||||
if (!aReader.Read (theFile, theProgress))
|
||||
{
|
||||
return Handle(Poly_Triangulation)();
|
||||
}
|
||||
aReader.Read (theFile, theProgress);
|
||||
// note that returned bool value is ignored intentionally -- even if something went wrong,
|
||||
// but some data have been read, we at least will return these data
|
||||
return aReader.GetTriangulation();
|
||||
}
|
||||
|
||||
@@ -209,10 +211,15 @@ Handle(Poly_Triangulation) RWStl::ReadAscii (const OSD_Path& theFile,
|
||||
//function : Write
|
||||
//purpose :
|
||||
//=============================================================================
|
||||
Standard_Boolean RWStl::WriteBinary (const Handle(Poly_Triangulation)& aMesh,
|
||||
Standard_Boolean RWStl::WriteBinary (const Handle(Poly_Triangulation)& theMesh,
|
||||
const OSD_Path& thePath,
|
||||
const Handle(Message_ProgressIndicator)& theProgInd)
|
||||
{
|
||||
if (theMesh.IsNull() || theMesh->NbTriangles() <= 0)
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
TCollection_AsciiString aPath;
|
||||
thePath.SystemName (aPath);
|
||||
|
||||
@@ -222,7 +229,7 @@ Standard_Boolean RWStl::WriteBinary (const Handle(Poly_Triangulation)& aMesh,
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
Standard_Boolean isOK = writeBinary (aMesh, aFile, theProgInd);
|
||||
Standard_Boolean isOK = writeBinary (theMesh, aFile, theProgInd);
|
||||
|
||||
fclose (aFile);
|
||||
return isOK;
|
||||
@@ -236,6 +243,11 @@ Standard_Boolean RWStl::WriteAscii (const Handle(Poly_Triangulation)& theMesh,
|
||||
const OSD_Path& thePath,
|
||||
const Handle(Message_ProgressIndicator)& theProgInd)
|
||||
{
|
||||
if (theMesh.IsNull() || theMesh->NbTriangles() <= 0)
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
TCollection_AsciiString aPath;
|
||||
thePath.SystemName (aPath);
|
||||
|
||||
|
@@ -138,9 +138,15 @@ Standard_Boolean RWStl_Reader::Read (const char* theFile,
|
||||
std::streampos theEnd = aStream.tellg();
|
||||
aStream.seekg (0, aStream.beg);
|
||||
|
||||
while (!aStream.eof() && !aStream.bad())
|
||||
// binary STL files cannot be shorter than 134 bytes
|
||||
// (80 bytes header + 4 bytes facet count + 50 bytes for one facet);
|
||||
// thus assume files shorter than 134 as Ascii without probing
|
||||
// (probing may bring stream to fail state if EOF is reached)
|
||||
bool isAscii = ((size_t)theEnd < THE_STL_MIN_FILE_SIZE || IsAscii (aStream));
|
||||
|
||||
while (aStream.good())
|
||||
{
|
||||
if (IsAscii (aStream))
|
||||
if (isAscii)
|
||||
{
|
||||
if (!ReadAscii (aStream, theEnd, theProgress))
|
||||
{
|
||||
@@ -156,7 +162,7 @@ Standard_Boolean RWStl_Reader::Read (const char* theFile,
|
||||
}
|
||||
aStream >> std::ws; // skip any white spaces
|
||||
}
|
||||
return !aStream.bad();
|
||||
return ! aStream.fail();
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
@@ -169,10 +175,10 @@ Standard_Boolean RWStl_Reader::IsAscii (Standard_IStream& theStream)
|
||||
// read first 134 bytes to detect file format
|
||||
char aBuffer[THE_STL_MIN_FILE_SIZE];
|
||||
std::streamsize aNbRead = theStream.read (aBuffer, THE_STL_MIN_FILE_SIZE).gcount();
|
||||
if (!theStream)
|
||||
if (! theStream)
|
||||
{
|
||||
Message::DefaultMessenger()->Send ("Error: Cannot read file", Message_Fail);
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
// put back the read symbols
|
||||
@@ -240,7 +246,8 @@ Standard_Boolean RWStl_Reader::ReadAscii (Standard_IStream& theStream,
|
||||
// use method seekpos() to get true 64-bit offset to enable
|
||||
// handling of large files (VS 2010 64-bit)
|
||||
const int64_t aStartPos = GETPOS(theStream.tellg());
|
||||
const int64_t aEndPos = (theUntilPos > 0 ? GETPOS(theUntilPos) : std::numeric_limits<int64_t>::max());
|
||||
// Note: 1 is added to theUntilPos to be sure to read the last symbol (relevant for files without EOL at the end)
|
||||
const int64_t aEndPos = (theUntilPos > 0 ? 1 + GETPOS(theUntilPos) : std::numeric_limits<int64_t>::max());
|
||||
|
||||
// skip header "solid ..."
|
||||
theStream.ignore (aEndPos - aStartPos, '\n');
|
||||
|
@@ -47,6 +47,7 @@
|
||||
#include <StepDimTol_GeoTolAndGeoTolWthDatRefAndModGeoTolAndPosTol.hxx>
|
||||
#include <StepGeom_Axis2Placement3d.hxx>
|
||||
#include <StepGeom_CartesianTransformationOperator3d.hxx>
|
||||
#include <StepGeom_Direction.hxx>
|
||||
#include <StepGeom_GeometricRepresentationContextAndGlobalUnitAssignedContext.hxx>
|
||||
#include <StepGeom_GeometricRepresentationItem.hxx>
|
||||
#include <StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx.hxx>
|
||||
@@ -823,18 +824,30 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity(const Han
|
||||
nsh ++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// [BEGIN] Proceed with non-manifold topology (ssv; 12.11.2010)
|
||||
if (!isManifold) {
|
||||
|
||||
Handle(Standard_Transient) info;
|
||||
// IMPORTANT: any fixing on non-manifold topology must be done after the shape is transferred from STEP
|
||||
TopoDS_Shape fixedResult =
|
||||
XSAlgo::AlgoContainer()->ProcessShape( comp, myPrecision, myMaxTol,
|
||||
"read.step.resource.name",
|
||||
"read.step.sequence", info,
|
||||
TP->GetProgress() );
|
||||
TP->GetProgress(), Standard_True);
|
||||
XSAlgo::AlgoContainer()->MergeTransferInfo(TP, info, nbTPitems);
|
||||
|
||||
if (fixedResult.ShapeType() == TopAbs_COMPOUND)
|
||||
{
|
||||
comp = TopoDS::Compound(fixedResult);
|
||||
}
|
||||
else
|
||||
{
|
||||
comp.Nullify();
|
||||
B.MakeCompound(comp);
|
||||
B.Add(comp, fixedResult);
|
||||
}
|
||||
|
||||
BRep_Builder brepBuilder;
|
||||
|
||||
// [BEGIN] Try to close OPEN Shells in I-DEAS case (ssv; 17.11.2010)
|
||||
@@ -874,20 +887,19 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity(const Han
|
||||
// [BEGIN] Reconstruct Solids from Closed Shells (ssv; 15.11.2010)
|
||||
TopoDS_Compound reconstComp;
|
||||
brepBuilder.MakeCompound(reconstComp);
|
||||
|
||||
TopoDS_Iterator it(comp);
|
||||
for ( ; it.More(); it.Next() ) {
|
||||
TopoDS_Shape aSubShape = it.Value();
|
||||
if ( aSubShape.ShapeType() == TopAbs_SHELL && aSubShape.Closed() ) {
|
||||
TopoDS_Solid nextSolid;
|
||||
brepBuilder.MakeSolid(nextSolid);
|
||||
brepBuilder.Add(nextSolid, aSubShape);
|
||||
brepBuilder.Add(reconstComp, nextSolid);
|
||||
}
|
||||
else if (aSubShape.ShapeType() == TopAbs_SHELL)
|
||||
brepBuilder.Add(reconstComp, aSubShape);
|
||||
TopExp_Explorer exp(comp, TopAbs_SHELL);
|
||||
for (; exp.More(); exp.Next())
|
||||
{
|
||||
TopoDS_Shape aSubShape = exp.Current();
|
||||
if (aSubShape.ShapeType() == TopAbs_SHELL && aSubShape.Closed()) {
|
||||
TopoDS_Solid nextSolid;
|
||||
brepBuilder.MakeSolid(nextSolid);
|
||||
brepBuilder.Add(nextSolid, aSubShape);
|
||||
brepBuilder.Add(reconstComp, nextSolid);
|
||||
}
|
||||
else if (aSubShape.ShapeType() == TopAbs_SHELL)
|
||||
brepBuilder.Add(reconstComp, aSubShape);
|
||||
}
|
||||
|
||||
comp = reconstComp;
|
||||
// [END] Reconstruct Solids from Closed Shells (ssv; 15.11.2010)
|
||||
}
|
||||
@@ -896,6 +908,7 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity(const Han
|
||||
if (nsh == 0) shbinder.Nullify();
|
||||
else if (nsh == 1) shbinder = new TransferBRep_ShapeBinder (OneResult);
|
||||
else shbinder = new TransferBRep_ShapeBinder (comp);
|
||||
|
||||
PrepareUnits ( oldSRContext, TP ); //:S4136
|
||||
TP->Bind(sr, shbinder);
|
||||
|
||||
|
@@ -378,6 +378,32 @@ Handle(Prs3d_Presentation) SelectMgr_SelectableObject::GetSelectPresentation (co
|
||||
return mySelectionPrs;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ErasePresentations
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void SelectMgr_SelectableObject::ErasePresentations (Standard_Boolean theToRemove)
|
||||
{
|
||||
if (!mySelectionPrs.IsNull())
|
||||
{
|
||||
mySelectionPrs->Erase();
|
||||
if (theToRemove)
|
||||
{
|
||||
mySelectionPrs->Clear();
|
||||
mySelectionPrs.Nullify();
|
||||
}
|
||||
}
|
||||
if (!myHilightPrs.IsNull())
|
||||
{
|
||||
myHilightPrs->Erase();
|
||||
if (theToRemove)
|
||||
{
|
||||
myHilightPrs->Clear();
|
||||
myHilightPrs.Nullify();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetZLayer
|
||||
//purpose :
|
||||
|
@@ -168,7 +168,10 @@ public:
|
||||
Standard_EXPORT Handle(Prs3d_Presentation) GetHilightPresentation (const Handle(PrsMgr_PresentationManager3d)& TheMgr);
|
||||
|
||||
Standard_EXPORT Handle(Prs3d_Presentation) GetSelectPresentation (const Handle(PrsMgr_PresentationManager3d)& TheMgr);
|
||||
|
||||
|
||||
//! Removes presentations returned by GetHilightPresentation() and GetSelectPresentation().
|
||||
Standard_EXPORT virtual void ErasePresentations (Standard_Boolean theToRemove);
|
||||
|
||||
//! Set Z layer ID and update all presentations of the selectable object.
|
||||
//! The layers mechanism allows drawing objects in higher layers in overlay of objects in lower layers.
|
||||
Standard_EXPORT virtual void SetZLayer (const Graphic3d_ZLayerId theLayerId) Standard_OVERRIDE;
|
||||
@@ -219,14 +222,15 @@ protected:
|
||||
|
||||
SelectMgr_SequenceOfSelection myselections;
|
||||
Handle(SelectMgr_EntityOwner) myAssemblyOwner;
|
||||
Handle(Prs3d_Presentation) mySelectionPrs;
|
||||
Handle(Prs3d_Presentation) myHilightPrs;
|
||||
Standard_Boolean myAutoHilight;
|
||||
|
||||
private:
|
||||
|
||||
Standard_Integer mycurrent;
|
||||
Handle(Prs3d_Presentation) mySelectionPrs;
|
||||
Handle(Prs3d_Presentation) myHilightPrs;
|
||||
Standard_Integer myGlobalSelMode;
|
||||
|
||||
};
|
||||
|
||||
#endif // _SelectMgr_SelectableObject_HeaderFile
|
||||
|
@@ -18,9 +18,10 @@
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
SelectMgr_ToleranceMap::SelectMgr_ToleranceMap()
|
||||
: myLargestKey (-1),
|
||||
myCustomTolerance (-1)
|
||||
{
|
||||
myLargestKey = -1;
|
||||
myCustomTolerance = -1;
|
||||
//
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -38,24 +39,23 @@ SelectMgr_ToleranceMap::~SelectMgr_ToleranceMap()
|
||||
//=======================================================================
|
||||
void SelectMgr_ToleranceMap::Add (const Standard_Integer& theTolerance)
|
||||
{
|
||||
if (myTolerances.IsBound (theTolerance))
|
||||
if (Standard_Integer* aFreq = myTolerances.ChangeSeek (theTolerance))
|
||||
{
|
||||
Standard_Integer& aFreq = myTolerances.ChangeFind (theTolerance);
|
||||
aFreq++;
|
||||
|
||||
if (aFreq == 1 && theTolerance != myLargestKey)
|
||||
++(*aFreq);
|
||||
if (*aFreq == 1 && theTolerance != myLargestKey)
|
||||
{
|
||||
myLargestKey = Max (theTolerance, myLargestKey);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
myTolerances.Bind (theTolerance, 1);
|
||||
if (myTolerances.Extent() == 1)
|
||||
{
|
||||
myLargestKey = theTolerance;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (myTolerances.IsEmpty())
|
||||
{
|
||||
myTolerances.Bind (theTolerance, 1);
|
||||
myLargestKey = theTolerance;
|
||||
return;
|
||||
}
|
||||
|
||||
myTolerances.Bind (theTolerance, 1);
|
||||
myLargestKey = Max (theTolerance, myLargestKey);
|
||||
}
|
||||
}
|
||||
@@ -66,18 +66,22 @@ void SelectMgr_ToleranceMap::Add (const Standard_Integer& theTolerance)
|
||||
//=======================================================================
|
||||
void SelectMgr_ToleranceMap::Decrement (const Standard_Integer& theTolerance)
|
||||
{
|
||||
if (myTolerances.IsBound (theTolerance))
|
||||
Standard_Integer* aFreq = myTolerances.ChangeSeek (theTolerance);
|
||||
if (aFreq == NULL)
|
||||
{
|
||||
Standard_Integer& aFreq = myTolerances.ChangeFind (theTolerance);
|
||||
aFreq--;
|
||||
return;
|
||||
}
|
||||
|
||||
if (Abs (theTolerance - myLargestKey) < Precision::Confusion() && aFreq == 0)
|
||||
--(*aFreq);
|
||||
if (theTolerance == myLargestKey
|
||||
&& *aFreq == 0)
|
||||
{
|
||||
myLargestKey = 0;
|
||||
for (NCollection_DataMap<Standard_Integer, Standard_Integer>::Iterator anIter (myTolerances); anIter.More(); anIter.Next())
|
||||
{
|
||||
myLargestKey = 0;
|
||||
for (NCollection_DataMap<Standard_Integer, Standard_Integer>::Iterator anIter (myTolerances); anIter.More(); anIter.Next())
|
||||
if (anIter.Value() != 0)
|
||||
{
|
||||
if (anIter.Value() != 0)
|
||||
myLargestKey = Max (myLargestKey, anIter.Key());
|
||||
myLargestKey = Max (myLargestKey, anIter.Key());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1070,9 +1070,8 @@ Standard_Boolean ShapeAnalysis_Curve::GetSamplePoints (const Handle(Geom_Curve)&
|
||||
|
||||
GeomAdaptor_Curve GAC(curve);
|
||||
Standard_Real step = ( last - first ) / (Standard_Real)( nbp - 1 );
|
||||
Standard_Real par = first, stop = last - 0.5 * step;
|
||||
for ( ; par < stop; par += step )
|
||||
seq.Append(GAC.Value(par));
|
||||
for (Standard_Integer i = 0; i < nbp - 1; ++i)
|
||||
seq.Append(GAC.Value(first + step * i));
|
||||
seq.Append(GAC.Value(last));
|
||||
return Standard_True;
|
||||
}
|
||||
@@ -1093,9 +1092,8 @@ Standard_Boolean ShapeAnalysis_Curve::GetSamplePoints (const Handle(Geom2d_Curve
|
||||
//-- Attention aux bsplines rationnelles de degree 3. (bouts de cercles entre autres)
|
||||
if (nbs > 2) nbs*=4;
|
||||
Standard_Real step = ( last - first ) / (Standard_Real)( nbs - 1 );
|
||||
Standard_Real par = first, stop = last - 0.5 * step;
|
||||
for ( ; par < stop; par += step )
|
||||
seq.Append(C.Value(par));
|
||||
for (Standard_Integer i = 0; i < nbs - 1; ++i)
|
||||
seq.Append(C.Value(first + step * i));
|
||||
seq.Append(C.Value(last));
|
||||
return Standard_True;
|
||||
/*
|
||||
|
@@ -243,6 +243,7 @@ Standard_Boolean ShapeFix_Shape::Perform(const Handle(Message_ProgressIndicator)
|
||||
aPSentry.Next();
|
||||
|
||||
myResult = Context()->Apply(S);
|
||||
|
||||
if ( NeedFix(myFixSameParameterMode) )
|
||||
{
|
||||
SameParameter(myResult, Standard_False, theProgress);
|
||||
@@ -269,6 +270,7 @@ Standard_Boolean ShapeFix_Shape::Perform(const Handle(Message_ProgressIndicator)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
myResult = Context()->Apply(myResult);
|
||||
|
||||
if ( !fft.IsNull() )
|
||||
|
@@ -70,6 +70,7 @@ ShapeFix_Shell::ShapeFix_Shell()
|
||||
myFixOrientationMode = -1;
|
||||
myFixFace = new ShapeFix_Face;
|
||||
myNbShells =0;
|
||||
myNonManifold = Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -84,6 +85,7 @@ ShapeFix_Shell::ShapeFix_Shell(const TopoDS_Shell& shape)
|
||||
myFixOrientationMode = -1;
|
||||
myFixFace = new ShapeFix_Face;
|
||||
Init(shape);
|
||||
myNonManifold = Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -138,9 +140,10 @@ Standard_Boolean ShapeFix_Shell::Perform(const Handle(Message_ProgressIndicator)
|
||||
if ( !aPSentry.More() )
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
TopoDS_Shape newsh = Context()->Apply(myShell);
|
||||
if ( NeedFix ( myFixOrientationMode) )
|
||||
FixFaceOrientation(TopoDS::Shell(newsh));
|
||||
FixFaceOrientation(TopoDS::Shell(newsh), Standard_True, myNonManifold);
|
||||
|
||||
TopoDS_Shape aNewsh = Context()->Apply (newsh);
|
||||
ShapeAnalysis_Shell aSas;
|
||||
@@ -853,7 +856,10 @@ static void CreateClosedShell(TopTools_SequenceOfShape& OpenShells,
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean ShapeFix_Shell::FixFaceOrientation(const TopoDS_Shell& shell,const Standard_Boolean isAccountMultiConex,const Standard_Boolean NonManifold)
|
||||
Standard_Boolean ShapeFix_Shell::FixFaceOrientation(
|
||||
const TopoDS_Shell& shell,
|
||||
const Standard_Boolean isAccountMultiConex,
|
||||
const Standard_Boolean NonManifold)
|
||||
{
|
||||
//myStatus = ShapeExtend::EncodeStatus (ShapeExtend_OK);
|
||||
Standard_Boolean done = Standard_False;
|
||||
@@ -1101,6 +1107,7 @@ void ShapeFix_Shell::SetMaxTolerance (const Standard_Real maxtol)
|
||||
ShapeFix_Root::SetMaxTolerance ( maxtol );
|
||||
myFixFace->SetMaxTolerance ( maxtol );
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : NbShells
|
||||
//purpose :
|
||||
@@ -1110,3 +1117,13 @@ Standard_Integer ShapeFix_Shell::NbShells() const
|
||||
{
|
||||
return myNbShells;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetNonManifoldFlag
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void ShapeFix_Shell::SetNonManifoldFlag(const Standard_Boolean isNonManifold)
|
||||
{
|
||||
myNonManifold = isNonManifold;
|
||||
}
|
||||
|
@@ -73,7 +73,10 @@ public:
|
||||
//! If this mode is equal to Standard_True one non-manifold will be created from shell
|
||||
//! contains multishared edges. Else if this mode is equal to Standard_False only
|
||||
//! manifold shells will be created. By default - Standard_False.
|
||||
Standard_EXPORT Standard_Boolean FixFaceOrientation (const TopoDS_Shell& shell, const Standard_Boolean isAccountMultiConex = Standard_True, const Standard_Boolean NonManifold = Standard_False);
|
||||
Standard_EXPORT Standard_Boolean FixFaceOrientation (
|
||||
const TopoDS_Shell& shell,
|
||||
const Standard_Boolean isAccountMultiConex = Standard_True,
|
||||
const Standard_Boolean NonManifold = Standard_False);
|
||||
|
||||
//! Returns fixed shell (or subset of oriented faces).
|
||||
Standard_EXPORT TopoDS_Shell Shell();
|
||||
@@ -114,7 +117,8 @@ public:
|
||||
//! FixFaceOrientation, by default True.
|
||||
Standard_Integer& FixOrientationMode();
|
||||
|
||||
|
||||
//! Sets NonManifold flag
|
||||
Standard_EXPORT virtual void SetNonManifoldFlag(const Standard_Boolean isNonManifold);
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(ShapeFix_Shell,ShapeFix_Root)
|
||||
@@ -129,7 +133,7 @@ protected:
|
||||
Standard_Integer myFixFaceMode;
|
||||
Standard_Integer myFixOrientationMode;
|
||||
Standard_Integer myNbShells;
|
||||
|
||||
Standard_Boolean myNonManifold;
|
||||
|
||||
private:
|
||||
|
||||
|
@@ -716,7 +716,8 @@ static Standard_Boolean fixshape (const Handle(ShapeProcess_Context)& context)
|
||||
sfs->FixSolidTool()->CreateOpenSolidMode() = ctx->BooleanVal ( "CreateOpenSolidMode", Standard_True );
|
||||
|
||||
sfs->FixShellTool()->FixFaceMode() = ctx->IntegerVal ( "FixFaceMode", -1 );
|
||||
sfs->FixShellTool()->FixOrientationMode() = ctx->IntegerVal ( "FixFaceOrientationMode", -1 );
|
||||
sfs->FixShellTool()->SetNonManifoldFlag(ctx->IsNonManifold());
|
||||
sfs->FixShellTool()->FixOrientationMode() = ctx->IntegerVal("FixFaceOrientationMode", -1);
|
||||
|
||||
//parameters for ShapeFix_Face
|
||||
sff->FixWireMode() = ctx->IntegerVal ( "FixWireMode", -1 );
|
||||
|
@@ -38,7 +38,8 @@ IMPLEMENT_STANDARD_RTTIEXT(ShapeProcess_ShapeContext,ShapeProcess_Context)
|
||||
//=======================================================================
|
||||
ShapeProcess_ShapeContext::ShapeProcess_ShapeContext (const Standard_CString file,
|
||||
const Standard_CString seq)
|
||||
: ShapeProcess_Context ( file, seq ), myUntil(TopAbs_FACE)
|
||||
: ShapeProcess_Context ( file, seq ), myUntil(TopAbs_FACE),
|
||||
myNonManifold(Standard_False)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -50,7 +51,8 @@ ShapeProcess_ShapeContext::ShapeProcess_ShapeContext (const Standard_CString fil
|
||||
ShapeProcess_ShapeContext::ShapeProcess_ShapeContext (const TopoDS_Shape &S,
|
||||
const Standard_CString file,
|
||||
const Standard_CString seq)
|
||||
: ShapeProcess_Context ( file, seq ), myUntil(TopAbs_FACE)
|
||||
: ShapeProcess_Context ( file, seq ), myUntil(TopAbs_FACE),
|
||||
myNonManifold(Standard_False)
|
||||
{
|
||||
Init ( S );
|
||||
}
|
||||
|
@@ -126,7 +126,17 @@ public:
|
||||
//! Prints statistics on Shape Processing onto the current Messenger.
|
||||
Standard_EXPORT void PrintStatistics() const;
|
||||
|
||||
//! Set NonManifold flag
|
||||
Standard_EXPORT void SetNonManifold(Standard_Boolean theNonManifold)
|
||||
{
|
||||
myNonManifold = theNonManifold;
|
||||
}
|
||||
|
||||
//! Get NonManifold flag
|
||||
Standard_EXPORT Standard_Boolean IsNonManifold()
|
||||
{
|
||||
return myNonManifold;
|
||||
}
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(ShapeProcess_ShapeContext,ShapeProcess_Context)
|
||||
@@ -144,7 +154,7 @@ private:
|
||||
TopTools_DataMapOfShapeShape myMap;
|
||||
Handle(ShapeExtend_MsgRegistrator) myMsg;
|
||||
TopAbs_ShapeEnum myUntil;
|
||||
|
||||
Standard_Boolean myNonManifold;
|
||||
|
||||
};
|
||||
|
||||
|
@@ -26,4 +26,3 @@ StdSelect_TypeOfResult.hxx
|
||||
StdSelect_TypeOfSelectionImage.hxx
|
||||
StdSelect_ViewerSelector3d.cxx
|
||||
StdSelect_ViewerSelector3d.hxx
|
||||
StdSelect_ViewerSelector3d.lxx
|
||||
|
@@ -50,7 +50,7 @@ public:
|
||||
Standard_EXPORT void SetPixelTolerance (const Standard_Integer theTolerance);
|
||||
|
||||
//! Returns the pixel tolerance.
|
||||
inline Standard_Integer PixelTolerance() const;
|
||||
Standard_Integer PixelTolerance() const { return myTolerances.Tolerance(); }
|
||||
|
||||
//! Picks the sensitive entity at the pixel coordinates of
|
||||
//! the mouse <theXPix> and <theYPix>. The selector looks for touched areas and owners.
|
||||
@@ -114,6 +114,4 @@ protected:
|
||||
|
||||
DEFINE_STANDARD_HANDLE(StdSelect_ViewerSelector3d, SelectMgr_ViewerSelector)
|
||||
|
||||
#include <StdSelect_ViewerSelector3d.lxx>
|
||||
|
||||
#endif
|
||||
|
@@ -49,8 +49,11 @@ Standard_Boolean StlAPI_Writer::Write (const TopoDS_Shape& theShape,
|
||||
{
|
||||
TopLoc_Location aLoc;
|
||||
Handle(Poly_Triangulation) aTriangulation = BRep_Tool::Triangulation (TopoDS::Face (anExpSF.Current()), aLoc);
|
||||
aNbNodes += aTriangulation->NbNodes();
|
||||
aNbTriangles += aTriangulation->NbTriangles();
|
||||
if (! aTriangulation.IsNull())
|
||||
{
|
||||
aNbNodes += aTriangulation->NbNodes ();
|
||||
aNbTriangles += aTriangulation->NbTriangles ();
|
||||
}
|
||||
}
|
||||
|
||||
// create temporary triangulation
|
||||
|
@@ -161,13 +161,7 @@ void TDF_CopyLabel::Perform()
|
||||
myIsDone = Standard_False;
|
||||
if(mySL.Data()->Root().IsDifferent(myTL.Data()->Root()) && //TDF_Data is not the same
|
||||
!TDF_Tool::IsSelfContained(mySL, myFilter)) return; //source label isn't self-contained
|
||||
else {
|
||||
#ifdef OCCT_DEBUG
|
||||
cout << "THE SAME Data" <<endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
//TDF_Data of the source and target labels are the same
|
||||
Standard_Boolean extReferers =
|
||||
ExternalReferences(mySL, myMapOfExt, myFilter);
|
||||
|
||||
|
@@ -4,6 +4,8 @@ XCAFDoc.cxx
|
||||
XCAFDoc.hxx
|
||||
XCAFDoc_Area.cxx
|
||||
XCAFDoc_Area.hxx
|
||||
XCAFDoc_AssemblyGraph.cxx
|
||||
XCAFDoc_AssemblyGraph.hxx
|
||||
XCAFDoc_Centroid.cxx
|
||||
XCAFDoc_Centroid.hxx
|
||||
XCAFDoc_ClippingPlaneTool.cxx
|
||||
@@ -40,6 +42,7 @@ XCAFDoc_Material.cxx
|
||||
XCAFDoc_Material.hxx
|
||||
XCAFDoc_MaterialTool.cxx
|
||||
XCAFDoc_MaterialTool.hxx
|
||||
XCAFDoc_ObjectId.hxx
|
||||
XCAFDoc_ShapeMapTool.cxx
|
||||
XCAFDoc_ShapeMapTool.hxx
|
||||
XCAFDoc_ShapeTool.cxx
|
||||
|
259
src/XCAFDoc/XCAFDoc_AssemblyGraph.cxx
Normal file
@@ -0,0 +1,259 @@
|
||||
// Created on: 2017-08-22
|
||||
// Created by: Sergey SLYADNEV
|
||||
// Copyright (c) 2017 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.
|
||||
|
||||
// Own include
|
||||
#include <XCAFDoc_AssemblyGraph.hxx>
|
||||
|
||||
// OCCT includes
|
||||
#include <TColStd_MapIteratorOfPackedMapOfInteger.hxx>
|
||||
#include <TDataStd_Name.hxx>
|
||||
#include <TDataStd_TreeNode.hxx>
|
||||
#include <TDF_ChildIterator.hxx>
|
||||
#include <TDF_LabelSequence.hxx>
|
||||
#include <TDF_Tool.hxx>
|
||||
#include <XCAFDoc.hxx>
|
||||
#include <XCAFDoc_DocumentTool.hxx>
|
||||
#include <XCAFDoc_ShapeTool.hxx>
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#define NodeLetter "N"
|
||||
#define Whitespace " "
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
XCAFDoc_AssemblyGraph::XCAFDoc_AssemblyGraph(const Handle(TDocStd_Document)& M,
|
||||
const bool withParts)
|
||||
: Standard_Transient (),
|
||||
m_model (M),
|
||||
m_bWithParts (withParts)
|
||||
{
|
||||
this->buildGraph();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void XCAFDoc_AssemblyGraph::Dump(Standard_OStream& out) const
|
||||
{
|
||||
// Directed graph header
|
||||
out << "digraph core_AssemblyGraph {\n";
|
||||
out << "\n";
|
||||
|
||||
// Dump nodes with attributes
|
||||
const NCollection_IndexedMap<XCAFDoc_ObjectId>& nodes = this->GetNodes();
|
||||
//
|
||||
for ( int n = 1; n <= nodes.Extent(); ++n )
|
||||
{
|
||||
// Get name of persistent object
|
||||
TCollection_ExtendedString name;
|
||||
this->getObjectName(nodes(n), name);
|
||||
|
||||
// Generate label
|
||||
TCollection_AsciiString label(name);
|
||||
label += "\\n"; label += nodes(n);
|
||||
|
||||
// Dump node with label
|
||||
out << Whitespace << NodeLetter << n << " [label=\"" << label.ToCString() << "\"];\n";
|
||||
}
|
||||
out << "\n";
|
||||
|
||||
// Dump arcs
|
||||
for ( t_adjacency::Iterator it(m_arcs); it.More(); it.Next() )
|
||||
{
|
||||
const int parentId = it.Key();
|
||||
const TColStd_PackedMapOfInteger& children = it.Value();
|
||||
|
||||
// Loop over the children
|
||||
for ( TColStd_MapIteratorOfPackedMapOfInteger cit(children); cit.More(); cit.Next() )
|
||||
{
|
||||
const int childId = cit.Key();
|
||||
|
||||
out << Whitespace
|
||||
<< NodeLetter << parentId
|
||||
<< " -> "
|
||||
<< NodeLetter << childId
|
||||
<< ";\n";
|
||||
}
|
||||
}
|
||||
|
||||
out << "\n";
|
||||
out << "}\n";
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void XCAFDoc_AssemblyGraph::CalculateSummary(int& numRoots,
|
||||
int& numSubassemblies,
|
||||
int& numPartOccurrences,
|
||||
int& numParts) const
|
||||
{
|
||||
numRoots = 0;
|
||||
numSubassemblies = 0;
|
||||
numPartOccurrences = 0;
|
||||
numParts = 0;
|
||||
|
||||
// Loop over the nodes
|
||||
for ( int n = 1; n <= this->GetNodes().Extent(); ++n )
|
||||
{
|
||||
if ( !m_nodeTypes.IsBound(n) ) continue; // This should never happen
|
||||
|
||||
switch ( m_nodeTypes(n) )
|
||||
{
|
||||
case NodeType_Root: ++numRoots; break;
|
||||
case NodeType_Subassembly: ++numSubassemblies; break;
|
||||
case NodeType_PartOccurrence: ++numPartOccurrences; break;
|
||||
case NodeType_Part: ++numParts; break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void XCAFDoc_AssemblyGraph::buildGraph()
|
||||
{
|
||||
// Get shape tool
|
||||
Handle(XCAFDoc_ShapeTool)
|
||||
shapeTool = XCAFDoc_DocumentTool::ShapeTool( m_model->Main() );
|
||||
|
||||
// We start from those shapes which are "free" in terms of XDE
|
||||
TDF_LabelSequence roots;
|
||||
//
|
||||
shapeTool->GetFreeShapes(roots);
|
||||
//
|
||||
for ( TDF_LabelSequence::Iterator it(roots); it.More(); it.Next() )
|
||||
{
|
||||
const TDF_Label& label = it.Value();
|
||||
|
||||
// Get entry of the current label
|
||||
XCAFDoc_ObjectId objectId;
|
||||
TDF_Tool::Entry(label, objectId);
|
||||
|
||||
// Free shapes are root nodes of the assembly graph
|
||||
const int iObjectId = m_nodes.Add(objectId);
|
||||
|
||||
// Mark as root
|
||||
m_nodeTypes.Bind(iObjectId, NodeType_Root);
|
||||
//
|
||||
m_roots.Add(iObjectId);
|
||||
|
||||
// Add components (the objects nested into the current one)
|
||||
this->addComponents(label, iObjectId);
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void XCAFDoc_AssemblyGraph::addComponents(const TDF_Label& parent,
|
||||
const int iParentId)
|
||||
{
|
||||
// Get shape tool
|
||||
Handle(XCAFDoc_ShapeTool)
|
||||
shapeTool = XCAFDoc_DocumentTool::ShapeTool( m_model->Main() );
|
||||
|
||||
const bool isSubassembly = shapeTool->IsAssembly(parent);
|
||||
|
||||
// Bind topological type. We check that no attribute is associated to
|
||||
// prevent multiple tagging of the same node from different directions
|
||||
// of traversal.
|
||||
if ( !m_nodeTypes.IsBound(iParentId) )
|
||||
{
|
||||
if ( isSubassembly )
|
||||
m_nodeTypes.Bind(iParentId, NodeType_Subassembly);
|
||||
else
|
||||
{
|
||||
m_nodeTypes.Bind(iParentId, NodeType_PartOccurrence);
|
||||
|
||||
// If parts are requested to participate in the graph, we add more nodes
|
||||
if ( m_bWithParts )
|
||||
{
|
||||
// Get entry of the current label which is the original label
|
||||
XCAFDoc_ObjectId partId;
|
||||
TDF_Tool::Entry(parent, partId);
|
||||
|
||||
// Add node
|
||||
const int iPartId = m_nodes.Add(partId);
|
||||
|
||||
// Add arc
|
||||
if ( !m_arcs.IsBound(iParentId) )
|
||||
m_arcs.Bind( iParentId, TColStd_PackedMapOfInteger() );
|
||||
//
|
||||
m_arcs(iParentId).Add(iPartId);
|
||||
|
||||
// Bind type
|
||||
if ( !m_nodeTypes.IsBound(iPartId) )
|
||||
m_nodeTypes.Bind(iPartId, NodeType_Part);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( !isSubassembly )
|
||||
return; // We have to return here in order to prevent iterating by
|
||||
// sub-labels. For parts, sub-labels are used to encode
|
||||
// metadata which is out of interest in conceptual design
|
||||
// intent represented by assembly graph.
|
||||
|
||||
// Loop over the children (persistent representation of "part-of" relation)
|
||||
for ( TDF_ChildIterator cit(parent); cit.More(); cit.Next() )
|
||||
{
|
||||
TDF_Label child = cit.Value();
|
||||
|
||||
// Get entry of the current label
|
||||
XCAFDoc_ObjectId childId;
|
||||
TDF_Tool::Entry(child, childId);
|
||||
|
||||
// Add node
|
||||
const int iChildId = m_nodes.Add(childId);
|
||||
|
||||
// Add arc
|
||||
if ( !m_arcs.IsBound(iParentId) )
|
||||
m_arcs.Bind( iParentId, TColStd_PackedMapOfInteger() );
|
||||
//
|
||||
m_arcs(iParentId).Add(iChildId);
|
||||
|
||||
// Jump to the referred object (the original)
|
||||
TDF_Label childOriginal;
|
||||
Handle(TDataStd_TreeNode) jumpTreeNode;
|
||||
child.FindAttribute(XCAFDoc::ShapeRefGUID(), jumpTreeNode);
|
||||
//
|
||||
if ( !jumpTreeNode.IsNull() && jumpTreeNode->HasFather() )
|
||||
childOriginal = jumpTreeNode->Father()->Label(); // Declaration-level origin
|
||||
|
||||
// Process children: add components recursively
|
||||
if ( !childOriginal.IsNull() )
|
||||
this->addComponents(childOriginal, iChildId);
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
bool XCAFDoc_AssemblyGraph::getObjectName(const XCAFDoc_ObjectId& id,
|
||||
TCollection_ExtendedString& name) const
|
||||
{
|
||||
// Get label for object ID
|
||||
TDF_Label label;
|
||||
TDF_Tool::Label(m_model->GetData(), id, label);
|
||||
|
||||
// Access name
|
||||
Handle(TDataStd_Name) nameAttr;
|
||||
if ( !label.FindAttribute(TDataStd_Name::GetID(), nameAttr) )
|
||||
{
|
||||
name = "";
|
||||
return false;
|
||||
}
|
||||
//
|
||||
name = nameAttr->Get();
|
||||
return true;
|
||||
}
|
292
src/XCAFDoc/XCAFDoc_AssemblyGraph.hxx
Normal file
@@ -0,0 +1,292 @@
|
||||
// Created on: 2017-08-22
|
||||
// Created by: Sergey SLYADNEV
|
||||
// Copyright (c) 2017 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.
|
||||
|
||||
#ifndef _XCAFDoc_AssemblyGraph_HeaderFile
|
||||
#define _XCAFDoc_AssemblyGraph_HeaderFile
|
||||
|
||||
// XDE includes
|
||||
#include <XCAFDoc_ObjectId.hxx>
|
||||
|
||||
// Other OCCT includes
|
||||
#include <NCollection_DataMap.hxx>
|
||||
#include <TColStd_PackedMapOfInteger.hxx>
|
||||
#include <TDocStd_Document.hxx>
|
||||
|
||||
//! \brief Assembly graph.
|
||||
//!
|
||||
//! This tool gives clear OCAF-agnostic interface to
|
||||
//! the assembly structure of a product. A graph is essentially a set of
|
||||
//! nodes {N} and a set of arcs {A} as defined formally.
|
||||
//!
|
||||
//! <pre>
|
||||
//! G = <N, A>
|
||||
//! </pre>
|
||||
//!
|
||||
//! Using this tool, you can map XDE assembly items to a formal graph
|
||||
//! structure. Each node in the graph preserves a link to the data storage
|
||||
//! (OCAF document) by means of \ref XCAFDoc_ObjectId.
|
||||
//!
|
||||
//! \sa XCAFDoc_ObjectId
|
||||
class XCAFDoc_AssemblyGraph : public Standard_Transient
|
||||
{
|
||||
public:
|
||||
|
||||
//! \brief Type of the graph node.
|
||||
enum NodeType
|
||||
{
|
||||
NodeType_UNDEFINED = 0, //!< Undefined node type.
|
||||
//
|
||||
NodeType_Root, //!< Root node (has no entry arcs).
|
||||
NodeType_Subassembly, //!< Intermediate node (non-leaf node which has entry arcs).
|
||||
NodeType_PartOccurrence, //!< Part usage occurrence.
|
||||
NodeType_Part //!< Optional leaf node to represent parts. Note that
|
||||
//!< this node type is activated by a dedicated flag in
|
||||
//!< the constructor. If activated, the part occurrence nodes
|
||||
//!< are not leafs anymore.
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
// OCCT RTTI
|
||||
DEFINE_STANDARD_RTTI_INLINE(XCAFDoc_AssemblyGraph, Standard_Transient)
|
||||
|
||||
public:
|
||||
|
||||
//! \brief Graph iterator.
|
||||
class Iterator
|
||||
{
|
||||
public:
|
||||
|
||||
//! Default ctor.
|
||||
Iterator() : m_iCurrentIndex(0) {}
|
||||
|
||||
//! ctor accepting the assembly graph to iterate.
|
||||
//! \param[in] asmGraph assembly graph to iterate.
|
||||
Iterator(const Handle(XCAFDoc_AssemblyGraph)& asmGraph)
|
||||
{
|
||||
this->Init(asmGraph);
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
//! Initializes iterator with assembly graph.
|
||||
//! \param[in] asmGraph assembly graph to iterate.
|
||||
void Init(const Handle(XCAFDoc_AssemblyGraph)& asmGraph)
|
||||
{
|
||||
m_graph = asmGraph;
|
||||
m_iCurrentIndex = 1;
|
||||
}
|
||||
|
||||
//! Checks if there are more graph nodes to iterate.
|
||||
//! \return true/false.
|
||||
bool More() const
|
||||
{
|
||||
return m_iCurrentIndex <= m_graph->GetNodes().Extent();
|
||||
}
|
||||
|
||||
//! \return 1-based ID of the current node.
|
||||
int GetCurrentNode() const
|
||||
{
|
||||
return m_iCurrentIndex;
|
||||
}
|
||||
|
||||
//! Moves iterator to the next position.
|
||||
void Next()
|
||||
{
|
||||
++m_iCurrentIndex;
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
Handle(XCAFDoc_AssemblyGraph) m_graph; //!< Assembly graph to iterate.
|
||||
int m_iCurrentIndex; //!< Current 1-based node ID.
|
||||
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
//! Type definition for graph adjacency matrix. This is how parent-component
|
||||
//! links are realized in the assembly graph.
|
||||
typedef NCollection_DataMap<int, TColStd_PackedMapOfInteger> t_adjacency;
|
||||
|
||||
public:
|
||||
|
||||
//! \brief Initializes graph from Data Model.
|
||||
//!
|
||||
//! Construction of a formal graph will be done immediately at ctor.
|
||||
//!
|
||||
//! \param[in] M Data Model to iterate.
|
||||
//! \param[in] withParts indicates whether to add nodes representing the
|
||||
//! instanced parts to the assembly graph.
|
||||
Standard_EXPORT
|
||||
XCAFDoc_AssemblyGraph(const Handle(TDocStd_Document)& M,
|
||||
const bool withParts = false);
|
||||
|
||||
public:
|
||||
|
||||
//! \brief Dumps graph structure to output stream.
|
||||
//!
|
||||
//! The output format is DOT. You may use graph rendering tools like
|
||||
//! Graphviz to parse the output.
|
||||
//!
|
||||
//! \param[out] out output stream.
|
||||
Standard_EXPORT void
|
||||
Dump(Standard_OStream& out) const;
|
||||
|
||||
//! \brief Calculates short summary for the assembly.
|
||||
//!
|
||||
//! Short summary gives you the total number of nodes of a particular
|
||||
//! type. Note that the number of parts will be calculated only if parts
|
||||
//! are available in the graph (which is the option by construction).
|
||||
//!
|
||||
//! \param[out] numRoots number of root nodes.
|
||||
//! \param[out] numSubassemblies number of subassembly nodes.
|
||||
//! \param[out] numPartOccurrences number of part usage occurrence nodes.
|
||||
//! \param[out] numParts number of parts (if available).
|
||||
Standard_EXPORT void
|
||||
CalculateSummary(int& numRoots,
|
||||
int& numSubassemblies,
|
||||
int& numPartOccurrences,
|
||||
int& numParts) const;
|
||||
|
||||
public:
|
||||
|
||||
//! \brief Returns IDs of the root nodes.
|
||||
//! \return IDs of the root nodes.
|
||||
const TColStd_PackedMapOfInteger& GetRoots() const
|
||||
{
|
||||
return m_roots;
|
||||
}
|
||||
|
||||
//! \brief Checks whether the assembly graph contains (n1, n2) directed arc.
|
||||
//! \param[in] n1 one-based ID of the first node.
|
||||
//! \param[in] n2 one-based ID of the second node.
|
||||
//! \return true/false.
|
||||
bool HasArc(const int n1, const int n2) const
|
||||
{
|
||||
if ( !this->HasChildren(n1) )
|
||||
return false;
|
||||
|
||||
return this->GetChildren(n1).Contains(n2);
|
||||
}
|
||||
|
||||
//! \brief Checks whether children exist for the given node.
|
||||
//! \param[in] oneBasedNodeId one-based node ID.
|
||||
//! \return true/false.
|
||||
bool HasChildren(const int oneBasedNodeId) const
|
||||
{
|
||||
return m_arcs.IsBound(oneBasedNodeId);
|
||||
}
|
||||
|
||||
//! \brief Returns IDs of child nodes for the given node.
|
||||
//! \param[in] oneBasedNodeId one-based node ID.
|
||||
//! \return set of child IDs.
|
||||
const TColStd_PackedMapOfInteger& GetChildren(const int oneBasedNodeId) const
|
||||
{
|
||||
return m_arcs(oneBasedNodeId);
|
||||
}
|
||||
|
||||
//! \brief Returns the node type from \ref NodeType enum.
|
||||
//! \param[in] oneBasedNodeId one-based node ID.
|
||||
//! \return node type.
|
||||
//! \sa NodeType
|
||||
NodeType GetNodeType(const int oneBasedNodeId) const
|
||||
{
|
||||
if ( !m_nodeTypes.IsBound(oneBasedNodeId) )
|
||||
return NodeType_UNDEFINED;
|
||||
|
||||
return m_nodeTypes(oneBasedNodeId);
|
||||
}
|
||||
|
||||
//! \brief returns object ID by node ID.
|
||||
//! \param[in] oneBasedNodeId one-based node ID.
|
||||
//! \return persistent ID.
|
||||
const XCAFDoc_ObjectId& GetPersistentId(const int oneBasedNodeId) const
|
||||
{
|
||||
return m_nodes(oneBasedNodeId);
|
||||
}
|
||||
|
||||
//! \brief Returns the unordered set of graph nodes.
|
||||
//! \return graph nodes.
|
||||
const NCollection_IndexedMap<XCAFDoc_ObjectId>& GetNodes() const
|
||||
{
|
||||
return m_nodes;
|
||||
}
|
||||
|
||||
//! \brief Returns the number of graph nodes.
|
||||
//! \return number of graph nodes.
|
||||
int GetNumberOfNodes() const
|
||||
{
|
||||
return m_nodes.Extent();
|
||||
}
|
||||
|
||||
//! \brief Returns the collection of graph arcs in form of adjacency matrix.
|
||||
//! \return graph arcs.
|
||||
const t_adjacency& GetArcs() const
|
||||
{
|
||||
return m_arcs;
|
||||
}
|
||||
|
||||
//! \brief Returns the number of graph arcs.
|
||||
//! \return number of graph arcs.
|
||||
int GetNumberOfArcs() const
|
||||
{
|
||||
int numArcs = 0;
|
||||
//
|
||||
for ( t_adjacency::Iterator it(m_arcs); it.More(); it.Next() )
|
||||
numArcs += it.Value().Extent();
|
||||
|
||||
return numArcs;
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
//! Builds graph out of OCAF XDE structure.
|
||||
Standard_EXPORT void
|
||||
buildGraph();
|
||||
|
||||
//! Adds components for the given root to the graph structure.
|
||||
//! \param[in] parent OCAF label of the parent object.
|
||||
//! \param[in] iParentId ID of the already registered node
|
||||
//! representing the parent object in the assembly
|
||||
//! graph being populated.
|
||||
Standard_EXPORT void
|
||||
addComponents(const TDF_Label& parent,
|
||||
const int iParentId);
|
||||
|
||||
//! Returns object name for the given persistent ID.
|
||||
//! \param[in] id persistent ID.
|
||||
//! \param[out] name object name.
|
||||
//! \return false if no name is associated with the object or the object
|
||||
//! does not exist.
|
||||
Standard_EXPORT bool
|
||||
getObjectName(const XCAFDoc_ObjectId& id,
|
||||
TCollection_ExtendedString& name) const;
|
||||
|
||||
protected:
|
||||
|
||||
// INPUTS
|
||||
Handle(TDocStd_Document) m_model; //!< Data Model instance.
|
||||
bool m_bWithParts; //!< Indicates whether to include parts to the graph.
|
||||
|
||||
// OUTPUTS
|
||||
TColStd_PackedMapOfInteger m_roots; //!< IDs of the root nodes.
|
||||
NCollection_IndexedMap<XCAFDoc_ObjectId> m_nodes; //!< Graph nodes.
|
||||
t_adjacency m_arcs; //!< "Part-of" relations.
|
||||
NCollection_DataMap<int, NodeType> m_nodeTypes; //!< Node types (cached for efficiency).
|
||||
|
||||
};
|
||||
|
||||
#endif
|
@@ -1,5 +1,6 @@
|
||||
// Copyright (c) 1997-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
// Created on: 2017-08-22
|
||||
// Created by: Sergey SLYADNEV
|
||||
// Copyright (c) 2017 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
@@ -12,7 +13,13 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
inline Standard_Integer StdSelect_ViewerSelector3d::PixelTolerance() const
|
||||
{
|
||||
return myTolerances.Tolerance();
|
||||
}
|
||||
#ifndef _XCAFDoc_ObjectId_HeaderFile
|
||||
#define _XCAFDoc_ObjectId_HeaderFile
|
||||
|
||||
// OCCT includes
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
//! Persistent object ID.
|
||||
typedef TCollection_AsciiString XCAFDoc_ObjectId;
|
||||
|
||||
#endif
|
@@ -1,9 +1,13 @@
|
||||
XDEDRAW.cxx
|
||||
XDEDRAW.hxx
|
||||
XDEDRAW_Assemblies.hxx
|
||||
XDEDRAW_Assemblies.cxx
|
||||
XDEDRAW_Colors.cxx
|
||||
XDEDRAW_Colors.hxx
|
||||
XDEDRAW_Common.cxx
|
||||
XDEDRAW_Common.hxx
|
||||
XDEDRAW_DrawableAssemblyGraph.cxx
|
||||
XDEDRAW_DrawableAssemblyGraph.hxx
|
||||
XDEDRAW_Layers.cxx
|
||||
XDEDRAW_Layers.hxx
|
||||
XDEDRAW_Props.cxx
|
||||
|
@@ -80,6 +80,7 @@
|
||||
#include <XCAFPrs.hxx>
|
||||
#include <XCAFPrs_Driver.hxx>
|
||||
#include <XDEDRAW.hxx>
|
||||
#include <XDEDRAW_Assemblies.hxx>
|
||||
#include <XDEDRAW_Colors.hxx>
|
||||
#include <XDEDRAW_Common.hxx>
|
||||
#include <XDEDRAW_Layers.hxx>
|
||||
@@ -1165,6 +1166,7 @@ void XDEDRAW::Init(Draw_Interpretor& di)
|
||||
di.Add ("XTestDoc", "XTestDoc shape", __FILE__, testDoc, g);
|
||||
|
||||
// Specialized commands
|
||||
XDEDRAW_Assemblies::InitCommands ( di );
|
||||
XDEDRAW_Shapes::InitCommands ( di );
|
||||
XDEDRAW_Colors::InitCommands ( di );
|
||||
XDEDRAW_Layers::InitCommands ( di );
|
||||
|
308
src/XDEDRAW/XDEDRAW_Assemblies.cxx
Normal file
@@ -0,0 +1,308 @@
|
||||
// Created on: 2017-08-22
|
||||
// Created by: Sergey SLYADNEV
|
||||
// Copyright (c) 2017 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.
|
||||
|
||||
// Own include
|
||||
#include <XDEDRAW_Assemblies.hxx>
|
||||
|
||||
// Other OCCT includes
|
||||
#include <DDocStd.hxx>
|
||||
#include <Draw.hxx>
|
||||
#include <NCollection_Vector.hxx>
|
||||
#include <XDEDRAW_DrawableAssemblyGraph.hxx>
|
||||
|
||||
// Standard includes
|
||||
#include <vector>
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
std::vector< std::pair<TCollection_AsciiString, XCAFDoc_AssemblyGraph::NodeType> >
|
||||
XAssembly_NodeTypes = {
|
||||
{"-roots", XCAFDoc_AssemblyGraph::NodeType_Root},
|
||||
{"-subassemblies", XCAFDoc_AssemblyGraph::NodeType_Subassembly},
|
||||
{"-partoccurrences", XCAFDoc_AssemblyGraph::NodeType_PartOccurrence},
|
||||
{"-parts", XCAFDoc_AssemblyGraph::NodeType_Part}
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
//! Returns true if the passed command line option specifies node type.
|
||||
//! \param[in] opt option to check.
|
||||
//! \return true/false.
|
||||
bool XAssembly_IsKeywordNodeType(const TCollection_AsciiString& opt)
|
||||
{
|
||||
for ( size_t s = 0; s < XAssembly_NodeTypes.size(); ++s )
|
||||
if ( opt == XAssembly_NodeTypes[s].first )
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
//! Checks if the given graph node is of expected type.
|
||||
//! \param[in] what node to check.
|
||||
//! \param[in] opt expected type.
|
||||
//! \param[in] asmGraph assembly graph.
|
||||
//! \return true/false.
|
||||
bool XAssembly_IsOfExpectedType(const int n,
|
||||
const TCollection_AsciiString& opt,
|
||||
const Handle(XCAFDoc_AssemblyGraph)& asmGraph)
|
||||
{
|
||||
const XCAFDoc_AssemblyGraph::NodeType actualType = asmGraph->GetNodeType(n);
|
||||
|
||||
// Check against registered types
|
||||
TCollection_AsciiString expectedOpt;
|
||||
for ( size_t t = 0; t < XAssembly_NodeTypes.size(); ++t )
|
||||
{
|
||||
if ( actualType == XAssembly_NodeTypes[t].second )
|
||||
{
|
||||
expectedOpt = XAssembly_NodeTypes[t].first;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ( expectedOpt.IsEmpty() )
|
||||
return false;
|
||||
|
||||
return (expectedOpt == opt);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
//! Builds assembly graph for the given model.
|
||||
//! \param[in] di Draw interpreter instance.
|
||||
//! \param[in] argc number of arguments.
|
||||
//! \param[in] argv list of arguments.
|
||||
//! \return execution result.
|
||||
static int XAssemblyGraph(Draw_Interpretor& di, int argc, const char** argv)
|
||||
{
|
||||
// Preliminary checks
|
||||
if ( argc != 4 )
|
||||
{
|
||||
std::cout << "Incorrect number of arguments. Check help for details..." << std::endl;
|
||||
return 1; // Failure
|
||||
}
|
||||
|
||||
// Get document
|
||||
Handle(TDocStd_Document) doc;
|
||||
DDocStd::GetDocument(argv[1], doc);
|
||||
if ( doc.IsNull() )
|
||||
{
|
||||
di << argv[1] << " is not a document\n"; return 1;
|
||||
}
|
||||
|
||||
// Whether to include parts to assembly graph or not
|
||||
const bool withParts = ( atoi(argv[2]) > 0 );
|
||||
|
||||
// Construct assembly graph
|
||||
Handle(XCAFDoc_AssemblyGraph) asmGraph = new XCAFDoc_AssemblyGraph(doc, withParts);
|
||||
|
||||
// Register assembly graph in Draw
|
||||
Draw::Set( argv[3], new XDEDRAW_DrawableAssemblyGraph(asmGraph) );
|
||||
|
||||
return 0; // Success
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
//! Checks assembly graph.
|
||||
//! \param[in] di Draw interpreter instance.
|
||||
//! \param[in] argc number of arguments.
|
||||
//! \param[in] argv list of arguments.
|
||||
//! \return execution result.
|
||||
static int XAssemblyGraphCheck(Draw_Interpretor& di, int argc, const char** argv)
|
||||
{
|
||||
// Preliminary checks
|
||||
if ( argc < 3 )
|
||||
{
|
||||
std::cout << "Incorrect number of arguments. Check help for details..." << std::endl;
|
||||
return 1; // Failure
|
||||
}
|
||||
|
||||
// Get assembly graph
|
||||
Handle(XDEDRAW_DrawableAssemblyGraph)
|
||||
DAG = Handle(XDEDRAW_DrawableAssemblyGraph)::DownCast( Draw::Get(argv[1]) );
|
||||
//
|
||||
if ( DAG.IsNull() )
|
||||
{
|
||||
std::cout << "Error: Drawable Assembly Graph is NULL" << std::endl;
|
||||
return 1; // Failure
|
||||
}
|
||||
//
|
||||
Handle(XCAFDoc_AssemblyGraph) asmGraph = DAG->GetGraph();
|
||||
|
||||
// Get summary
|
||||
int numRoots = 0;
|
||||
int numSubassemblies = 0;
|
||||
int numPartInstances = 0;
|
||||
int numParts = 0;
|
||||
//
|
||||
asmGraph->CalculateSummary(numRoots, numSubassemblies, numPartInstances, numParts);
|
||||
|
||||
// Check according to the argument keys
|
||||
for ( int i = 2; i < argc; ++i )
|
||||
{
|
||||
TCollection_AsciiString opt(argv[i]);
|
||||
opt.LowerCase();
|
||||
|
||||
// Check the number of graph nodes
|
||||
if ( opt == "-numnodes" )
|
||||
{
|
||||
const int num = atoi( argv[++i] );
|
||||
//
|
||||
if ( num != asmGraph->GetNumberOfNodes() )
|
||||
{
|
||||
di << 0; // FALSE
|
||||
std::cout << "Error: unexpected number of nodes" << std::endl;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Check the number of graph arcs
|
||||
else if ( opt == "-numarcs" )
|
||||
{
|
||||
const int num = atoi( argv[++i] );
|
||||
//
|
||||
if ( num != asmGraph->GetNumberOfArcs() )
|
||||
{
|
||||
di << 0; // FALSE
|
||||
std::cout << "Error: unexpected number of arcs" << std::endl;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Check the number of roots
|
||||
else if ( opt == "-numroots" )
|
||||
{
|
||||
const int num = atoi( argv[++i] );
|
||||
//
|
||||
if ( num != numRoots )
|
||||
{
|
||||
di << 0; // FALSE
|
||||
std::cout << "Error: unexpected number of roots" << std::endl;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Check the number of subassemblies
|
||||
else if ( opt == "-numsubassemblies" )
|
||||
{
|
||||
const int num = atoi( argv[++i] );
|
||||
//
|
||||
if ( num != numSubassemblies )
|
||||
{
|
||||
di << 0; // FALSE
|
||||
std::cout << "Error: unexpected number of subassemblies" << std::endl;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Check the number of part occurrences
|
||||
else if ( opt == "-numpartoccurrences" )
|
||||
{
|
||||
const int num = atoi( argv[++i] );
|
||||
//
|
||||
if ( num != numPartInstances )
|
||||
{
|
||||
di << 0; // FALSE
|
||||
std::cout << "Error: unexpected number of part occurrences" << std::endl;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Check the number of parts
|
||||
else if ( opt == "-numparts" )
|
||||
{
|
||||
const int num = atoi( argv[++i] );
|
||||
//
|
||||
if ( num != numParts )
|
||||
{
|
||||
di << 0; // FALSE
|
||||
std::cout << "Error: unexpected number of parts" << std::endl;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Check individual arc
|
||||
else if ( opt == "-arc" )
|
||||
{
|
||||
const int n1 = atoi( argv[++i] );
|
||||
const int n2 = atoi( argv[++i] );
|
||||
//
|
||||
if ( !asmGraph->HasArc(n1, n2) )
|
||||
{
|
||||
di << 0; // FALSE
|
||||
std::cout << "Error: arc (" << n1 << ", " << n2 << ") does not exist" << std::endl;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Check individual node types
|
||||
else if ( XAssembly_IsKeywordNodeType(opt) )
|
||||
{
|
||||
do
|
||||
{
|
||||
// Get node index
|
||||
const int n = atoi( argv[++i] );
|
||||
|
||||
// Check type
|
||||
if ( !XAssembly_IsOfExpectedType(n, opt, asmGraph) )
|
||||
{
|
||||
di << 0; // FALSE
|
||||
std::cout << "Error: unexpected type for node " << n << std::endl;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
while ( i < (argc - 1) && !XAssembly_IsKeywordNodeType(argv[i + 1]) );
|
||||
}
|
||||
}
|
||||
di << 1; // TRUE
|
||||
|
||||
return 0; // Success
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : InitCommands
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void XDEDRAW_Assemblies::InitCommands(Draw_Interpretor& di)
|
||||
{
|
||||
static Standard_Boolean initactor = Standard_False;
|
||||
if (initactor)
|
||||
{
|
||||
return;
|
||||
}
|
||||
initactor = Standard_True;
|
||||
|
||||
Standard_CString grp = "XDE assembly commands";
|
||||
|
||||
di.Add("XAssemblyGraph", "XAssemblyGraph doc withParts graph",
|
||||
__FILE__, XAssemblyGraph, grp);
|
||||
|
||||
di.Add("XAssemblyGraphCheck", "XAssemblyGraphCheck [-numnodes num] "
|
||||
"[-numarcs num] "
|
||||
"[-numroots num] "
|
||||
"[-numsubassemblies num] "
|
||||
"[-numpartoccurrences num] "
|
||||
"[-numparts num] "
|
||||
"[-arc n1 n2] "
|
||||
"[-arc n2 n3] "
|
||||
" ... "
|
||||
"[-roots n1 n2 ...] "
|
||||
"[-subassemblies n3 n4 ...] "
|
||||
"[-partoccurrences n5 n6 ...] "
|
||||
"[-parts n7 n8 ...] ",
|
||||
__FILE__, XAssemblyGraphCheck, grp);
|
||||
}
|
32
src/XDEDRAW/XDEDRAW_Assemblies.hxx
Normal file
@@ -0,0 +1,32 @@
|
||||
// Created on: 2017-08-22
|
||||
// Created by: Sergey SLYADNEV
|
||||
// Copyright (c) 2017 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.
|
||||
|
||||
#ifndef _XDEDRAW_Assemblies_HeaderFile
|
||||
#define _XDEDRAW_Assemblies_HeaderFile
|
||||
|
||||
#include <Draw_Interpretor.hxx>
|
||||
|
||||
//! Draw commands for new XDE interface dedicated to assemblies.
|
||||
class XDEDRAW_Assemblies
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
Standard_EXPORT static void InitCommands(Draw_Interpretor& theCommands);
|
||||
|
||||
};
|
||||
|
||||
#endif // _XDEDRAW_Assemblies_HeaderFile
|
52
src/XDEDRAW/XDEDRAW_DrawableAssemblyGraph.cxx
Normal file
@@ -0,0 +1,52 @@
|
||||
// Created on: 2017-08-22
|
||||
// Created by: Sergey SLYADNEV
|
||||
// Copyright (c) 2017 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.
|
||||
|
||||
// Own include
|
||||
#include <XDEDRAW_DrawableAssemblyGraph.hxx>
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
XDEDRAW_DrawableAssemblyGraph::XDEDRAW_DrawableAssemblyGraph(const Handle(XCAFDoc_AssemblyGraph)& asmGraph)
|
||||
: Draw_Drawable3D (),
|
||||
m_graph (asmGraph)
|
||||
{}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
inline const Handle(XCAFDoc_AssemblyGraph)& XDEDRAW_DrawableAssemblyGraph::GetGraph() const
|
||||
{
|
||||
return m_graph;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void XDEDRAW_DrawableAssemblyGraph::DrawOn(Draw_Display&) const
|
||||
{
|
||||
this->Dump(std::cout);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void XDEDRAW_DrawableAssemblyGraph::Dump(Standard_OStream& out) const
|
||||
{
|
||||
m_graph->Dump(out);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void XDEDRAW_DrawableAssemblyGraph::Whatis(Draw_Interpretor& di) const
|
||||
{
|
||||
di << "Assembly graph";
|
||||
}
|
63
src/XDEDRAW/XDEDRAW_DrawableAssemblyGraph.hxx
Normal file
@@ -0,0 +1,63 @@
|
||||
// Created on: 2017-08-22
|
||||
// Created by: Sergey SLYADNEV
|
||||
// Copyright (c) 2017 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.
|
||||
|
||||
#ifndef _XDEDRAW_DrawableAssemblyGraph_HeaderFile
|
||||
#define _XDEDRAW_DrawableAssemblyGraph_HeaderFile
|
||||
|
||||
// XDE includes
|
||||
#include <XCAFDoc_AssemblyGraph.hxx>
|
||||
|
||||
// OCCT includes
|
||||
#include <Draw_Drawable3D.hxx>
|
||||
|
||||
//! Drawable container for assembly graph.
|
||||
class XDEDRAW_DrawableAssemblyGraph : public Draw_Drawable3D
|
||||
{
|
||||
public:
|
||||
|
||||
// OCCT RTTI
|
||||
DEFINE_STANDARD_RTTI_INLINE(XDEDRAW_DrawableAssemblyGraph, Draw_Drawable3D)
|
||||
|
||||
public:
|
||||
|
||||
//! Ctor accepting an assembly graph.
|
||||
//! \param[in] asmGraph assembly graph to have as drawable.
|
||||
Standard_EXPORT
|
||||
XDEDRAW_DrawableAssemblyGraph(const Handle(XCAFDoc_AssemblyGraph)& asmGraph);
|
||||
|
||||
public:
|
||||
|
||||
//! \return stored assembly graph.
|
||||
Standard_EXPORT const Handle(XCAFDoc_AssemblyGraph)&
|
||||
GetGraph() const;
|
||||
|
||||
public:
|
||||
|
||||
Standard_EXPORT void
|
||||
DrawOn(Draw_Display& dis) const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT virtual void
|
||||
Dump(Standard_OStream& out) const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT virtual void
|
||||
Whatis(Draw_Interpretor& di) const Standard_OVERRIDE;
|
||||
|
||||
private:
|
||||
|
||||
Handle(XCAFDoc_AssemblyGraph) m_graph; //!< Assembly graph to "draw".
|
||||
|
||||
};
|
||||
|
||||
#endif
|
@@ -97,7 +97,8 @@ TopoDS_Shape XSAlgo_AlgoContainer::ProcessShape (const TopoDS_Shape& shape,
|
||||
const Standard_CString prscfile,
|
||||
const Standard_CString pseq,
|
||||
Handle(Standard_Transient)& info,
|
||||
const Handle(Message_ProgressIndicator)& progress) const
|
||||
const Handle(Message_ProgressIndicator)& progress,
|
||||
const Standard_Boolean NonManifold) const
|
||||
{
|
||||
if ( shape.IsNull() ) return shape;
|
||||
|
||||
@@ -112,6 +113,7 @@ TopoDS_Shape XSAlgo_AlgoContainer::ProcessShape (const TopoDS_Shape& shape,
|
||||
if ( !progress.IsNull() )
|
||||
context->SetProgress(progress);
|
||||
}
|
||||
context->SetNonManifold(NonManifold);
|
||||
info = context;
|
||||
|
||||
Standard_CString seq = Interface_Static::CVal ( pseq );
|
||||
|
@@ -63,7 +63,11 @@ public:
|
||||
//! This information should be later transmitted to
|
||||
//! MergeTransferInfo in order to be recorded in the
|
||||
//! translation map
|
||||
Standard_EXPORT virtual TopoDS_Shape ProcessShape (const TopoDS_Shape& shape, const Standard_Real Prec, const Standard_Real MaxTol, const Standard_CString rscfile, const Standard_CString seq, Handle(Standard_Transient)& info, const Handle(Message_ProgressIndicator)& progress = 0) const;
|
||||
Standard_EXPORT virtual TopoDS_Shape ProcessShape (
|
||||
const TopoDS_Shape& shape, const Standard_Real Prec, const Standard_Real MaxTol,
|
||||
const Standard_CString rscfile, const Standard_CString seq, Handle(Standard_Transient)& info,
|
||||
const Handle(Message_ProgressIndicator)& progress = 0,
|
||||
const Standard_Boolean NonManifold = Standard_False) const;
|
||||
|
||||
//! Checks quality of pcurve of the edge on the given face,
|
||||
//! and corrects it if necessary.
|
||||
|