1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-08 14:17:06 +03:00

Compare commits

..

3 Commits

Author SHA1 Message Date
dpasukhi
4e10b8b8a3 // all remarks have been done 2021-10-27 22:56:42 +03:00
dpasukhi
66dcdab529 0026302: Data Exchange - new functionality XCAFDoc_Editor::Compact() converting the assembly to compound
Added XCAFDoc_Editor::Compact method to convert from assembly shape to compound
2021-10-27 15:21:59 +03:00
dpasukhi
97ec42b02a 0028104: Data Exchange - Extract sub-assembly (XDE)
- Added getting and setting Material, VisMaterial and Props to XCAFDoc_Editor::Expand.
- Added XCAFDoc_Editor::Extract to transfer part to a new location
  - XCAFDoc_Editor::Extract allows to extract a part as a component or simply extract to an empty label with attached colors, layers, materials, vismaterials and props
- Added XCAFDoc_Editor::CloneMetaData to clone shape's attributes to new location
- Added XCAFDoc_Editor::CloneShapeLabel to clone shape to new document
- Added XCAFDoc_DocumentTool::Check*Tool methods to check an existing of an any tool
- Protected against creating a new label for non-existent tools via extract or expand process
2021-10-27 09:29:10 +03:00
663 changed files with 2374 additions and 2544 deletions

View File

@@ -661,10 +661,8 @@ endif()
if (CAN_USE_GLES2)
if (USE_GLES2)
add_definitions (-DHAVE_GLES2_EXT)
if (NOT IOS)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/egl")
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/gles2")
endif()
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/egl")
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/gles2")
else()
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_EGL")
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_GLES2")

View File

@@ -236,11 +236,9 @@ proc gendoc {args} {
return -1
}
} elseif {$arg_n == "s"} {
if { [ lsearch $args_names "pdf" ] != -1 } {
puts "Warning: search is not used with PDF and will be ignored."
if { [ lsearch $args_names "pdf" ] == -1 } {
continue
}
if {$args_values(s) != "NULL"} {
set SEARCH_MODE $args_values(s)
} else {
@@ -249,16 +247,16 @@ proc gendoc {args} {
}
} elseif {$arg_n == "mathjax"} {
if { [ lsearch $args_names "pdf" ] != -1 } {
puts "Warning: MathJax is not used with PDF and will be ignored."
}
set possible_mathjax_loc $args_values(mathjax)
if {[file exist [file join $possible_mathjax_loc $mathjax_js_name]]} {
set MATHJAX_LOCATION $args_values(mathjax)
puts "$MATHJAX_LOCATION"
set possible_mathjax_loc $args_values(mathjax)
if {[file exist [file join $possible_mathjax_loc $mathjax_js_name]]} {
set MATHJAX_LOCATION $args_values(mathjax)
puts "$MATHJAX_LOCATION"
} else {
puts "Warning: $mathjax_js_name is not found in $possible_mathjax_loc."
puts " MathJax will be used from $MATHJAX_LOCATION"
}
} else {
puts "Warning: $mathjax_js_name is not found in $possible_mathjax_loc."
puts " MathJax will be used from $MATHJAX_LOCATION"
puts "Warning: MathJax is not used with pdf and will be ignored."
}
} else {
puts "\nWrong argument: $arg_n"

View File

@@ -12,9 +12,7 @@ samples/samples.md
../samples/CSharp/ReadMe.md
../samples/CSharp/ReadMe_D3D.md
../samples/qt/AndroidQt/ReadMe.md
../samples/qt/IESample/ReadMe.md
../samples/qt/OCCTOverview/ReadMe.md
../samples/qt/Tutorial/ReadMe.md
../samples/java/jniviewer/ReadMe.md
../samples/ios/UIKitSample/ReadMe.md
../samples/webgl/ReadMe.md
@@ -22,7 +20,6 @@ samples/ocaf.md
samples/ocaf_func.md
samples/draw_scripts.md
samples/novice_guide.md
tutorial/tutorial.md
build/build_upgrade.md

View File

@@ -6,8 +6,6 @@
tutorial/tutorial.md
samples/novice_guide.md
upgrade/upgrade.md
user_guides/foundation_classes/foundation_classes.md

View File

@@ -1,4 +1,4 @@
Draw: Demo Scripts {#samples__draw_scripts}
Draw Demo Scripts {#samples__draw_scripts}
================
All demo scripts are provided with OCCT sources and locate in <i>CASROOT/samples/tcl</i>. To play around them please

View File

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 48 KiB

View File

Before

Width:  |  Height:  |  Size: 110 KiB

After

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

View File

Before

Width:  |  Height:  |  Size: 74 KiB

After

Width:  |  Height:  |  Size: 74 KiB

View File

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 37 KiB

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 31 KiB

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

Before

Width:  |  Height:  |  Size: 63 KiB

After

Width:  |  Height:  |  Size: 63 KiB

View File

@@ -1,115 +0,0 @@
Novice Guide {#samples__novice_guide}
=======
@tableofcontents
@section diffs Modeling with OCCT: Key differences
Open CASCADE Technology (OCCT) is an object-oriented C++ framework designed for rapid production of sophisticated CAD/CAM/CAE applications.
In other words, it provides endless possibilities for raw 2D and 3D modeling in C++ environment.
Unlike end-user software, it is used by the application developers and therefore strongly differs from the most popular CAD/CAM/CAE software packages.
OCCT provides building blocks enough for modeling, editing, visualization, and data interoperability of 2D and 3D objects.
By using OCCT, users can create the objects of their desire (or edit already existing ones) using raw code commands.
It is a more complicated process than using GUI-based software, but it provides much more flexibility than even script-based manipulations that are available within existing CAD/CAM/CAE applications.
However, to fully grasp the possibilities of OCCT it is best for the user to have previous experience in C++ at least at a basic level.
@section basics Understanding the principles
If you don't have any programming skills, grasping the full magnitude of OCCT workflow is still an option.
The documentation for OCCT contains several entry points for new users.
It will not explain all OCCT classes but will help to comprehend the workflow and help start thinking in terms of Open CASCADE Technology.
The most basic workflow is described in the @ref occt__tutorial "OCCT Tutorial" - this is an excellent starting point for new users.
In this tutorial you will create a solid model step-by-step using different classes and methods.
Each step of the tutorial contains code snippets and images.
The basics involved in the modeling process are explained.
When the basics of OCCT are clear, the next logical step is to check out @ref samples "sample applications" and examine those that suit your needs.
For these, the best starting point is **OCCTOverview** located in /samples/qt subfolder of OCCT installation.
This sample provides code examples for several actions as well as visualization of these code snippets output.
The Overview interface is dynamically changing based on selected **Category** at the menu.
Additional menu buttons will appear, providing users with subcategories and relevant commands to select one of the actions.
The result will appear in the viewer window, the code will appear at the top right, and in several cases the output will be produced at the bottom right window.
@figure{sample_overview_qt_viewers.png,"Comparison of 3D and 2D viewer windows",240} height=420px
The 3D viewer window has a row of preset interface buttons to customize the visual output.
Those buttons can be grouped into three types, left to right:
- View controls: **Fit all** and **Isometric**, will center the view and reset the camera angles respectively;
- Display mode customization: **HLR,** e.g. "Hidden line removal" (works only when shading is disabled) can be turned on and off;
solid models may be displayed either in **Shading** or **Wireframe** modes. **Transparency** level may be set for models in shading mode;
- The last four buttons in a row are beautifiers enabling Ray-tracing engine and configuring it's parameters.
At the bottom left of the screen the orientation cube (trihedron) is located.
The trihedron interactively shows the position of the camera in relation to the XYZ axis of the displayed data.
The sides of the trihedron are labeled to help with orientation.
Click on a side of the box to orient the camera view along the preferred axis.
The 2D viewer window lacks most of these elements and only have **Fit all** button.
The **Geometry** category of the Overview focuses on primitive objects like dots, lines (including vectors) or planes.
These objects will appear in the viewer after the subcategory is selected.
This section will demonstrate these entities both in 2D and 3D view mode and provide basic examples of parametric creation and data analysis.
@figure{sample_overview_qt_geometry.png,"",240} height=440px
The usage of the functions shown in the Overview is described more thoroughly at the @ref occt_user_guides__modeling_data "Modeling data" section of the documentation.
Additionally, @ref occt_user_guides__modeling_algos "Modeling Algorithms" are used in more complex cases.
The **Topology** section of the Overview demonstrates the functions used in 3D operations.
Multiple use cases are provided, including different object intersections, modifying and calculations.
Some of these use cases are described in the documentation, such as @ref occt_user_guides__inspector "Inspector" usage.
@figure{sample_overview_qt_topology.png,"",240} height=440px
The subsections are grouped as shown on the screenshot before.
Most shapes and primitive objects are introduced and then followed by a set of operations and interactions.
The **Triangulation** segment allows computing the number of triangles on a shape.
This may be inspected via [Poly_Triangulation Class Reference](https://dev.opencascade.org/doc/refman/html/class_poly___triangulation.html) -
a part of the [Reference manual](https://dev.opencascade.org/doc/refman/html/index.html),
an overall Open CASCADE code guide that may be used to inspect the key points in classes and their connections.
@figure{sample_overview_qt_triangulation.png,"",240} height=440px
The triangulation uses some of Mesh-related classes - see full description at @ref occt_user_guides__mesh "Mesh" documentation section.
The **Data exchange** section provides examples of how to export and import files of several different formats.
@figure{sample_overview_qt_xde.png,"",240} height=440px
The **OCAF** section gives an introduction for the @ref intro_overview_ocaf "Open CASCADE Application Framework" functionality.
To test these functions, create an object first (box or cylinder).
After that, the object may be modified and saved. Actions are recorded and may be undone or redone.
@figure{sample_overview_qt_ocaf.png,"",240} height=440px
**Viewers** section demonstrates examples of the 2D and 3D visualization outputs.
Check @ref occt_user_guides__visualization "Visualization" section of the documentation for a detailed description.
In addition to these two samples, there are much more that might be of use to a new user based on their particular use case.
Check Readme files in the sample directories to learn more about samples compilation.
**Note:** source code for OCCTOverview is stored at 'samples/qt/OCCTOverview/src' folder in your OCCT root,
and the source code files for examples presented in subsections are stored at 'samples/OCCTOverview/code folder'.
Several utility classes that are not presented in the example window may be found in example source code files.
The overall classes introduction may be found in the @ref occt_user_guides__foundation_classes "Foundation Classes" section of the documentation.
The "Introduction" section contains short descriptions of the most massive entries in the documentation.
@section helps Additional assistance
There are several places that may be of use for new users.
The first one is [Training & E-learning](https://dev.opencascade.org/resources/trainings) page that lists available trainings and describes their specifics.
The second one is the Overview documentation (this document is a part of it) - here you can find information that suits most of the use cases.
This may seem overwhelming at first, but if you have the clear understanding of what do you seek, you will most likely find the required information.
Aside from the Overview documentation itself, the [Reference manual](https://dev.opencascade.org/doc/refman/html/index.html) is present.
Use it to check classes descriptions, dependencies and examples.
Additionally, there is a [Forum](https://dev.opencascade.org/forums) where you can contact the OCCT community and developers.

View File

@@ -1,4 +1,4 @@
OCAF: Usage Tutorial {#samples__ocaf}
OCAF Usage {#samples__ocaf}
========
## Getting Started

View File

@@ -1,4 +1,4 @@
OCAF: Function Mechanism {#samples__ocaf_func}
Function Mechanism Usage {#samples__ocaf_func}
========================
Let us describe the usage of the "Function Mechanism" of Open CASCADE Application Framework on a simple example.

View File

@@ -1,56 +1,176 @@
Tutorials and Samples {#samples}
=====================
- @subpage samples__tutorials
* @ref samples__novice_guide
<br>A document providing an introductory information to newcomers.
* @ref samples__draw_scripts
<br>A set of demo scripts demonstrating OCCT functionality from DRAW.
These scripts can be also considered as a tutorials on **Tcl** usage within @ref occt_user_guides__test_harness "Draw Harness".
* @ref occt__tutorial
<br>A programming tutorial teaching how to use OCCT services to model a 3D object.
See also @ref samples_qt_tutorial
* @ref samples__ocaf
<br>A set of code snippets performing typical actions with @ref occt_user_guides__ocaf "OCAF" services for newcomers.
* @ref samples__ocaf_func
<br>A simple example dedicated to the usage of "Function Mechanism" of @ref occt_user_guides__ocaf "OCCT Application Framework".
- @subpage samples__projects
* @ref samples_qt_iesample
<br>A cross-platform multi-document 3D Viewer sample with CAD import / export functionality based on **Qt Widgets** framework.
* @ref samples_qml_android_occt
<br>A cross-platform 3D Viewer sample with CAD import based on **QtQuick** framework.
* @ref samples_qt_tutorial
<br>A cross-platform sample application based on **Qt Widgets** framework and implementing @ref occt__tutorial.
* @ref samples_qt_overview
<br>A sample application interactively demonstrating OCCT C++ usage with code snippets for newcomers.
* @ref samples_mfc_standard
<br>A set of projects for Windows platform demonstrating OCCT usage based on **Microsoft Foundation Class** (**MFC**) library.
* @ref samples_csharp_occt
<br>A Multi-document 3D Viewer sample with CAD import / export functionality based on .NET and **Windows Forms** or **WPF**.
* @ref samples_csharp_direct3d
<br>3D Viewer sample wrapped into Direct3D context based on .NET and **Windows Presentation Foundation** (**WPF**).
* @ref occt_samples_webgl
<br>3D Viewer sample based on **Emscripten SDK** representing a static HTML page to be opened in Web Browser.
* @ref samples_java_android_occt
<br>3D Viewer sample with CAD import for Android mobile platform based on Android SDK and JNI layer.
* @ref occt_samples_ios_uikit
<br>3D Viewer sample for iOS platform based on Apple **UIKit** framework.
Tutorial: Modelling a Bottle
----------------------------
The Qt programming tutorial teaches how to use Open CASCADE Technology services to model a 3D object.
The purpose of the tutorial is not to explain all OCCT classes but
to help start thinking in terms of the Open CASCADE Technology.
@page samples__tutorials Tutorials and Demos
- @subpage samples__novice_guide
- @subpage samples__draw_scripts
- @subpage occt__tutorial
- @subpage samples__ocaf
- @subpage samples__ocaf_func
This tutorial assumes that the user has experience in using and setting up C++.
From the viewpoint of programming, Open CASCADE Technology is designed
to enhance user's C++ tools with high performance modeling classes, methods and functions.
The combination of these resources allows creating substantial applications.
@page samples__projects Sample Projects
- @subpage samples_qt_iesample
- @subpage samples_qml_android_occt
- @subpage samples_qt_tutorial
- @subpage samples_qt_overview
- @subpage samples_mfc_standard
- @subpage samples_csharp_occt
- @subpage samples_csharp_direct3d
- @subpage occt_samples_webgl
- @subpage samples_java_android_occt
- @subpage occt_samples_ios_uikit
Read more about @subpage occt__tutorial
MFC
---------
Visual C++ programming samples containing 10 Visual C++ projects
illustrating how to use a particular module or functionality.
The list of MFC samples:
* Geometry
* Modeling
* Viewer2d
* Viewer3d
* ImportExport
* Ocaf
* Triangulation
* HLR
* Animation
* Convert
@figure{/samples/images/samples_mvc.png}
**Remarks:**
* MFC samples are available only on Windows platform;
* To start a sample use Open CASCADE Technology\\Samples\\Mfc\\ item of the Start\\Programs menu;
* Read carefully readme.txt to learn about launching and compilation options.
See @subpage samples_mfc_standard "Readme" for details.
Qt
---
OCCT includes several samples based on Qt application framework.
These samples are available on all supported desktop platforms.
To start a sample on Windows use Open CASCADE Technology\\Samples\\Qt\\ item of the Start\\Programs menu.
Import Export
-------------
Import Export programming sample contains 3D Viewer and Import / Export functionality.
@figure{/samples/images/samples_qt.png}
Tutorial
---------
The Qt programming tutorial teaches how to use Open CASCADE Technology services to model a 3D object.
The purpose of the tutorial is not to explain all OCCT classes but
to help start thinking in terms of the Open CASCADE Technology.
This tutorial assumes that the user has experience in using and setting up C++.
From the viewpoint of programming, Open CASCADE Technology is designed
to enhance user's C++ tools with high performance modeling classes, methods and functions.
The combination of these resources allows creating substantial applications.
**See also:** @ref occt__tutorial "OCCT Tutorial"
Overview
---------
The Qt application providing samples for basic usage of C++ API of various OCCT functionality.
The samples are organized in several categories according to relevant module of OCCT:
* Geometry
* Topology,
* Triangulation
* DataExchange
* OCAF
* Viewer 2d
* Viewer 3d
Each sample presents geometry view, C++ code fragment and sample output window.
@figure{/samples/images/sample_overview_qt.png}
See \subpage samples_qt_overview "Readme" for details.
C#
---
C# sample demonstrates integration of OCCT 3D Viewer and Import / Export functionality into .NET applications (using Windows Forms and WPF front ends).
@figure{/samples/images/samples_c__ie.png}
Import:
* BRep
* Iges
* Step
Export:
* Brep
* Iges
* Step
* Stl
* Vrml
See @subpage samples_csharp_occt "C# sample Readme" for details.
There is also another C# example with the same functionality, which demonstrates the integration of Direct3D Viewer into .NET applications using WPF front end.
See @subpage samples_csharp_direct3d "Direct3D C# sample Readme" for details.
Android
---------
There are two samples are representing usage OCCT framework on Android mobile platform. They represent an OCCT-based 3D-viewer with CAD import support in formats BREP, STEP and IGES: jniviewer (java) and AndroidQt (qt+qml)
jniviewer
@figure{/samples/images/samples_java_android_occt.jpg}
Java -- See @subpage samples_java_android_occt "Android Java sample Readme" for details.
AndroidQt
@figure{/samples/images/samples_qml_android_occt.jpg}
Qt -- See \subpage samples_qml_android_occt "Android Qt sample Readme" for details.
iOS
---
There is a sample demonstrating usage of OCCT on iOS with Apple UIKit framework.
@figure{/samples/images/sample_ios_uikit.png}
See @subpage occt_samples_ios_uikit "iOS sample Readme" for details.
Web
---------
WebGL Viewer sample demonstrating usage of OCCT 3D Viewer in Web browser with Emscripten SDK can be found in `samples/webgl`.
@figure{/samples/images/sample_webgl.png}
See @subpage occt_samples_webgl "WebGL sample Readme" for details.
OCAF Usage Sample
------------------
The provided set of samples dedicates to get initial knowledge about typical actions with OCAF services. It may be
useful for newcomers.
Read more about @subpage samples__ocaf
OCAF Function Mechanism Usage
-----------------------------
This simple example dedicates to the usage of "Function Mechanism" of OCCT Application Framework. It represents a "nail"
composed by a cone and two cylinders of different radius and height.
Read more about @subpage samples__ocaf_func
Draw Demo Scripts
------------------
A set of demo scripts demonsrates using OCCT functionality from DRAW. These scripts can be also considered as a
tutorials on tcl usage within Draw.
Read more about @subpage samples__draw_scripts

View File

@@ -1,4 +1,4 @@
Modeling: Bottle Tutorial {#occt__tutorial}
Tutorial {#occt__tutorial}
=======
@tableofcontents

View File

@@ -1,9 +1,8 @@
.NET: Import/Export (C#|C++/CLI|WinForms|WPF) {#samples_csharp_occt}
OCCT CSharp sample {#samples_csharp_occt}
==================
This sample demonstrates how to use OCCT libraries in <b>.Net</b> application
written using **CSharp** and **Windows Forms** or **Windows Presentation Foundation** (WPF).
The sample could be found within OCCT repository in folder `/samples/CSharp/`.
The connection between .Net and OCCT (C++) level is provided by proxy library
**OCCProxy**, written in C++/CLI. The proxy library contains a single *ref* class
@@ -15,8 +14,6 @@ Both applications provide the same functionality as the standard OCCT Import/Exp
The first project is called *IE_WinForms* and uses Windows Forms for GUI.
The second application is called *IE_WPF_WinForms* and uses Windows Presentation Foundation.
@figure{samples_c__ie.png}
Note a few important details:
- OCCT template class *NCollection_Haft* is used to encapsulate C++ class into a field of *ref* class;

View File

@@ -1,9 +1,8 @@
.NET: D3D/OpenGL Viewer (C#|C++/CLI|WPF) {#samples_csharp_direct3d}
==================
Direct3D CSharp sample {#samples_csharp_direct3d}
==================
This sample demonstrates how to use OCCT and DirectX libraries in <b>.Net</b> application
written using **CSharp** and **Windows Presentation Foundation** (WPF).
The sample could be found within OCCT repository in folder `/samples/CSharp/`.
The connection between .Net, OCCT (C++) and DirectX level is provided by proxy libraries,
**OCCProxy** and **D3DProxy**, written in C++/CLI. The proxy library **OCCProxy** contains a single

View File

@@ -311,7 +311,7 @@ void OcafSamples::ModifyBoxOcafSample()
Handle(TFunction_Function) aFunction;
if (!aLabel.FindAttribute(TFunction_Function::GetID(), aFunction))
{
myResult << "Object cannot be modified.";
myResult << "Object cannot be modify.";
return;
}
// Get the Standard_GUID of the TFunction_FunctionDriver of the selected object TFunction_Function attribute
@@ -413,7 +413,7 @@ void OcafSamples::ModifyCylinderOcafSample()
Handle(TFunction_Function) aFunction;
if (!aLabel.FindAttribute(TFunction_Function::GetID(), aFunction))
{
myResult << "Object cannot be modified.";
myResult << "Object cannot be modify.";
return;
}
// Get the Standard_GUID of the TFunction_FunctionDriver of the selected object TFunction_Function attribute

View File

@@ -1,15 +1,12 @@
iOS: 3D Viewer (Objective-C++|UIKit) {#occt_samples_ios_uikit}
OCCT sample for iOS {#occt_samples_ios_uikit}
==================
UIKitSample consists of the Open CASCADE 3D Viewer which provides import of STEP files and toolbar with three buttons.
The sample could be found within OCCT repository in folder `/samples/ios/UIKitSample/`.
The first and second buttons serve for import hardcoded STEP files. The third button displays "About" dialog.
The viewer supports zoom, pan and rotate actions. The viewer supports selection of solids as well.
@figure{sample_ios_uikit.png}
Installation and configuration:
1. Make sure you are running Mac OS version 10.12.1 or above and properly installed XCode version 8.1 or above.
2. Install Open CASCADE Technology (OCCT) and build static libraries for desired device or/and simulator on your workstation.

View File

@@ -1,8 +1,7 @@
Android: 3D Viewer (Java|C++|Android SDK|JNI) {#samples_java_android_occt}
OCCT JniViewer sample for Android {#samples_java_android_occt}
==================
This sample demonstrates simple way of using OCCT libraries in Android application written using Java.
The sample could be found within OCCT repository in folder `/samples/java/jniviewer/`.
The connection between Java and OCCT (C++) level is provided by proxy library, libTKJniSample.so, written in C++ with exported JNI methods of Java class OcctJniRenderer.
The proxy library contains single C++ class OcctJni_Viewer encapsulating OCCT viewer and providing functionality to manipulate this viewer
@@ -14,8 +13,6 @@ and the code can be programmed on Java level similarly to C++ one.
See description of OCCT Java Wrapper in Advanced Samples and Tools on OCCT web site at
https://www.opencascade.com/content/advanced-samples-and-tools
@figure{samples_java_android_occt.jpg}
Install Android Studio 4.0+ and install building tools (check Tools -> SDK Manager):
- Android SDK (API level 21 or higher).
- Android SDK build tools.

View File

@@ -27,7 +27,7 @@ CSelectionDialog::CSelectionDialog (CHLRDoc* aDoc,CWnd* pParent /*=NULL*/)
myDoc = aDoc;
myIsDisplayed = false;
//{{AFX_DATA_INIT(CSelectionDialog)
m_Algo = 1;
m_Algo = 0;
m_DisplayMode = 0;
m_NbIsos = 2;
m_DrawHiddenLine = TRUE;

View File

@@ -1,21 +1,6 @@
MFC: OCCT Samples (C++|MFC) {#samples_mfc_standard}
MFC samples {#samples_mfc_standard}
==========
Visual C++ programming samples for Windows platform containing illustrating how to use a particular module or functionality, including the following MFC samples:
* Geometry
* Modeling
* Viewer2d
* Viewer3d
* ImportExport
* Ocaf
* Triangulation
* HLR
* Animation
* Convert
@figure{samples_mvc.png}
1. Contents
-----------------------

View File

@@ -1,15 +1,12 @@
Qt: 3D Viewer (C++|QtQuick|QML) {#samples_qml_android_occt}
OCCT AndroidQt sample for Android {#samples_qml_android_occt}
==================
This sample demonstrates a simple way of using OCCT libraries in Android application written using Qt/Qml.
The sample could be found within OCCT repository in folder `/samples/qt/AndroidQt/`.
The connection between Qt/Qml and OCCT (C++) level is provided by proxy library, libAndroidQt.so, written in C++.
The proxy library contains single C++ class AndroidQt encapsulating OCCT viewer and providing functionality to manipulate this viewer
and to import OCCT shapes from supported format of CAD file (BREP).
@figure{samples_qml_android_occt.jpg}
Requirements for building sample:
* Java Development Kit 1.7 or higher
* Qt 5.3 or higher

View File

@@ -1,10 +0,0 @@
Qt: Import/Export (C++|Qt Widgets) {#samples_qt_iesample}
==========
OCCT includes several samples based on Qt application framework.
These samples are available on all supported desktop platforms.
This Import Export programming sample contains 3D Viewer and Import / Export functionality.
The sample could be found within OCCT repository in folder `/samples/qt/IESample/`.
@figure{samples_qt.png}

View File

@@ -1,22 +1,6 @@
Qt: OCCT Overview (C++|Qt Widgets) {#samples_qt_overview}
Qt OCCT Overview samples {#samples_qt_overview}
==========
The Overview Qt application provides code snippets for basic usage of C++ API of various OCCT functionality.
The samples are organized in several categories according to relevant module of OCCT:
* Geometry
* Topology
* Triangulation
* DataExchange
* OCAF
* Viewer 2d
* Viewer 3d
Each sample presents geometry view, C++ code fragment and sample output window.
This sample is described in the @ref samples__novice_guide "Novice guide" for new users.
@figure{sample_overview_qt.png}
1. Contents
-----------------------

View File

@@ -1,11 +0,0 @@
Qt: Bottle Tutorial (C++|Qt Widgets) {#samples_qt_tutorial}
==========
The Qt programming tutorial teaches how to use Open CASCADE Technology services to model a 3D object.
The purpose of the tutorial is not to explain all OCCT classes but to help start thinking in terms of the Open CASCADE Technology.
This tutorial assumes that the user has experience in using and setting up C++.
From the viewpoint of programming, Open CASCADE Technology is designed to enhance user's C++ tools with high performance modeling classes, methods and functions.
The combination of these resources allows creating substantial applications.
**See also:** @ref occt__tutorial "OCCT Tutorial"

View File

@@ -1,4 +1,4 @@
WebGL: 3D Viewer (JavaScript|C++|WebAssembly) {#occt_samples_webgl}
OCCT WebGL Viewer sample {#occt_samples_webgl}
==================
This sample demonstrates simple way of using OCCT libraries in Web application written in C++ and translated into WebAssembly module using Emscripten SDK (emsdk):
@@ -6,9 +6,6 @@ https://emscripten.org/
Sample consists of the Open CASCADE 3D Viewer with a button for opening a model in BREP format.
The sample requires a WebGL 2.0 capable browser supporting WebAssembly 1.0 (Wasm).
The sample could be found within OCCT repository in folder `/samples/webgl/`.
@figure{sample_webgl.png,"",240} height=408px
Installation and configuration:
1. Install Emscripten SDK and activate minimal configuration (Python, Java and CLang) following *emsdk* documentation. Activate also MinGW when building sample on Windows host.

View File

@@ -17,8 +17,8 @@
| de l'approximation a deux variables
| a utiliser dans AdvApp2Var
|--------------------------------------------------------------*/
#ifndef AdvApp2Var_ApproxF2var_HeaderFile
#define AdvApp2Var_ApproxF2var_HeaderFile
#ifndef ApproxF2var_HeaderFile
#define ApproxF2var_HeaderFile
#include <Standard_Macro.hxx>
#include <AdvApp2Var_Data_f2c.hxx>

View File

@@ -12,8 +12,8 @@
// commercial license or contractual agreement.
// AdvApp2Var_Data_f2c.hxx
#ifndef AdvApp2Var_Data_f2c_HeaderFile
#define AdvApp2Var_Data_f2c_HeaderFile
#ifndef Data_f2c_HeaderFile
#define Data_f2c_HeaderFile
#ifndef F2CTYPE_DEFINED
typedef int integer;

View File

@@ -12,8 +12,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef AppCont_ContMatrices_HeaderFile
#define AppCont_ContMatrices_HeaderFile
#ifndef math_ContMatrices_HeaderFile
#define math_ContMatrices_HeaderFile
#include <math_Vector.hxx>
#include <Standard_Real.hxx>

View File

@@ -11,8 +11,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef Aspect_DisplayConnection_HeaderFile
#define Aspect_DisplayConnection_HeaderFile
#ifndef _Aspect_DisplayConnection_H__
#define _Aspect_DisplayConnection_H__
#include <Standard_Transient.hxx>
#include <Aspect_XAtom.hxx>

View File

@@ -13,8 +13,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef Aspect_PolygonOffsetMode_HeaderFile
#define Aspect_PolygonOffsetMode_HeaderFile
#ifndef ASPECT_POLYGONOFFSETMODE_HEADER
#define ASPECT_POLYGONOFFSETMODE_HEADER
// Enumeration for polygon offset modes

View File

@@ -12,8 +12,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef BOPDS_VectorOfPoint_HeaderFile
#define BOPDS_VectorOfPoint_HeaderFile
#ifndef BOPDS_VectorOfPnt_HeaderFile
#define BOPDS_VectorOfPnt_HeaderFile
#include <NCollection_Vector.hxx>
#include <BOPDS_Point.hxx>

View File

@@ -12,8 +12,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef BOPTools_MapOfSet_HeaderFile
#define BOPTools_MapOfSet_HeaderFile
#ifndef BOPTest_MapOfShapeSet_HeaderFile
#define BOPTest_MapOfShapeSet_HeaderFile
#include <BOPTools_Set.hxx>
#include <BOPTools_SetMapHasher.hxx>

View File

@@ -355,10 +355,6 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
#endif
Approx_CurveOnSurface appr(HPCur, hsur, Udeb, Ufin, myTol3d);
appr.Perform(myMaxSeg, myMaxDegree, myContinuity, Only3d, Only2d);
if (appr.MaxError3d() > 1.e3 * myTol3d)
continue;
#ifdef OCCT_DEBUG_CHRONO
ResultChron(chr_approx,t_approx);
approx_count++;

View File

@@ -13,8 +13,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef BRepBuilderAPI_BndBoxTreeSelector_HeaderFile
#define BRepBuilderAPI_BndBoxTreeSelector_HeaderFile
#ifndef _BRepBuilderAPI_BndBoxTreeSelector_Header
#define _BRepBuilderAPI_BndBoxTreeSelector_Header
#include <TColStd_ListOfInteger.hxx>
#include <Bnd_Box.hxx>

View File

@@ -13,8 +13,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef BRepBuilderAPI_VertexInspector_HeaderFile
#define BRepBuilderAPI_VertexInspector_HeaderFile
#ifndef _BRepBuilderAPI_VertexInspector_Header
#define _BRepBuilderAPI_VertexInspector_Header
#include <TColStd_ListOfInteger.hxx>
#include <NCollection_Vector.hxx>

View File

@@ -890,11 +890,6 @@ Standard_Boolean BRepFill_TrimShellCorner::ChooseSection(const TopoDS_Shape& Com
if (LastEdge.IsNull())
return Standard_False;
if (FirstEdge.IsNull() || LastEdge.IsNull())
{
return Standard_False;
}
BB.Add(NewWire, FirstEdge);
if (!FirstEdge.IsSame(LastEdge))

View File

@@ -2423,7 +2423,7 @@ Standard_Boolean BRepLib::
gp_Vec3f aNorm1f, aNorm2f;
aPT1->Normal (aFNodF1, aNorm1f);
aPT2->Normal (aFNodF2, aNorm2f);
aPT1->Normal (aFNodF2, aNorm2f);
const gp_XYZ aNorm1 (aNorm1f.x(), aNorm1f.y(), aNorm1f.z());
const gp_XYZ aNorm2 (aNorm2f.x(), aNorm2f.y(), aNorm2f.z());
const Standard_Real aDot = aNorm1 * aNorm2;

View File

@@ -13,8 +13,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef BRepMesh_CircleInspector_HeaderFile
#define BRepMesh_CircleInspector_HeaderFile
#ifndef BRepMesh_CircleInspector_Header
#define BRepMesh_CircleInspector_Header
#include <IMeshData_Types.hxx>
#include <BRepMesh_Circle.hxx>

View File

@@ -52,7 +52,6 @@
#include <BOPAlgo_PaveFiller.hxx>
#include <BOPAlgo_Section.hxx>
#include <BOPAlgo_Splitter.hxx>
#include <BOPAlgo_BOP.hxx>
#include <TopTools_ListOfShape.hxx>
#include <TopTools_DataMapOfShapeShape.hxx>
@@ -108,19 +107,6 @@ namespace {
{
BRep_Builder().Add (theSOut, theS);
}
static void AddToContainer (const TopoDS_Shape& theKey,
const TopoDS_Shape& theValue,
TopTools_DataMapOfShapeListOfShape& theMap)
{
if (TopTools_ListOfShape* pList = theMap.ChangeSeek (theKey))
{
pList->Append (theValue);
}
else
{
theMap.Bound (theKey, TopTools_ListOfShape())->Append (theValue);
}
}
//=======================================================================
//function : TakeModified
@@ -631,9 +617,7 @@ private: //! @name Intersection and post-treatment of edges
//! Filtering the invalid edges according to currently invalid faces
void FilterInvalidEdges (const BRepOffset_DataMapOfShapeIndexedMapOfShape& theDMFMIE,
const TopTools_IndexedMapOfShape& theMERemoved,
const TopTools_IndexedMapOfShape& theMEInside,
TopTools_MapOfShape& theMEUseInRebuild);
const TopTools_IndexedMapOfShape& theMERemoved);
private: //! @name Checking faces
@@ -782,7 +766,6 @@ private: //! @name Checking faces
const TopTools_MapOfShape& theVertsToAvoid,
const TopTools_MapOfShape& theNewVertsToAvoid,
const TopTools_MapOfShape& theMECheckExt,
const TopTools_DataMapOfShapeListOfShape* theSSInterfs,
TopTools_MapOfShape& theMVBounds,
TopTools_DataMapOfShapeListOfShape& theEImages);
@@ -894,18 +877,16 @@ private:
TopTools_IndexedMapOfShape myEdgesToAvoid; //!< Splits of edges to be avoided when building splits of faces
TopTools_MapOfShape myLastInvEdges; //!< Edges marked invalid on the current step and to be avoided on the next step
TopTools_MapOfShape myModifiedEdges; //!< Edges to be used for building splits
TopTools_IndexedMapOfShape myInsideEdges; //!< Edges located fully inside solids built from the splits of offset faces
TopTools_IndexedDataMapOfShapeListOfShape myInvalidFaces; //!< Invalid faces - splits of offset faces consisting of invalid edges
BRepOffset_DataMapOfShapeIndexedMapOfShape myArtInvalidFaces; //!< Artificially invalid faces - valid faces intentionally marked invalid
//! to be rebuilt on the future steps in the situations when invalid edges
//! are present, but invalid faces not
TopTools_DataMapOfShapeShape myArtInvalidFaces; //!< Artificially invalid faces - valid faces intentionally marked invalid
//! to be rebuilt on the future steps in the situations when invalid edges
//! are present, but invalid faces not
TopTools_DataMapOfShapeInteger myAlreadyInvFaces; //!< Count number of the same face being marked invalid to avoid infinite
//! rebuilding of the same face
TopTools_DataMapOfShapeListOfShape myFNewHoles; //!< Images of the hole faces of the original face
TopTools_DataMapOfShapeListOfShape mySSInterfs; //!< Intersection information, used to collect intersection pairs during rebuild
TopTools_DataMapOfShapeListOfShape mySSInterfsArt; //!< Intersection information, used to collect intersection pairs during rebuild
NCollection_DataMap <TopoDS_Shape,
BRepOffset_DataMapOfShapeMapOfShape,
TopTools_ShapeMapHasher> myIntersectionPairs; //!< All possible intersection pairs, used to avoid some of the intersections
@@ -1023,7 +1004,6 @@ void BRepOffset_BuildOffsetFaces::BuildSplitsOfExtendedFaces (const Message_Prog
myInvalidEdges.Clear();
myInvertedEdges.Clear();
mySSInterfs.Clear();
mySSInterfsArt.Clear();
myIntersectionPairs.Clear();
mySolids.Nullify();
myFacesToRebuild.Clear();
@@ -1319,8 +1299,9 @@ void BRepOffset_BuildOffsetFaces::BuildSplitsOfFaces (const Message_ProgressRang
//
if (bArtificialCase)
{
// make the face invalid
TopTools_IndexedMapOfShape aMEInv;
// make the face invalid
myArtInvalidFaces.Bind (aF, aCE);
//
*pLFIm = aLFImages;
TopTools_ListIteratorOfListOfShape aItLFIm (aLFImages);
@@ -1343,7 +1324,6 @@ void BRepOffset_BuildOffsetFaces::BuildSplitsOfFaces (const Message_ProgressRang
}
}
//
myArtInvalidFaces.Bind (aF, aMEInv);
aDMFMIE.Bind (aF, aMEInv);
aLFDone.Append (aF);
//
@@ -1539,8 +1519,9 @@ void BRepOffset_BuildOffsetFaces::BuildSplitsOfFaces (const Message_ProgressRang
RemoveInvalidSplitsFromValid (aDMFMVIE);
//
// remove inside faces
TopTools_IndexedMapOfShape aMEInside;
RemoveInsideFaces (anInvertedFaces, aMFToCheckInt, aMFInvInHole, aFHoles,
aMERemoved, myInsideEdges, aPSOuter.Next (5.));
aMERemoved, aMEInside, aPSOuter.Next (5.));
//
// make compound of valid splits
TopoDS_Compound aCFIm;
@@ -1565,7 +1546,7 @@ void BRepOffset_BuildOffsetFaces::BuildSplitsOfFaces (const Message_ProgressRang
FilterEdgesImages (aCFIm);
//
// filter invalid faces
FilterInvalidFaces (aDMEF, aMERemoved.Extent() ? myInsideEdges : aMERemoved);
FilterInvalidFaces (aDMEF, aMEInside);
aNb = myInvalidFaces.Extent();
if (!aNb)
{
@@ -1591,10 +1572,7 @@ void BRepOffset_BuildOffsetFaces::BuildSplitsOfFaces (const Message_ProgressRang
#endif
//
// filter invalid edges
TopTools_MapOfShape aMEUseInRebuild;
FilterInvalidEdges (aDMFMIE, aMERemoved,
aMERemoved.Extent() ? myInsideEdges : aMERemoved,
aMEUseInRebuild);
FilterInvalidEdges (aDMFMIE, aMERemoved);
//
// Check additionally validity of edges originated from vertices.
CheckEdgesCreatedByVertex();
@@ -1616,11 +1594,8 @@ void BRepOffset_BuildOffsetFaces::BuildSplitsOfFaces (const Message_ProgressRang
for (i = 1; i <= aNb; ++i)
{
const TopoDS_Shape& aE = myInvalidEdges (i);
myEdgesToAvoid.Add (aE);
myLastInvEdges.Add (aE);
if (!aMEUseInRebuild.Contains(aE))
{
myEdgesToAvoid.Add (aE);
}
}
//
aNb = myInvalidFaces.Extent();
@@ -1818,10 +1793,11 @@ Standard_Boolean BRepOffset_BuildOffsetFaces::CheckIfArtificial (const TopoDS_Sh
{
const TopoDS_Edge& aE = TopoDS::Edge (aItLE.Value());
//
if (const TopTools_ListOfShape* pLEIm = myOEImages.Seek (aE))
if (myOEImages.IsBound (aE))
{
Standard_Boolean bChecked = Standard_False;
TopTools_ListIteratorOfListOfShape aItLEIm (*pLEIm);
const TopTools_ListOfShape& aLEIm = myOEImages.Find (aE);
TopTools_ListIteratorOfListOfShape aItLEIm (aLEIm);
for (; aItLEIm.More(); aItLEIm.Next())
{
const TopoDS_Edge& aEIm = TopoDS::Edge (aItLEIm.Value());
@@ -4189,7 +4165,6 @@ void BRepOffset_BuildOffsetFaces::RemoveInsideFaces (const TopTools_ListOfShape&
RemoveInvalidSplits (aMFToRem, aMV, theMERemoved);
//
// Get inside faces from the removed ones comparing them with boundary edges
theMEInside.Clear();
aNb = theMERemoved.Extent();
for (i = 1; i <= aNb; ++i)
{
@@ -4214,28 +4189,6 @@ void BRepOffset_BuildOffsetFaces::RemoveInsideFaces (const TopTools_ListOfShape&
void BRepOffset_BuildOffsetFaces::ShapesConnections (const TopTools_DataMapOfShapeShape& theDMFOr,
BOPAlgo_Builder& theBuilder)
{
// Make connexity blocks from invalid edges to use the whole block
// to which the edge is connected instead of the single edge.
TopoDS_Compound aCEInv;
BRep_Builder().MakeCompound(aCEInv);
for (Standard_Integer i = 1; i <= myInvalidEdges.Extent(); ++i)
{
AddToContainer (myInvalidEdges(i), aCEInv);
}
TopTools_ListOfShape aLCB;
BOPTools_AlgoTools::MakeConnexityBlocks (aCEInv, TopAbs_VERTEX, TopAbs_EDGE, aLCB);
// Binding from the edge to the block
TopTools_DataMapOfShapeShape aECBMap;
for (TopTools_ListOfShape::Iterator itCB(aLCB); itCB.More(); itCB.Next())
{
for (TopoDS_Iterator itE(itCB.Value()); itE.More(); itE.Next())
{
aECBMap.Bind(itE.Value(), itCB.Value());
}
}
// update invalid edges with images and keep connection to original edge
TopTools_DataMapOfShapeListOfShape aDMEOr;
Standard_Integer aNb = myInvalidEdges.Extent();
@@ -4253,7 +4206,13 @@ void BRepOffset_BuildOffsetFaces::ShapesConnections (const TopTools_DataMapOfSha
for (; aItLEIm.More(); aItLEIm.Next())
{
const TopoDS_Shape& aEIm = aItLEIm.Value();
AddToContainer (aEIm, aEInv, aDMEOr);
//
TopTools_ListOfShape* pLEOr = aDMEOr.ChangeSeek (aEIm);
if (!pLEOr)
{
pLEOr = aDMEOr.Bound (aEIm, TopTools_ListOfShape());
}
AppendToList (*pLEOr, aEInv);
}
}
//
@@ -4406,121 +4365,6 @@ void BRepOffset_BuildOffsetFaces::ShapesConnections (const TopTools_DataMapOfSha
AppendToList (*pLF, aFOp);
}
}
// Treatment for the artificial case - check if one of the faces is artificially invalid
for (Standard_Integer iF = 0; iF < 2; ++iF)
{
const TopoDS_Shape& aFArt = !iF ? *pF1 : *pF2;
const TopoDS_Shape& aFOpposite = !iF ? *pF2 : *pF1;
if (!myArtInvalidFaces.IsBound (aFArt))
continue;
if (myInvalidFaces.Contains (aFOpposite) && !myArtInvalidFaces.IsBound (aFOpposite))
continue;
// Collect own invalid edges of the face and the invalid edges connected to those
// own invalid edges to be avoided in the check for intersection.
TopTools_IndexedMapOfShape aMEAvoid;
if (const TopTools_IndexedMapOfShape* pFEInv = myArtInvalidFaces.Seek (aFOpposite))
{
for (Standard_Integer iE = 1; iE <= pFEInv->Extent(); ++iE)
{
if (const TopoDS_Shape* pCB = aECBMap.Seek (pFEInv->FindKey(iE)))
{
TopExp::MapShapes (*pCB, TopAbs_EDGE, aMEAvoid);
}
}
}
else if (const TopTools_ListOfShape* pLFIm = myOFImages.Seek (aFOpposite))
{
for (TopTools_ListOfShape::Iterator itLFIm (*pLFIm); itLFIm.More(); itLFIm.Next())
{
for (TopExp_Explorer expE (itLFIm.Value(), TopAbs_EDGE); expE.More(); expE.Next())
{
if (const TopoDS_Shape* pCB = aECBMap.Seek (expE.Current()))
{
TopExp::MapShapes (*pCB, TopAbs_EDGE, aMEAvoid);
}
}
}
}
const TopoDS_Shape& aFArtIm = !iF ? aFIm1 : aFIm2;
const TopoDS_Shape& aFOppositeIm = !iF ? aFIm2 : aFIm1;
// Check if there are any intersections between edges of artificially
// invalid face and opposite face
const Standard_Integer nFOp = pDS->Index (aFOppositeIm);
for (TopExp_Explorer expE (aFArtIm, TopAbs_EDGE); expE.More(); expE.Next())
{
const TopoDS_Shape& aE = expE.Current();
if (!myInvalidEdges.Contains (aE) || myInvertedEdges.Contains (aE) || aMEAvoid.Contains (aE))
{
continue;
}
const Standard_Integer nE = pDS->Index (aE);
if (nE < 0)
{
continue;
}
if (!pDS->HasInterf(nE, nFOp))
{
continue;
}
TopTools_ListOfShape aLV;
const BOPDS_VectorOfInterfEF& aEFs = pDS->InterfEF();
for (Standard_Integer iEF = 0; iEF < aEFs.Size(); ++iEF)
{
const BOPDS_InterfEF& aEF = aEFs (iEF);
if (aEF.Contains (nE) && aEF.Contains(nFOp))
{
if (aEF.CommonPart().Type() == TopAbs_VERTEX)
aLV.Append (pDS->Shape (aEF.IndexNew()));
}
}
if (aLV.IsEmpty())
{
continue;
}
// Make sure that there is an opposite intersection exists, i.e. some of the edges
// of the opposite face intersect the artificially invalid face.
const Standard_Integer nFArt = pDS->Index (aFArtIm);
TopExp_Explorer expEOp (aFOppositeIm, TopAbs_EDGE);
for (; expEOp.More(); expEOp.Next())
{
const TopoDS_Shape& aEOp = expEOp.Current();
const Standard_Integer nEOp = pDS->Index (aEOp);
if (pDS->HasInterf(nEOp, nFArt))
{
break;
}
}
if (!expEOp.More())
{
continue;
}
// Intersection is present - add connection between offset faces.
AddToContainer (aFArt, aFOpposite, mySSInterfsArt);
// Add connection between edge and opposite face
AddToContainer (aE, aFOpposite, mySSInterfsArt);
// Along with the opposite face, save the intersection vertices to
// be used for trimming the intersection edge in the rebuilding process
for (TopTools_ListOfShape::Iterator itLV (aLV); itLV.More(); itLV.Next())
{
// Add connection to intersection vertex
AddToContainer (aE, itLV.Value(), mySSInterfsArt);
}
}
}
}
}
@@ -5116,9 +4960,7 @@ void BRepOffset_BuildOffsetFaces::CheckEdgesCreatedByVertex()
//purpose : Filtering the invalid edges according to currently invalid faces
//=======================================================================
void BRepOffset_BuildOffsetFaces::FilterInvalidEdges (const BRepOffset_DataMapOfShapeIndexedMapOfShape& theDMFMIE,
const TopTools_IndexedMapOfShape& theMERemoved,
const TopTools_IndexedMapOfShape& theMEInside,
TopTools_MapOfShape& theMEUseInRebuild)
const TopTools_IndexedMapOfShape& theMERemoved)
{
TopoDS_Compound aCEInv;
TopTools_IndexedMapOfShape aMEInv;
@@ -5181,16 +5023,14 @@ void BRepOffset_BuildOffsetFaces::FilterInvalidEdges (const BRepOffset_DataMapOf
const TopoDS_Shape& aF = myInvalidFaces.FindKey (i);
if (myArtInvalidFaces.IsBound (aF))
{
if (const TopTools_IndexedMapOfShape* aMIE = theDMFMIE.Seek (aF))
const TopTools_IndexedMapOfShape& aMIE = theDMFMIE.Find (aF);
const Standard_Integer aNbIE = aMIE.Extent();
for (Standard_Integer iE = 1; iE <= aNbIE; ++iE)
{
const Standard_Integer aNbIE = aMIE->Extent();
for (Standard_Integer iE = 1; iE <= aNbIE; ++iE)
const TopoDS_Shape& aE = aMIE (iE);
if (aMEInv.Contains (aE) && !aMEInvToAvoid.Contains (aE))
{
const TopoDS_Shape& aE = aMIE->FindKey (iE);
if (aMEInv.Contains (aE) && !aMEInvToAvoid.Contains (aE))
{
aReallyInvEdges.Add (aE);
}
aReallyInvEdges.Add (aE);
}
}
}
@@ -5213,46 +5053,8 @@ void BRepOffset_BuildOffsetFaces::FilterInvalidEdges (const BRepOffset_DataMapOf
}
}
}
//
myInvalidEdges = aReallyInvEdges;
// Check if any of the currently invalid edges may be used for
// rebuilding splits of invalid faces.
// For that the edge should be inside and not connected to invalid
// boundary edges of the same origin.
aNb = myInvalidEdges.Extent();
for (i = 1; i <= aNb; ++i)
{
const TopoDS_Shape& aE = myInvalidEdges (i);
if (!theMEInside.Contains (aE) || !myValidEdges.Contains (aE))
{
continue;
}
const TopTools_ListOfShape* pEOrigins = myOEOrigins.Seek (aE);
if (!pEOrigins)
{
theMEUseInRebuild.Add (aE);
continue;
}
Standard_Boolean bHasInvOutside = Standard_False;
for (TopTools_ListOfShape::Iterator itEOr (*pEOrigins); !bHasInvOutside && itEOr.More(); itEOr.Next())
{
if (const TopTools_ListOfShape* pEIms = myOEImages.Seek (itEOr.Value()))
{
for (TopTools_ListOfShape::Iterator itEIms (*pEIms); !bHasInvOutside && itEIms.More(); itEIms.Next())
{
bHasInvOutside = myInvalidEdges.Contains (itEIms.Value()) && !theMEInside.Contains (itEIms.Value());
}
}
}
if (!bHasInvOutside)
{
theMEUseInRebuild.Add (aE);
}
}
}
//=======================================================================
@@ -5314,7 +5116,7 @@ void BRepOffset_BuildOffsetFaces::FindFacesToRebuild()
aDMFLV.Bind (aF, aLVAvoid);
}
//
const TopTools_ListOfShape* pLF = !myArtInvalidFaces.IsBound(aF) ? mySSInterfs.Seek (aF) : mySSInterfsArt.Seek(aF);
const TopTools_ListOfShape* pLF = mySSInterfs.Seek (aF);
if (pLF)
{
TopTools_ListIteratorOfListOfShape aItLFE (*pLF);
@@ -5473,7 +5275,7 @@ void BRepOffset_BuildOffsetFaces::IntersectFaces (TopTools_MapOfShape& theVertsT
TopTools_DataMapOfShapeShape aDMFImF;
TopoDS_Compound aCFArt;
BRep_Builder().MakeCompound (aCFArt);
BRepOffset_DataMapOfShapeIndexedMapOfShape::Iterator aItM (myArtInvalidFaces);
TopTools_DataMapIteratorOfDataMapOfShapeShape aItM (myArtInvalidFaces);
for (; aItM.More(); aItM.Next())
{
const TopoDS_Shape& aF = aItM.Key();
@@ -5795,13 +5597,9 @@ void BRepOffset_BuildOffsetFaces::IntersectFaces (TopTools_MapOfShape& theVertsT
continue;
}
//
const TopTools_ListOfShape* aLFImi = myOFImages.Seek (aFi);
if (!aLFImi)
continue;
const TopTools_ListOfShape& aLFImi = myOFImages.FindFromKey (aFi);
//
TopTools_ListOfShape* aLFEi = aFLE.ChangeSeek (aFi);
if (!aLFEi)
continue;
TopTools_ListOfShape& aLFEi = aFLE.ChangeFromKey (aFi);
//
TopTools_ListOfShape& aLFDone = aMDone.ChangeFind (aFi);
//
@@ -5820,42 +5618,20 @@ void BRepOffset_BuildOffsetFaces::IntersectFaces (TopTools_MapOfShape& theVertsT
if (pInterFi && !pInterFi->Contains (aFj))
continue;
const TopTools_ListOfShape* aLFImj = myOFImages.Seek(aFj);
if (!aLFImj)
continue;
const TopTools_ListOfShape& aLFImj = myOFImages.FindFromKey (aFj);
//
TopTools_ListOfShape* aLFEj = aFLE.ChangeSeek (aFj);
if (!aLFEj)
continue;
TopTools_ListOfShape& aLFEj = aFLE.ChangeFromKey (aFj);
//
// if there are some common edges between faces
// we should use these edges and do not intersect again.
TopTools_ListOfShape aLEC;
FindCommonParts (*aLFImi, *aLFImj, aLEC);
FindCommonParts (aLFImi, aLFImj, aLEC);
//
if (aLEC.Extent())
{
// no need to intersect if we have common edges between faces
Standard_Boolean bForceUse = aMFIntExt.Contains (aFi) || aMFIntExt.Contains (aFj);
ProcessCommonEdges (aLEC, aME, aMEInfETrim, aMAllInvs, bForceUse, aMECV, aMECheckExt, aDMEETrim, *aLFEi, *aLFEj, aMEToInt);
// Add common vertices not belonging to the common edges for trimming the intersection edges
TopTools_IndexedMapOfShape aMVOnCE;
for (TopTools_ListOfShape::Iterator itE (aLEC); itE.More(); itE.Next())
{
TopExp::MapShapes (itE.Value(), TopAbs_VERTEX, aMVOnCE);
}
TopTools_ListOfShape aLEV;
FindCommonParts (*aLFImi, *aLFImj, aLEV, TopAbs_VERTEX);
for (TopTools_ListOfShape::Iterator itV (aLEV); itV.More(); itV.Next())
{
if (!aMVOnCE.Contains (itV.Value()))
{
aMECV.Add (itV.Value());
}
}
ProcessCommonEdges (aLEC, aME, aMEInfETrim, aMAllInvs, bForceUse, aMECV, aMECheckExt, aDMEETrim, aLFEi, aLFEj, aMEToInt);
continue;
}
//
@@ -5881,7 +5657,7 @@ void BRepOffset_BuildOffsetFaces::IntersectFaces (TopTools_MapOfShape& theVertsT
{
// use intersection line obtained on the previous steps
// plus, find new origins for these lines
UpdateIntersectedFaces (aFInv, aFi, aFj, aLFInv, *aLFImi, *aLFImj, *aLFEi, *aLFEj, aMEToInt);
UpdateIntersectedFaces (aFInv, aFi, aFj, aLFInv, aLFImi, aLFImj, aLFEi, aLFEj, aMEToInt);
continue;
}
//
@@ -5893,14 +5669,13 @@ void BRepOffset_BuildOffsetFaces::IntersectFaces (TopTools_MapOfShape& theVertsT
aLFDone.Append (aFj);
aMDone.ChangeFind (aFj).Append (aFi);
//
IntersectFaces (aFInv, aFi, aFj, aLFInv, *aLFImi, *aLFImj, *aLFEi, *aLFEj, aMECV, aMEToInt);
IntersectFaces (aFInv, aFi, aFj, aLFInv, aLFImi, aLFImj, aLFEi, aLFEj, aMECV, aMEToInt);
}
}
//
// intersect and trim edges for this chain
IntersectAndTrimEdges (aMFInt, aMEToInt, aDMEETrim, aME, aMECV,
aMVInv, aMVRInv, aMECheckExt, bArtificial ? &mySSInterfsArt : 0,
aMVBounds, aEImages);
aMVInv, aMVRInv, aMECheckExt, aMVBounds, aEImages);
//
Standard_Integer iE, aNbEToInt = aMEToInt.Extent();
for (iE = 1; iE <= aNbEToInt; ++iE)
@@ -6181,8 +5956,12 @@ void BRepOffset_BuildOffsetFaces::FindFacesForIntersection (const TopoDS_Shape&
}
}
//
const TopTools_DataMapOfShapeListOfShape& aSSInterfsMap = theArtCase ? mySSInterfsArt : mySSInterfs;
const TopTools_ListOfShape* pLFInv = aSSInterfsMap.Seek (theFInv);
if (theArtCase)
{
return;
}
//
const TopTools_ListOfShape* pLFInv = mySSInterfs.Seek (theFInv);
if (!pLFInv)
{
return;
@@ -6206,7 +5985,7 @@ void BRepOffset_BuildOffsetFaces::FindFacesForIntersection (const TopoDS_Shape&
for (i = 1; i <= aNbE; ++i)
{
const TopoDS_Shape& aS = theME (i);
const TopTools_ListOfShape* pLF = aSSInterfsMap.Seek (aS);
const TopTools_ListOfShape* pLF = mySSInterfs.Seek (aS);
if (!pLF)
{
continue;
@@ -6223,33 +6002,30 @@ void BRepOffset_BuildOffsetFaces::FindFacesForIntersection (const TopoDS_Shape&
//
// check if the face has some connection to already added for intersection faces
const TopTools_ListOfShape& aLFIm = myOFImages.FindFromKey (aF);
if (!theArtCase)
TopTools_ListIteratorOfListOfShape aItLFIm (aLFIm);
for (; aItLFIm.More(); aItLFIm.Next())
{
TopTools_ListIteratorOfListOfShape aItLFIm (aLFIm);
for (; aItLFIm.More(); aItLFIm.Next())
const TopoDS_Shape& aFIm = aItLFIm.Value();
TopExp_Explorer aExp (aFIm, TopAbs_EDGE);
for (; aExp.More(); aExp.Next())
{
const TopoDS_Shape& aFIm = aItLFIm.Value();
TopExp_Explorer aExp (aFIm, TopAbs_EDGE);
for (; aExp.More(); aExp.Next())
{
if (aMShapes.Contains (aExp.Current()))
{
break;
}
}
if (aExp.More())
if (aMShapes.Contains (aExp.Current()))
{
break;
}
}
if (!aItLFIm.More())
if (aExp.More())
{
continue;
break;
}
}
if (!aItLFIm.More())
{
continue;
}
//
aMFToAdd.Add (aF);
TopTools_ListIteratorOfListOfShape aItLFIm (aLFIm);
aItLFIm.Initialize (aLFIm);
for (; aItLFIm.More(); aItLFIm.Next())
{
const TopoDS_Shape& aFIm = aItLFIm.Value();
@@ -6647,7 +6423,6 @@ void BRepOffset_BuildOffsetFaces::IntersectAndTrimEdges (const TopTools_IndexedM
const TopTools_MapOfShape& theVertsToAvoid,
const TopTools_MapOfShape& theNewVertsToAvoid,
const TopTools_MapOfShape& theMECheckExt,
const TopTools_DataMapOfShapeListOfShape* theSSInterfs,
TopTools_MapOfShape& theMVBounds,
TopTools_DataMapOfShapeListOfShape& theEImages)
{
@@ -6693,39 +6468,30 @@ void BRepOffset_BuildOffsetFaces::IntersectAndTrimEdges (const TopTools_IndexedM
aNb = theMSInv.Extent();
for (i = 1; i <= aNb; ++i)
{
const TopoDS_Shape& aS = theMSInv(i);
// edge case
if (theSSInterfs)
const TopoDS_Shape& aV = theMSInv (i);
if (aV.ShapeType() != TopAbs_VERTEX)
{
if (const TopTools_ListOfShape* pLV = theSSInterfs->Seek (aS))
{
// Add vertices from intersection info to trim section edges of artificial faces
for (TopTools_ListOfShape::Iterator itLV (*pLV); itLV.More(); itLV.Next())
{
if (itLV.Value().ShapeType() == TopAbs_VERTEX)
{
aLArgs.Append (itLV.Value());
}
}
}
continue;
}
// vertex case
if (const TopTools_ListOfShape* pLVE = aDMVE.ChangeSeek(aS))
//
TopTools_ListOfShape* pLVE = aDMVE.ChangeSeek (aV);
if (!pLVE)
{
aIt.Initialize(*pLVE);
for (; aIt.More(); aIt.Next())
continue;
}
//
aIt.Initialize (*pLVE);
for (; aIt.More(); aIt.Next())
{
const TopoDS_Shape& aE = aIt.Value();
//
aExp.Init (aE, TopAbs_VERTEX);
for (; aExp.More(); aExp.Next())
{
const TopoDS_Shape& aE = aIt.Value();
//
aExp.Init(aE, TopAbs_VERTEX);
for (; aExp.More(); aExp.Next())
const TopoDS_Shape& aV1 = aExp.Current();
if (!theVertsToAvoid.Contains (aV1) && aMFence.Add (aV1))
{
const TopoDS_Shape& aV1 = aExp.Current();
if (!theVertsToAvoid.Contains(aV1) && aMFence.Add(aV1))
{
aLArgs.Append(aV1);
}
aLArgs.Append (aV1);
}
}
}
@@ -7371,19 +7137,9 @@ void BRepOffset_BuildOffsetFaces::UpdateValidEdges (const TopTools_IndexedDataMa
TopExp::MapShapes (aItSpIm.Value(), TopAbs_EDGE, aNewEdges);
}
}
TopoDS_Compound anInsideEdges;
BRep_Builder().MakeCompound (anInsideEdges);
for (Standard_Integer iE = 1; iE <= myInsideEdges.Extent(); ++iE)
{
BRep_Builder().Add (anInsideEdges, myInsideEdges (iE));
}
//
// Rebuild the map of edges to avoid, using the intersection results
TopTools_IndexedMapOfShape aMEAvoid;
TopoDS_Compound aCEAvoid;
BRep_Builder().MakeCompound (aCEAvoid);
// GF's data structure
const BOPDS_PDS& pDS = aGF.PDS();
@@ -7419,7 +7175,7 @@ void BRepOffset_BuildOffsetFaces::UpdateValidEdges (const TopTools_IndexedDataMa
if (bKeep)
{
// keep the original edge
AddToContainer (aE, aMEAvoid);
aMEAvoid.Add (aE);
continue;
}
@@ -7428,41 +7184,9 @@ void BRepOffset_BuildOffsetFaces::UpdateValidEdges (const TopTools_IndexedDataMa
{
const TopoDS_Shape& aEIm = aItLEIm.Value();
if (!aNewEdges.Contains (aEIm))
{
AddToContainer(aEIm, aCEAvoid);
}
aMEAvoid.Add (aEIm);
}
}
Standard_Boolean isCut = Standard_False;
if (aCEAvoid.NbChildren() > 0)
{
// Perform intersection with the small subset of the edges to make
// it possible to use the inside edges for building new splits.
BOPAlgo_BOP aBOP;
aBOP.AddArgument (aCEAvoid);
aBOP.AddTool (anInsideEdges);
aBOP.SetOperation (BOPAlgo_CUT);
aBOP.Perform();
isCut = !aBOP.HasErrors();
if (isCut)
{
for (TopoDS_Iterator itCE (aCEAvoid); itCE.More(); itCE.Next())
{
if (!aBOP.IsDeleted (itCE.Value()))
{
aMEAvoid.Add (itCE.Value());
}
}
}
}
if (!isCut)
{
TopExp::MapShapes (aCEAvoid, TopAbs_EDGE, aMEAvoid);
}
myEdgesToAvoid = aMEAvoid;
}

View File

@@ -504,9 +504,10 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewCurve2d
}
aMinDist *= aMinDist;
//Old domain
gp_Pnt2d aPf = C2d->Value(f2d);
Standard_Real t = 0.5 * (f2d + l2d);
gp_Pnt2d aPf = C2d->Value(t);
//New domain
gp_Pnt2d aNewPf = Curve2d->Value(f2d);
gp_Pnt2d aNewPf = Curve2d->Value(t);
gp_Vec2d aT(aNewPf, aPf);
if (aT.SquareMagnitude() > aMinDist)
{

View File

@@ -13,8 +13,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef BVH_BinnedBuilder_HeaderFile
#define BVH_BinnedBuilder_HeaderFile
#ifndef _BVH_BinnedBuilder_Header
#define _BVH_BinnedBuilder_Header
#include <BVH_QueueBuilder.hxx>

View File

@@ -13,8 +13,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef BVH_Box_HeaderFile
#define BVH_Box_HeaderFile
#ifndef _BVH_Box_Header
#define _BVH_Box_Header
#include <BVH_Constants.hxx>
#include <BVH_Types.hxx>

View File

@@ -13,8 +13,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef BVH_Builder_HeaderFile
#define BVH_Builder_HeaderFile
#ifndef _BVH_Builder_Header
#define _BVH_Builder_Header
#include <BVH_Set.hxx>
#include <BVH_BinaryTree.hxx>

View File

@@ -13,8 +13,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef BVH_Geometry_HeaderFile
#define BVH_Geometry_HeaderFile
#ifndef _BVH_Geometry_Header
#define _BVH_Geometry_Header
#include <BVH_ObjectSet.hxx>
#include <BVH_Builder.hxx>

View File

@@ -13,8 +13,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef BVH_Object_HeaderFile
#define BVH_Object_HeaderFile
#ifndef _BVH_Object_Header
#define _BVH_Object_Header
#include <BVH_Box.hxx>
#include <BVH_Properties.hxx>

View File

@@ -13,8 +13,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef BVH_ObjectSet_HeaderFile
#define BVH_ObjectSet_HeaderFile
#ifndef _BVH_ObjectSet_Header
#define _BVH_ObjectSet_Header
#include <BVH_Set.hxx>
#include <BVH_Object.hxx>

View File

@@ -13,8 +13,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef BVH_PrimitiveSet_HeaderFile
#define BVH_PrimitiveSet_HeaderFile
#ifndef _BVH_PrimitiveSet_Header
#define _BVH_PrimitiveSet_Header
#include <BVH_Object.hxx>
#include <BVH_Builder.hxx>

View File

@@ -13,8 +13,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef BVH_Properties_HeaderFile
#define BVH_Properties_HeaderFile
#ifndef _BVH_Properties_Header
#define _BVH_Properties_Header
#include <BVH_Box.hxx>

View File

@@ -13,8 +13,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef BVH_Set_HeaderFile
#define BVH_Set_HeaderFile
#ifndef _BVH_Set_Header
#define _BVH_Set_Header
#include <BVH_Box.hxx>

View File

@@ -13,8 +13,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef BVH_Sorter_HeaderFile
#define BVH_Sorter_HeaderFile
#ifndef _BVH_Sorter_Header
#define _BVH_Sorter_Header
#include <BVH_Set.hxx>

View File

@@ -13,8 +13,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef BVH_SpatialMedianBuilder_HeaderFile
#define BVH_SpatialMedianBuilder_HeaderFile
#ifndef _BVH_SpatialMedianBuilder_Header
#define _BVH_SpatialMedianBuilder_Header
#include <BVH_BinnedBuilder.hxx>
#include <BVH_Box.hxx>

View File

@@ -13,8 +13,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef BVH_SweepPlaneBuilder_HeaderFile
#define BVH_SweepPlaneBuilder_HeaderFile
#ifndef _BVH_SweepPlaneBuilder_Header
#define _BVH_SweepPlaneBuilder_Header
#include <BVH_QueueBuilder.hxx>
#include <BVH_QuickSorter.hxx>

View File

@@ -13,8 +13,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef BVH_Triangulation_HeaderFile
#define BVH_Triangulation_HeaderFile
#ifndef _BVH_Triangulation_Header
#define _BVH_Triangulation_Header
#include <BVH_PrimitiveSet.hxx>

View File

@@ -13,8 +13,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef BVH_Types_HeaderFile
#define BVH_Types_HeaderFile
#ifndef _BVH_Types_Header
#define _BVH_Types_Header
// Use this macro to switch between STL and OCCT vector types
#define _BVH_USE_STD_VECTOR_

View File

@@ -13,8 +13,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef BinLDrivers_VectorOfDocumentSection_HeaderFile
#define BinLDrivers_VectorOfDocumentSection_HeaderFile
#ifndef BinLDrivers_VectorOfDocumentSection_H
#define BinLDrivers_VectorOfDocumentSection_H
#include <NCollection_Vector.hxx>
#include <BinLDrivers_DocumentSection.hxx>

View File

@@ -132,7 +132,7 @@ static int TranslateFrom (const BinObjMgt_Persistent& theSource,
TopAbs_Orientation anOrient = CharToOrientation (aCharOrient);
theResult.TShape (theShapeSet->Shape (aShapeID).TShape());//TShape
theResult.Location (theShapeSet->Locations().Location (aLocID), Standard_False); //Location
theResult.Location (theShapeSet->Locations().Location (aLocID)); //Location
theResult.Orientation (anOrient);//Orientation
return 0;
}

View File

@@ -13,8 +13,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef ChFi2d_AnaFilletAlgo_HeaderFile
#define ChFi2d_AnaFilletAlgo_HeaderFile
#ifndef _ANAFILLETALGO_H_
#define _ANAFILLETALGO_H_
#include <TopoDS_Wire.hxx>
#include <TopoDS_Edge.hxx>

View File

@@ -13,8 +13,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef ChFi2d_ChamferAPI_HeaderFile
#define ChFi2d_ChamferAPI_HeaderFile
#ifndef _CHAMFERAPI_H_
#define _CHAMFERAPI_H_
#include <TopoDS_Edge.hxx>
#include <TopoDS_Wire.hxx>

View File

@@ -13,8 +13,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef ChFi2d_FilletAPI_HeaderFile
#define ChFi2d_FilletAPI_HeaderFile
#ifndef _CHFI2D_FILLETAPI_H_
#define _CHFI2D_FILLETAPI_H_
#include <ChFi2d_FilletAlgo.hxx>
#include <ChFi2d_AnaFilletAlgo.hxx>

View File

@@ -13,8 +13,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef ChFi2d_FilletAlgo_HeaderFile
#define ChFi2d_FilletAlgo_HeaderFile
#ifndef _FILLETALGO_H_
#define _FILLETALGO_H_
#include <TopoDS_Edge.hxx>
#include <TopoDS_Wire.hxx>

View File

@@ -14,14 +14,15 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef ChFiKPart_ComputeData_CS_HeaderFile
#define ChFiKPart_ComputeData_CS_HeaderFile
#include <Adaptor3d_Surface.hxx>
#include <gp_Pnt2d.hxx>
#include <gp_Cylinder.hxx>
#include <gp_Circ.hxx>
#ifndef ChFiKPart_ComputeData_CS_HeaderFile
#define ChFiKPart_ComputeData_CS_HeaderFile
void ChFiKPart_CornerSpine(const Handle(Adaptor3d_Surface)& S1,
const Handle(Adaptor3d_Surface)& S2,
const gp_Pnt2d& P1S1,

View File

@@ -14,8 +14,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef ChFiKPart_ComputeData_FilPlnCon_HeaderFile
#define ChFiKPart_ComputeData_FilPlnCon_HeaderFile
#ifndef ChFiKPart_ComputeData_PlnCon_HeaderFile
#define ChFiKPart_ComputeData_PlnCon_HeaderFile
Standard_Boolean ChFiKPart_MakeFillet(TopOpeBRepDS_DataStructure& DStr,
const Handle(ChFiDS_SurfData)& Data,

View File

@@ -14,8 +14,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef ChFiKPart_ComputeData_FilPlnCyl_HeaderFile
#define ChFiKPart_ComputeData_FilPlnCyl_HeaderFile
#ifndef ChFiKPart_ComputeData_PlnCyl_HeaderFile
#define ChFiKPart_ComputeData_PlnCyl_HeaderFile
Standard_Boolean ChFiKPart_MakeFillet(TopOpeBRepDS_DataStructure& DStr,
const Handle(ChFiDS_SurfData)& Data,

View File

@@ -14,8 +14,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef ChFiKPart_ComputeData_FilPlnPln_HeaderFile
#define ChFiKPart_ComputeData_FilPlnPln_HeaderFile
#ifndef ChFiKPart_ComputeData_PlnPln_HeaderFile
#define ChFiKPart_ComputeData_PlnPln_HeaderFile
Standard_Boolean ChFiKPart_MakeFillet(TopOpeBRepDS_DataStructure& DStr,
const Handle(ChFiDS_SurfData)& Data,

View File

@@ -11,8 +11,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef Cocoa_LocalPool_HeaderFile
#define Cocoa_LocalPool_HeaderFile
#ifndef __Cocoa_LocalPool_h_
#define __Cocoa_LocalPool_h_
#if defined(__clang__) && (__clang_major__ >= 4)
#if __has_feature(objc_arc)

View File

@@ -13,8 +13,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef Cocoa_Window_HeaderFile
#define Cocoa_Window_HeaderFile
#ifndef _Cocoa_Window_H__
#define _Cocoa_Window_H__
#if defined(__APPLE__)
#import <TargetConditionals.h>

View File

@@ -14,13 +14,13 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef Convert_CosAndSinEvalFunction_HeaderFile
#define Convert_CosAndSinEvalFunction_HeaderFile
#include <TColgp_Array1OfPnt2d.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <TColStd_Array1OfInteger.hxx>
#ifndef _Convert_CosAnSinEvalFunction_HeaderFile
#define _Convert_CosAnSinEvalFunction_HeaderFile
typedef void Convert_CosAndSinEvalFunction(Standard_Real,
const Standard_Integer,
const TColgp_Array1OfPnt2d&,

View File

@@ -14,12 +14,12 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef Convert_PolynomialCosAndSin_HeaderFile
#define Convert_PolynomialCosAndSin_HeaderFile
#include <TColStd_HArray1OfReal.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#ifndef _Convert_PolynomialCosAnSin_HeaderFile
#define _Convert_PolynomialCosAnSin_HeaderFile
void BuildPolynomialCosAndSin
(const Standard_Real,
const Standard_Real,

View File

@@ -11,8 +11,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef DsgPrs_DatumPrs_HeaderFile
#define DsgPrs_DatumPrs_HeaderFile
#ifndef _DsgPrs_DatumPrs_H__
#define _DsgPrs_DatumPrs_H__
#include <gp_Ax2.hxx>
#include <Prs3d_Drawer.hxx>

View File

@@ -12,8 +12,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef Font_BRepFont_HeaderFile
#define Font_BRepFont_HeaderFile
#ifndef _Font_BRepFont_H__
#define _Font_BRepFont_H__
#include <StdPrs_BRepFont.hxx>

View File

@@ -103,11 +103,9 @@ bool Font_FTFont::Init (const Handle(NCollection_Buffer)& theData,
{
throw Standard_ProgramError ("Font_FTFont, Light and Normal hinting styles are mutually exclusive");
}
#ifdef HAVE_FREETYPE
setLoadFlag (FT_LOAD_TARGET_LIGHT, (theParams.FontHinting & Font_Hinting_Light) != 0);
setLoadFlag (FT_LOAD_NO_HINTING, (theParams.FontHinting & Font_Hinting_Normal) == 0
&& (theParams.FontHinting & Font_Hinting_Light) == 0);
#endif
// manage native / autohinting
if ((theParams.FontHinting & Font_Hinting_ForceAutohint) != 0
@@ -115,10 +113,8 @@ bool Font_FTFont::Init (const Handle(NCollection_Buffer)& theData,
{
throw Standard_ProgramError ("Font_FTFont, ForceAutohint and NoAutohint are mutually exclusive");
}
#ifdef HAVE_FREETYPE
setLoadFlag (FT_LOAD_FORCE_AUTOHINT, (theParams.FontHinting & Font_Hinting_ForceAutohint) != 0);
setLoadFlag (FT_LOAD_NO_AUTOHINT, (theParams.FontHinting & Font_Hinting_NoAutohint) != 0);
#endif
if (!myFTLib->IsValid())
{

View File

@@ -13,8 +13,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef Font_FTFont_HeaderFile
#define Font_FTFont_HeaderFile
#ifndef _Font_FTFont_H__
#define _Font_FTFont_H__
#include <Font_FontAspect.hxx>
#include <Font_Hinting.hxx>

View File

@@ -13,8 +13,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef Font_FTLibrary_HeaderFile
#define Font_FTLibrary_HeaderFile
#ifndef _Font_FTLibrary_H__
#define _Font_FTLibrary_H__
#include <Standard_Type.hxx>
#include <Standard_Transient.hxx>

View File

@@ -383,7 +383,6 @@ Handle(Geom_BSplineSurface) GeomConvert::SurfaceToBSplineSurface
//
//For cylinders, cones, spheres, toruses
const Standard_Boolean isUClosed = Abs((ULast - UFirst) - 2. * M_PI) <= Precision::PConfusion();
const Standard_Real eps = 100. * Epsilon(2. * M_PI);
//
if (Surf->IsKind(STANDARD_TYPE(Geom_Plane))) {
TColgp_Array2OfPnt Poles (1, 2, 1, 2);
@@ -416,11 +415,6 @@ Handle(Geom_BSplineSurface) GeomConvert::SurfaceToBSplineSurface
if (isUClosed) {
Convert_CylinderToBSplineSurface Convert (Cyl, VFirst, VLast);
TheSurface = BSplineSurfaceBuilder (Convert);
Standard_Integer aNbK = TheSurface->NbUKnots();
if (Abs(TheSurface->UKnot(1) - UFirst) > eps || Abs(TheSurface->UKnot(aNbK) - ULast) > eps)
{
TheSurface->CheckAndSegment(UFirst, ULast, VFirst, VLast);
}
}
else {
Convert_CylinderToBSplineSurface
@@ -437,11 +431,6 @@ Handle(Geom_BSplineSurface) GeomConvert::SurfaceToBSplineSurface
if (isUClosed) {
Convert_ConeToBSplineSurface Convert (Co, VFirst, VLast);
TheSurface = BSplineSurfaceBuilder (Convert);
Standard_Integer aNbK = TheSurface->NbUKnots();
if (Abs(TheSurface->UKnot(1) - UFirst) > eps || Abs(TheSurface->UKnot(aNbK) - ULast) > eps)
{
TheSurface->CheckAndSegment(UFirst, ULast, VFirst, VLast);
}
}
else {
Convert_ConeToBSplineSurface
@@ -461,11 +450,6 @@ Handle(Geom_BSplineSurface) GeomConvert::SurfaceToBSplineSurface
//Convert_SphereToBSplineSurface Convert (Sph, UFirst, ULast);
Convert_SphereToBSplineSurface Convert (Sph, VFirst, VLast, Standard_False);
TheSurface = BSplineSurfaceBuilder (Convert);
Standard_Integer aNbK = TheSurface->NbUKnots();
if (Abs(TheSurface->UKnot(1) - UFirst) > eps || Abs(TheSurface->UKnot(aNbK) - ULast) > eps)
{
TheSurface->CheckAndSegment(UFirst, ULast, VFirst, VLast);
}
}
else {
Convert_SphereToBSplineSurface
@@ -484,20 +468,10 @@ Handle(Geom_BSplineSurface) GeomConvert::SurfaceToBSplineSurface
Convert_TorusToBSplineSurface Convert (Tr, VFirst, VLast,
Standard_False);
TheSurface = BSplineSurfaceBuilder (Convert);
Standard_Integer aNbK = TheSurface->NbUKnots();
if (Abs(TheSurface->UKnot(1) - UFirst) > eps || Abs(TheSurface->UKnot(aNbK) - ULast) > eps)
{
TheSurface->CheckAndSegment(UFirst, ULast, VFirst, VLast);
}
}
else if (Strim->IsVClosed()) {
Convert_TorusToBSplineSurface Convert (Tr, UFirst, ULast);
TheSurface = BSplineSurfaceBuilder (Convert);
Standard_Integer aNbK = TheSurface->NbVKnots();
if (Abs(TheSurface->VKnot(1) - VFirst) > eps || Abs(TheSurface->VKnot(aNbK) - VLast) > eps)
{
TheSurface->CheckAndSegment(UFirst, ULast, VFirst, VLast);
}
}
else {
Convert_TorusToBSplineSurface
@@ -601,6 +575,7 @@ Handle(Geom_BSplineSurface) GeomConvert::SurfaceToBSplineSurface
2 , C->Degree(),
periodic, C->IsPeriodic());
}

View File

@@ -261,135 +261,134 @@ static Standard_Integer to3d (Draw_Interpretor& , Standard_Integer n, const char
static Standard_Integer gproject(Draw_Interpretor& di, Standard_Integer n, const char** a)
{
TCollection_AsciiString newname;
TCollection_AsciiString newname1;
char newname[1024];
char* temp = newname;
char newname1[10];
char* temp1 = newname1;
char name[100];
Standard_Integer ONE = 1;
if (n < 4)
{
di << "gproject waits 3 or more arguments\n";
return 1;
if (n == 3)
Sprintf(name,"p");
else if (n == 4) {
Sprintf(name,"%s",a[1]);
ONE = 2;
}
else {
di << "gproject wait 2 or 3 arguments\n";
return 1;
}
TCollection_AsciiString name = a[1];
Handle(Geom_Curve) Cur = DrawTrSurf::GetCurve(a[2]);
Handle(Geom_Surface) Sur = DrawTrSurf::GetSurface(a[3]);
Handle(Geom_Curve) Cur = DrawTrSurf::GetCurve(a[ONE]);
Handle(Geom_Surface) Sur = DrawTrSurf::GetSurface(a[ONE+1]);
if (Cur.IsNull() || Sur.IsNull()) return 1;
Handle(GeomAdaptor_Curve) hcur = new GeomAdaptor_Curve(Cur);
Handle(GeomAdaptor_Surface) hsur = new GeomAdaptor_Surface(Sur);
Standard_Integer index = 4;
Standard_Real aTol3d = 1.e-6;
Standard_Real aMaxDist = -1.0;
if (n > 4 && a[4][0] != '-')
{
aTol3d = Draw::Atof(a[4]);
index = 5;
Standard_Real myTol3d = 1.e-6;
GeomAbs_Shape myContinuity = GeomAbs_C2;
Standard_Integer myMaxDegree = 14, myMaxSeg = 16;
if (n > 5 && a[5][0] != '-')
{
aMaxDist = Draw::Atof(a[5]);
index = 6;
}
}
Handle(ProjLib_HCompProjectedCurve) HProjector = new ProjLib_HCompProjectedCurve(aTol3d, hsur, hcur, aMaxDist);
Handle(ProjLib_HCompProjectedCurve) HProjector = new ProjLib_HCompProjectedCurve (hsur, hcur, myTol3d/10, myTol3d/10);
ProjLib_CompProjectedCurve& Projector = *HProjector;
GeomAbs_Shape aContinuity = GeomAbs_C2;
Standard_Integer aMaxDegree, aMaxSeg;
Standard_Boolean aProj2d;
Standard_Boolean aProj3d;
Standard_Integer k;
Standard_Real Udeb, Ufin, UIso, VIso;
Standard_Boolean Only2d, Only3d;
gp_Pnt2d P2d, Pdeb, Pfin;
gp_Pnt P;
Handle(Adaptor2d_Curve2d) HPCur;
Handle(Geom2d_Curve) PCur2d; // Only for isoparametric projection
while (index + 1 < n)
{
if (a[index][0] != '-') return 1;
if (a[index][1] == 'c')
{
Standard_CString aContinuityName = a[index + 1];
if (!strcmp(aContinuityName, "C0"))
{
aContinuity = GeomAbs_C0;
}
else if (!strcmp(aContinuityName, "C1"))
{
aContinuity = GeomAbs_C1;
}
else if (!strcmp(aContinuityName, "C2"))
{
aContinuity = GeomAbs_C2;
}
Projector.SetContinuity(aContinuity);
}
else if (a[index][1] == 'd')
{
aMaxDegree = Draw::Atoi(a[index + 1]);
aMaxDegree = aMaxDegree > 25 ? 25 : aMaxDegree;
Projector.SetMaxDegree(aMaxDegree);
}
else if (a[index][1] == 's')
{
aMaxSeg = Draw::Atoi(a[index + 1]);
Projector.SetMaxSeg(aMaxSeg);
}
else if (!strcmp(a[index], "-2d"))
{
aProj2d = Draw::Atoi(a[index + 1]) > 0 ? Standard_True : Standard_False;
Projector.SetProj2d(aProj2d);
}
else if (!strcmp(a[index], "-3d"))
{
aProj3d = Draw::Atoi(a[index + 1]) > 0 ? Standard_True : Standard_False;
Projector.SetProj3d(aProj3d);
}
index += 2;
}
Projector.Perform();
for (Standard_Integer k = 1; k <= Projector.NbCurves(); k++) {
newname = name + "_" + TCollection_AsciiString(k);
newname1 = name + "2d_" + TCollection_AsciiString(k);
if (Projector.ResultIsPoint(k))
{
if (Projector.GetProj2d())
{
DrawTrSurf::Set(newname1.ToCString(), Projector.GetResult2dP(k));
di << newname1 << " is pcurve\n";
}
if (Projector.GetProj3d())
{
DrawTrSurf::Set(newname.ToCString(), Projector.GetResult3dP(k));
di << newname << " is 3d projected curve\n";
}
for(k = 1; k <= Projector.NbCurves(); k++){
Sprintf(newname,"%s_%d",name,k);
Sprintf(newname1,"%s2d_%d",name,k);
if(Projector.IsSinglePnt(k, P2d)){
// std::cout<<"Part "<<k<<" of the projection is punctual"<<std::endl;
Projector.GetSurface()->D0(P2d.X(), P2d.Y(), P);
DrawTrSurf::Set(temp, P);
DrawTrSurf::Set(temp1, P2d);
di<<temp<<" is 3d projected curve\n";
di<<temp1<<" is pcurve\n";
}
else {
if (Projector.GetProj2d())
{
DrawTrSurf::Set(newname1.ToCString(), Projector.GetResult2dC(k));
di << newname1 << " is pcurve\n";
di << " Tolerance reached in 2d is " << Projector.GetResult2dUApproxError(k)
<< "; " << Projector.GetResult2dVApproxError(k) << "\n";
Only2d = Only3d = Standard_False;
Projector.Bounds(k, Udeb, Ufin);
gp_Dir2d Dir; // Only for isoparametric projection
if (Projector.IsUIso(k, UIso)) {
// std::cout<<"Part "<<k<<" of the projection is U-isoparametric curve"<<std::endl;
Projector.D0(Udeb, Pdeb);
Projector.D0(Ufin, Pfin);
Udeb = Pdeb.Y();
Ufin = Pfin.Y();
if (Udeb > Ufin) {
Dir = gp_Dir2d(0, -1);
Udeb = - Udeb;
Ufin = - Ufin;
}
else Dir = gp_Dir2d(0, 1);
PCur2d = new Geom2d_TrimmedCurve(new Geom2d_Line(gp_Pnt2d(UIso, 0), Dir), Udeb, Ufin);
HPCur = new Geom2dAdaptor_Curve(PCur2d);
Only3d = Standard_True;
}
if (Projector.GetProj3d())
{
DrawTrSurf::Set(newname.ToCString(), Projector.GetResult3dC(k));
di << newname << " is 3d projected curve\n";
di << " Tolerance reached in 3d is " << Projector.GetResult3dApproxError(k) << "\n";
else if(Projector.IsVIso(k, VIso)) {
// std::cout<<"Part "<<k<<" of the projection is V-isoparametric curve"<<std::endl;
Projector.D0(Udeb, Pdeb);
Projector.D0(Ufin, Pfin);
Udeb = Pdeb.X();
Ufin = Pfin.X();
if (Udeb > Ufin) {
Dir = gp_Dir2d(-1, 0);
Udeb = - Udeb;
Ufin = - Ufin;
}
else Dir = gp_Dir2d(1, 0);
PCur2d = new Geom2d_TrimmedCurve(new Geom2d_Line(gp_Pnt2d(0, VIso), Dir), Udeb, Ufin);
HPCur = new Geom2dAdaptor_Curve(PCur2d);
Only3d = Standard_True;
}
else HPCur = HProjector;
if(Projector.MaxDistance(k) <= myTol3d)
Only2d = Standard_True;
if(Only2d && Only3d) {
Handle(Geom_Curve) OutCur = new Geom_TrimmedCurve (GeomAdaptor::MakeCurve (*hcur), Ufin, Udeb);
DrawTrSurf::Set(temp, OutCur);
DrawTrSurf::Set(temp1, PCur2d);
di<<temp<<" is 3d projected curve\n";
di<<temp1<<" is pcurve\n";
return 0;
}
else {
Approx_CurveOnSurface appr(HPCur, hsur, Udeb, Ufin, myTol3d);
appr.Perform(myMaxSeg, myMaxDegree, myContinuity, Only3d, Only2d);
if(!Only3d) {
PCur2d = appr.Curve2d();
di << " Error in 2d is " << appr.MaxError2dU()
<< "; " << appr.MaxError2dV() << "\n";
}
if(Only2d) {
Handle(Geom_Curve) OutCur = new Geom_TrimmedCurve (GeomAdaptor::MakeCurve (*hcur), Ufin, Udeb);
DrawTrSurf::Set(temp, OutCur);
}
else {
di << " Error in 3d is " << appr.MaxError3d() << "\n";
DrawTrSurf::Set(temp, appr.Curve3d());
}
DrawTrSurf::Set(temp1, PCur2d);
di<<temp<<" is 3d projected curve\n";
di<<temp1<<" is pcurve\n";
}
}
}
return 0;
return 0;
}
//=======================================================================
//function : project
//purpose :
@@ -1802,15 +1801,9 @@ void GeometryTest::CurveCommands(Draw_Interpretor& theCommands)
to3d,g);
theCommands.Add("gproject",
"gproject projectname curve surface [tolerance [maxdist]]\n"
"\t\t[-c continuity][-d maxdegree][-s maxsegments][-2d proj2d][-3d proj3d]\n"
"\t\t-c continuity : set curve continuity (C0, C1, C2) for approximation\n"
"\t\t-d maxdegree : set max possible degree of result for approximation\n"
"\t\t-s maxsegments : set max value of parametric intervals the projected curve for approximation\n"
"\t\t-2d proj2d : set necessity of 2d results (0 or 1)\n"
"\t\t-3d proj3d : set necessity of 3d results (0 or 1)",
__FILE__,
gproject,g);
"gproject : [projectname] curve surface",
__FILE__,
gproject,g);
theCommands.Add("project",
"project : no args to have help",

View File

@@ -46,7 +46,6 @@
#include <IntRes2d_IntersectionPoint.hxx>
#include <Geom2dAdaptor_Curve.hxx>
#include <Message.hxx>
#include <NCollection_Shared.hxx>
#include <memory>
#include <stdio.h>
@@ -61,38 +60,38 @@ Standard_IMPORT Draw_Viewer dout;
static Standard_Integer proj (Draw_Interpretor& di, Standard_Integer n, const char** a)
{
if (n != 4)
{
di << "Syntax error: wrong number of arguments";
return 1;
}
if ( n < 4) return 1;
gp_Pnt2d P(Draw::Atof(a[2]),Draw::Atof(a[3]));
char name[100];
Handle(Geom2d_Curve) GC = DrawTrSurf::GetCurve2d(a[1]);
if (GC.IsNull())
{
di << "Syntax error: '" << a[1] << "' is NULL";
return 1;
}
const gp_Pnt2d P (Draw::Atof (a[2]), Draw::Atof (a[3]));
Geom2dAPI_ProjectPointOnCurve proj(P,GC,GC->FirstParameter(), GC->LastParameter());
if (GC.IsNull())
return 1;
Geom2dAPI_ProjectPointOnCurve proj(P,GC,GC->FirstParameter(),
GC->LastParameter());
for (Standard_Integer i = 1; i <= proj.NbPoints(); i++)
{
gp_Pnt2d aP1 = proj.Point(i);
const Standard_Real aDist = P.Distance(aP1);
const TCollection_AsciiString aName = TCollection_AsciiString ("ext_") + i;
Sprintf(name, "%s%d", "ext_", i);
if (aDist > Precision::PConfusion())
{
Handle(Geom2d_Line) L = new Geom2d_Line(P, gp_Dir2d(aP1.XY() - P.XY()));
Handle(Geom2d_TrimmedCurve) CT = new Geom2d_TrimmedCurve(L, 0., aDist);
DrawTrSurf::Set (aName.ToCString(), CT);
DrawTrSurf::Set(name, CT);
}
else
{
DrawTrSurf::Set (aName.ToCString(), aP1);
DrawTrSurf::Set(name, aP1);
}
di << aName << " ";
di << name << " ";
}
return 0;
@@ -120,18 +119,18 @@ static Standard_Integer appro(Draw_Interpretor& di, Standard_Integer n, const ch
// 2dappro result nbpoint x1 dx y1 y2 ..
// - tableau de points (x1,y1) (x1+dx,y2) ... avec x = t
static Standard_Real Tol2d = 1.e-6;
if (n < 3)
{
if (n == 2)
{
Tol2d = Draw::Atof(a[1]);
}
static Standard_Real Tol2d = 1.e-6;
if (n < 3) {
if (n == 2)
Tol2d = Draw::Atof(a[1]);
di << "Tolerance for 2d approx : "<< Tol2d << "\n";
return 0;
}
Standard_Integer i, Nb = Draw::Atoi(a[2]);
Standard_Boolean hasPoints = Standard_True;
@@ -258,7 +257,9 @@ static Standard_Integer appro(Draw_Interpretor& di, Standard_Integer n, const ch
DrawTrSurf::Set(a[1], TheCurve);
di << a[1];
return 0;
}
//=======================================================================
@@ -268,29 +269,25 @@ static Standard_Integer appro(Draw_Interpretor& di, Standard_Integer n, const ch
static Standard_Integer extrema(Draw_Interpretor& di, Standard_Integer n, const char** a)
{
if (n != 3)
{
di << "Syntax error: wrong number of arguments";
return 1;
}
if ( n<3) return 1;
Handle(Geom2d_Curve) GC1 = DrawTrSurf::GetCurve2d (a[1]);
Handle(Geom2d_Curve) GC2 = DrawTrSurf::GetCurve2d (a[2]);
if (GC1.IsNull())
{
di << "Syntax error: '" << a[1] << "' is NULL";
return 1;
}
if (GC2.IsNull())
{
di << "Syntax error: '" << a[2] << "' is NULL";
return 1;
}
Handle(Geom2d_Curve) GC1, GC2;
const Standard_Real U1f = GC1->FirstParameter();
const Standard_Real U1l = GC1->LastParameter();
const Standard_Real U2f = GC2->FirstParameter();
const Standard_Real U2l = GC2->LastParameter();
Standard_Real U1f,U1l,U2f,U2l;
GC1 = DrawTrSurf::GetCurve2d(a[1]);
if ( GC1.IsNull())
return 1;
U1f = GC1->FirstParameter();
U1l = GC1->LastParameter();
GC2 = DrawTrSurf::GetCurve2d(a[2]);
if ( GC2.IsNull())
return 1;
U2f = GC2->FirstParameter();
U2l = GC2->LastParameter();
char name[100];
Geom2dAPI_ExtremaCurveCurve Ex(GC1,GC2,U1f,U1l,U2f,U2l);
Standard_Boolean isInfinitySolutions = Ex.Extrema().IsParallel();
@@ -311,23 +308,25 @@ static Standard_Integer extrema(Draw_Interpretor& di, Standard_Integer n, const
gp_Pnt2d P1,P2;
Ex.Points(i,P1,P2);
di << "dist " << i << ": " << Ex.Distance(i) << " ";
const TCollection_AsciiString aName = TCollection_AsciiString("ext_") + i;
if (Ex.Distance(i) <= Precision::PConfusion())
{
Handle(Draw_Marker2D) mark = new Draw_Marker2D( P1, Draw_X, Draw_vert);
dout << mark;
dout.Flush();
const char* temp = aName.ToCString();
Sprintf(name,"%s%d","ext_",i);
char* temp = name;
DrawTrSurf::Set(temp, P1);
di << name << "\n";
}
else
{
Handle(Geom2d_Line) L = new Geom2d_Line(P1,gp_Vec2d(P1,P2));
Handle(Geom2d_TrimmedCurve) CT = new Geom2d_TrimmedCurve(L, 0., P1.Distance(P2));
const char* temp = aName.ToCString();
Sprintf(name,"%s%d","ext_",i);
char* temp = name; // portage WNT
DrawTrSurf::Set(temp, CT);
di << name << "\n";
}
di << aName << "\n";
}
return 0;
@@ -339,12 +338,25 @@ static Standard_Integer extrema(Draw_Interpretor& di, Standard_Integer n, const
//=======================================================================
static Standard_Integer intersect(Draw_Interpretor& di, Standard_Integer n, const char** a)
{
Handle(Geom2d_Curve) C1, C2;
if (n < 2)
{
di.PrintHelp(a[0]);
return 1;
}
Handle(Geom2d_Curve) C1 = DrawTrSurf::GetCurve2d(a[1]);
if (C1.IsNull())
{
di << "Curve " << a[1] << " is null\n";
return 1;
}
Handle(Geom2d_Curve) C2;
Standard_Real Tol = 0.001;
Standard_Boolean bPrintState = Standard_False;
// Retrieve other parameters if any
for (Standard_Integer i = 1; i < n; ++i)
for (Standard_Integer i = 2; i < n; ++i)
{
if (!strcmp(a[i], "-tol"))
{
@@ -354,47 +366,25 @@ static Standard_Integer intersect(Draw_Interpretor& di, Standard_Integer n, cons
{
bPrintState = Standard_True;
}
else if (C1.IsNull())
{
C1 = DrawTrSurf::GetCurve2d (a[i]);
if (C1.IsNull())
{
di << "Syntax error: curve '" << a[i] << "' is null";
return 1;
}
}
else if (C2.IsNull())
else
{
C2 = DrawTrSurf::GetCurve2d(a[i]);
if (C2.IsNull())
{
di << "Syntax error: curve '" << a[i] << "' is null";
di << "Curve " << a[i] << " is null\n";
return 1;
}
}
else
{
di << "Syntax error at '" << a[i] << "'";
return 1;
}
}
if (C1.IsNull())
{
di << "Syntax error: wrong number of arguments";
return 1;
}
Geom2dAPI_InterCurveCurve Intersector;
if (!C2.IsNull())
{
// Curves intersection
Intersector.Init(C1, C2, Tol);
}
else
{
// Self-intersection of the curve
Intersector.Init(C1, Tol);
}
const Geom2dInt_GInter& anIntTool = Intersector.Intersector();
if (!anIntTool.IsDone())
@@ -404,9 +394,7 @@ static Standard_Integer intersect(Draw_Interpretor& di, Standard_Integer n, cons
}
if (anIntTool.IsEmpty())
{
return 0;
}
Standard_Integer aNbPoints = Intersector.NbPoints();
for (Standard_Integer i = 1; i <= aNbPoints; i++)
@@ -440,8 +428,9 @@ static Standard_Integer intersect(Draw_Interpretor& di, Standard_Integer n, cons
CD = new DrawTrSurf_Curve2d(S2, Draw_violet, 30);
dout << CD;
}
dout.Flush();
return 0;
}
@@ -452,25 +441,28 @@ static Standard_Integer intersect(Draw_Interpretor& di, Standard_Integer n, cons
static Standard_Integer intersect_ana(Draw_Interpretor& di, Standard_Integer n, const char** a)
{
if (n != 3)
if (n < 2)
{
di << "Syntax error: wrong number of arguments";
Message::SendFail() << "2dintana circle circle";
return 1;
}
Handle(Geom2d_Curve) C1 = DrawTrSurf::GetCurve2d(a[1]);
if (C1.IsNull() && !C1->IsKind(STANDARD_TYPE(Geom2d_Circle)))
return 1;
Handle(Geom2d_Curve) C2 = DrawTrSurf::GetCurve2d(a[2]);
if (C2.IsNull() && !C2->IsKind(STANDARD_TYPE(Geom2d_Circle)))
return 1;
Handle(Geom2d_Circle) aCir1 = Handle(Geom2d_Circle)::DownCast(C1);
Handle(Geom2d_Circle) aCir2 = Handle(Geom2d_Circle)::DownCast(C2);
if (aCir1.IsNull() || aCir2.IsNull())
{
di << "Syntax error: '" << a[aCir1.IsNull() ? 1 : 2] << "' is not a circle";
return 1;
}
IntAna2d_AnaIntersection Intersector(aCir1->Circ2d(), aCir2->Circ2d());
for (Standard_Integer i = 1; i <= Intersector.NbPoints(); i++)
{
Standard_Integer i;
for (i = 1; i <= Intersector.NbPoints(); i++) {
gp_Pnt2d P = Intersector.Point(i).Value();
di << "Intersection point " << i << " : " << P.X() << " " << P.Y() << "\n";
di << "parameter on the fist: " << Intersector.Point(i).ParamOnFirst();
@@ -479,6 +471,7 @@ static Standard_Integer intersect_ana(Draw_Interpretor& di, Standard_Integer n,
dout << mark;
}
dout.Flush();
return 0;
}
@@ -489,88 +482,90 @@ static Standard_Integer intersect_ana(Draw_Interpretor& di, Standard_Integer n,
static Standard_Integer intconcon(Draw_Interpretor& di, Standard_Integer n, const char** a)
{
if (n != 3)
if( n < 2)
{
di << "Syntax error: wrong number of arguments";
Message::SendFail() << "intconcon con1 con2";
return 1;
}
Handle(Geom2d_Curve) C1 = DrawTrSurf::GetCurve2d(a[1]);
if (C1.IsNull())
{
di << "Syntax error: '" << a[1] << "' is Null";
Message::SendFail() << a[1] << " is Null";
return 1;
}
Handle(Geom2d_Curve) C2 = DrawTrSurf::GetCurve2d(a[2]);
if (C2.IsNull())
{
di << "Syntax error: '" << a[2] << "' is Null";
Message::SendFail() << a[2] << " is Null";
return 1;
}
Geom2dAdaptor_Curve AC1(C1), AC2(C2);
GeomAbs_CurveType T1 = AC1.GetType(), T2 = AC2.GetType();
Handle(NCollection_Shared<IntAna2d_Conic>) pCon;
#if (defined(_MSC_VER) && (_MSC_VER < 1600))
std::auto_ptr<IntAna2d_Conic> pCon;
#else
std::unique_ptr<IntAna2d_Conic> pCon;
#endif
switch (T2)
{
case GeomAbs_Line:
{
pCon.reset (new NCollection_Shared<IntAna2d_Conic>(AC2.Line()));
break;
}
case GeomAbs_Circle:
{
pCon.reset (new NCollection_Shared<IntAna2d_Conic>(AC2.Circle()));
break;
}
case GeomAbs_Ellipse:
{
pCon.reset (new NCollection_Shared<IntAna2d_Conic>(AC2.Ellipse()));
break;
}
case GeomAbs_Hyperbola:
{
pCon.reset (new NCollection_Shared<IntAna2d_Conic>(AC2.Hyperbola()));
break;
}
case GeomAbs_Parabola:
{
pCon.reset (new NCollection_Shared<IntAna2d_Conic>(AC2.Parabola()));
break;
}
default:
{
di << "Syntax error: '" << a[2] << "' is not conic";
return 1;
}
case GeomAbs_Line:
{
pCon.reset(new IntAna2d_Conic(AC2.Line()));
break;
}
case GeomAbs_Circle:
{
pCon.reset(new IntAna2d_Conic(AC2.Circle()));
break;
}
case GeomAbs_Ellipse:
{
pCon.reset(new IntAna2d_Conic(AC2.Ellipse()));
break;
}
case GeomAbs_Hyperbola:
{
pCon.reset(new IntAna2d_Conic(AC2.Hyperbola()));
break;
}
case GeomAbs_Parabola:
{
pCon.reset(new IntAna2d_Conic(AC2.Parabola()));
break;
}
default:
Message::SendFail() << a[2] << " is not conic";
return 1;
}
IntAna2d_AnaIntersection Intersector;
switch (T1)
{
case GeomAbs_Line:
Intersector.Perform(AC1.Line(), *pCon);
break;
case GeomAbs_Circle:
Intersector.Perform(AC1.Circle(), *pCon);
break;
case GeomAbs_Ellipse:
Intersector.Perform(AC1.Ellipse(), *pCon);
break;
case GeomAbs_Hyperbola:
Intersector.Perform(AC1.Hyperbola(), *pCon);
break;
case GeomAbs_Parabola:
Intersector.Perform(AC1.Parabola(), *pCon);
break;
default:
di << "Syntax error: '" << a[1] << "' is not conic";
return 1;
case GeomAbs_Line:
Intersector.Perform(AC1.Line(), *pCon);
break;
case GeomAbs_Circle:
Intersector.Perform(AC1.Circle(), *pCon);
break;
case GeomAbs_Ellipse:
Intersector.Perform(AC1.Ellipse(), *pCon);
break;
case GeomAbs_Hyperbola:
Intersector.Perform(AC1.Hyperbola(), *pCon);
break;
case GeomAbs_Parabola:
Intersector.Perform(AC1.Parabola(), *pCon);
break;
default:
Message::SendFail() << a[1] << " is not conic";
return 1;
}
for (Standard_Integer i = 1; i <= Intersector.NbPoints(); i++)
{
Standard_Integer i;
for ( i = 1; i <= Intersector.NbPoints(); i++) {
gp_Pnt2d P = Intersector.Point(i).Value();
di<<"Intersection point "<<i<<" : "<<P.X()<<" "<<P.Y()<<"\n";
di << "parameter on the fist: " << Intersector.Point(i).ParamOnFirst();
@@ -586,9 +581,12 @@ static Standard_Integer intconcon(Draw_Interpretor& di, Standard_Integer n, cons
dout << mark;
}
dout.Flush();
return 0;
}
void GeomliteTest::API2dCommands(Draw_Interpretor& theCommands)
{
static Standard_Boolean done = Standard_False;
@@ -623,12 +621,8 @@ void GeomliteTest::API2dCommands(Draw_Interpretor& theCommands)
" -state - allows printing the intersection state for each point.",
__FILE__, intersect, g);
theCommands.Add("2dintanalytical",
"2dintanalytical circle1 circle2"
"Intersect circle1 and circle2 using IntAna2d_AnaIntersection.",
__FILE__, intersect_ana, g);
theCommands.Add("intconcon",
"intconcon curve1 curve2"
"Intersect conic curve1 and conic curve2 using IntAna2d_AnaIntersection",
__FILE__, intconcon, g);
theCommands.Add("2dintanalytical", "intersect circle1 and circle2 using IntAna",__FILE__,
intersect_ana,g);
theCommands.Add("intconcon", "intersect conic curve1 and conic curve2 using IntAna", __FILE__,
intconcon, g);
}

View File

@@ -11,8 +11,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef Graphic3d_BufferType_HeaderFile
#define Graphic3d_BufferType_HeaderFile
#ifndef _Graphic3d_BufferType_H__
#define _Graphic3d_BufferType_H__
//! Define buffers available for dump
enum Graphic3d_BufferType

View File

@@ -13,8 +13,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef Graphic3d_MarkerImage_HeaderFile
#define Graphic3d_MarkerImage_HeaderFile
#ifndef _Graphic3d_MarkerImage_H__
#define _Graphic3d_MarkerImage_H__
#include <Aspect_TypeOfMarker.hxx>
#include <Graphic3d_Vec4.hxx>

View File

@@ -13,8 +13,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef Graphic3d_TransModeFlags_HeaderFile
#define Graphic3d_TransModeFlags_HeaderFile
#ifndef Graphic3d_TRANS_MODE_FLAGS_HXX
#define Graphic3d_TRANS_MODE_FLAGS_HXX
//! Transform Persistence Mode defining whether to lock in object position, rotation and / or zooming relative to camera position.
enum Graphic3d_TransModeFlags

View File

@@ -13,8 +13,8 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef Graphic3d_Vec_HeaderFile
#define Graphic3d_Vec_HeaderFile
#ifndef _Graphic3d_Vec_H__
#define _Graphic3d_Vec_H__
#include <Graphic3d_Vec2.hxx>
#include <Graphic3d_Vec3.hxx>

View File

@@ -22,6 +22,48 @@
#include <Standard_Handle.hxx>
class IGESAppli_Protocol;
class IGESAppli_Node;
class IGESAppli_FiniteElement;
class IGESAppli_NodalDisplAndRot;
class IGESAppli_NodalResults;
class IGESAppli_ElementResults;
class IGESAppli_Flow;
class IGESAppli_PipingFlow;
class IGESAppli_RegionRestriction;
class IGESAppli_LevelFunction;
class IGESAppli_LineWidening;
class IGESAppli_DrilledHole;
class IGESAppli_ReferenceDesignator;
class IGESAppli_PinNumber;
class IGESAppli_PartNumber;
class IGESAppli_FlowLineSpec;
class IGESAppli_LevelToPWBLayerMap;
class IGESAppli_PWBArtworkStackup;
class IGESAppli_PWBDrilledHole;
class IGESAppli_NodalConstraint;
class IGESAppli_ToolNode;
class IGESAppli_ToolFiniteElement;
class IGESAppli_ToolNodalDisplAndRot;
class IGESAppli_ToolNodalResults;
class IGESAppli_ToolElementResults;
class IGESAppli_ToolFlow;
class IGESAppli_ToolPipingFlow;
class IGESAppli_ToolRegionRestriction;
class IGESAppli_ToolLevelFunction;
class IGESAppli_ToolLineWidening;
class IGESAppli_ToolDrilledHole;
class IGESAppli_ToolReferenceDesignator;
class IGESAppli_ToolPinNumber;
class IGESAppli_ToolPartNumber;
class IGESAppli_ToolFlowLineSpec;
class IGESAppli_ToolLevelToPWBLayerMap;
class IGESAppli_ToolPWBArtworkStackup;
class IGESAppli_ToolPWBDrilledHole;
class IGESAppli_ToolNodalConstraint;
class IGESAppli_Protocol;
class IGESAppli_ReadWriteModule;
class IGESAppli_GeneralModule;
class IGESAppli_SpecificModule;
//! This package represents collection of miscellaneous

View File

@@ -29,6 +29,8 @@
class IGESDimen_GeneralNote;
class IGESBasic_HArray1OfHArray1OfInteger;
class IGESBasic_HArray1OfHArray1OfReal;
class Standard_DimensionMismatch;
class Standard_OutOfRange;
class IGESAppli_FiniteElement;

View File

@@ -24,6 +24,7 @@
#include <IGESAppli_HArray1OfNode.hxx>
#include <IGESData_IGESEntity.hxx>
class TCollection_HAsciiString;
class Standard_OutOfRange;
class IGESAppli_Node;

View File

@@ -27,6 +27,8 @@
#include <IGESGraph_HArray1OfTextDisplayTemplate.hxx>
#include <IGESData_IGESEntity.hxx>
#include <Standard_Boolean.hxx>
class Standard_OutOfRange;
class IGESData_IGESEntity;
class IGESDraw_ConnectPoint;
class TCollection_HAsciiString;
class IGESGraph_TextDisplayTemplate;

View File

@@ -23,6 +23,7 @@
#include <Interface_HArray1OfHAsciiString.hxx>
#include <IGESData_IGESEntity.hxx>
#include <Standard_Integer.hxx>
class Standard_OutOfRange;
class TCollection_HAsciiString;

View File

@@ -24,6 +24,8 @@
#include <TColStd_HArray1OfInteger.hxx>
#include <Interface_HArray1OfHAsciiString.hxx>
#include <IGESData_IGESEntity.hxx>
class Standard_DimensionMismatch;
class Standard_OutOfRange;
class TCollection_HAsciiString;

View File

@@ -24,6 +24,7 @@
#include <IGESDefs_HArray1OfTabularData.hxx>
#include <IGESData_IGESEntity.hxx>
class IGESAppli_Node;
class Standard_OutOfRange;
class IGESDefs_TabularData;

View File

@@ -26,6 +26,8 @@
#include <IGESData_IGESEntity.hxx>
#include <Standard_Integer.hxx>
class IGESBasic_HArray1OfHArray1OfXYZ;
class Standard_DimensionMismatch;
class Standard_OutOfRange;
class IGESDimen_GeneralNote;
class IGESAppli_Node;
class gp_XYZ;

View File

@@ -27,6 +27,8 @@
#include <TColStd_HArray2OfReal.hxx>
#include <IGESData_IGESEntity.hxx>
class IGESDimen_GeneralNote;
class Standard_DimensionMismatch;
class Standard_OutOfRange;
class IGESAppli_Node;

Some files were not shown because too many files have changed in this diff Show More