Compare commits
64 Commits
CR29713
...
CR0_MW_vrm
Author | SHA1 | Date | |
---|---|---|---|
|
01296da21c | ||
|
ca4b907317 | ||
|
535b320eaf | ||
|
173f5b0dcc | ||
|
15e59662ee | ||
|
d1211c59c5 | ||
|
33edf52c4d | ||
|
bc6b1013d4 | ||
|
aef69abba1 | ||
|
ed9b49bac1 | ||
|
fe07305a54 | ||
|
284201c834 | ||
|
d4e54977cb | ||
|
de486dae37 | ||
|
75e21c522f | ||
|
88c31d4658 | ||
|
691fb5d8c3 | ||
|
9e053143d0 | ||
|
5ba308215e | ||
|
60243601c0 | ||
|
2e8a449016 | ||
|
9af219655a | ||
|
3874482c60 | ||
|
823d13e218 | ||
|
42da0d5115 | ||
|
d25f052208 | ||
|
60fddce474 | ||
|
61ace3dc72 | ||
|
2e32a64577 | ||
|
6acbb1c641 | ||
|
fad3eca77f | ||
|
3e782664b8 | ||
|
64e93ce135 | ||
|
8c7fab9b4d | ||
|
c9ebb2dd0e | ||
|
ab5b3c22e0 | ||
|
340549b052 | ||
|
8f1384072c | ||
|
57f84042ff | ||
|
ea7ffc2802 | ||
|
f841d372e9 | ||
|
14deaf427f | ||
|
3d77e9620e | ||
|
32ca771129 | ||
|
9ce99357a4 | ||
|
8bca7d76a5 | ||
|
8a5905801c | ||
|
be480fe752 | ||
|
0e4e721c6b | ||
|
26b004e9e8 | ||
|
b2300241d1 | ||
|
042e09aa36 | ||
|
d0fbc7e5dd | ||
|
ed667b9069 | ||
|
2e93433ee5 | ||
|
0c80bdbf5e | ||
|
72e4db54e7 | ||
|
b4dfd43648 | ||
|
fbcef69b1a | ||
|
e50ebf1f0f | ||
|
94443b4811 | ||
|
4563cf3e6c | ||
|
80d55adf7c | ||
|
ea1114eb85 |
@@ -433,4 +433,5 @@ n IVtkDraw
|
||||
t TKIVtkDraw
|
||||
n Geom2dEvaluator
|
||||
t TKVCAF
|
||||
n XCAFView
|
||||
n XCAFView
|
||||
n XCAFNoteObjects
|
||||
|
@@ -585,7 +585,7 @@ endmacro()
|
||||
# prior to version 3.3 not supporting per-configuration install paths
|
||||
# for install target files (see https://cmake.org/Bug/view.php?id=14317)
|
||||
macro (OCCT_UPDATE_TARGET_FILE)
|
||||
if (WIN32)
|
||||
if (MSVC)
|
||||
OCCT_INSERT_CODE_FOR_TARGET ()
|
||||
endif()
|
||||
|
||||
|
@@ -191,7 +191,7 @@ foreach (OCCT_MODULE ${OCC_MODULES_LIST})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if (WIN32)
|
||||
if (MSVC)
|
||||
OCCT_INSERT_CODE_FOR_TARGET ()
|
||||
endif()
|
||||
|
||||
|
@@ -1866,6 +1866,7 @@ proc osutils:tk:files { tkloc thePlatform } {
|
||||
"t" { set utyp "toolkit" }
|
||||
"n" { set utyp "nocdlpack" }
|
||||
"x" { set utyp "executable" }
|
||||
default { error "Error: Cannot determine type of unit $loc, check adm/UDLIST!" }
|
||||
}
|
||||
if [array exists map] { unset map }
|
||||
osutils:tk:loadunit $loc map
|
||||
|
@@ -70,6 +70,7 @@ BOPTools::MapShapes TopExp::MapShapes
|
||||
BOPTools::MapShapesAndAncestors TopExp::MapShapesAndAncestors
|
||||
BOPCol_Box2DBndTreeSelector BOPTools_BoxSelector<Bnd_Box2d>
|
||||
BiTgte_DataMapOfShapeBox TopTools_DataMapOfShapeBox
|
||||
CDM_MessageDriver Message_Messenger
|
||||
|
||||
[tcollection]
|
||||
AdvApp2Var_SequenceOfNode
|
||||
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 11 KiB |
@@ -49,6 +49,13 @@ For instance, in Terminal application:
|
||||
$ ./genproj
|
||||
~~~~~
|
||||
|
||||
Option **-static** can be used with XCode to build static libraries.
|
||||
|
||||
~~~~~
|
||||
$ cd /dev/OCCT/opencascade-7.0.0
|
||||
$ ./genproj xcd -static
|
||||
~~~~~
|
||||
|
||||
@section build_xcode_build Building
|
||||
|
||||
To start **Xcode**, launch script *xcode.sh*.
|
||||
|
@@ -140,7 +140,7 @@ The official repository contains:
|
||||
@figure{OCCT_GitGuide_V2_image006.png,"",320}
|
||||
|
||||
Optionally, you can set up TortoiseGit to use visual diff utility for SVG images used in OCCT documentation.
|
||||
For that, click on item "Diff Viewer" in the Settings dialog, then click button "Advanced..." on the right tab add new record with the following parameters:
|
||||
For that, click on item "Diff Viewer" in the Settings dialog, then click button "Advanced..." in the right tab to add a new record with the following parameters:
|
||||
- Extension: <code>.svg</code>
|
||||
- External program: <code><path_to_OCCT>\\adm\\svgdiff.bat %%base %%mine %%bname %%yname</code>
|
||||
|
||||
|
@@ -193,9 +193,9 @@ Use prefix <i>bug</i> followed by Mantis issue ID and, if necessary, additional
|
||||
* To check expected output which should be obtained as the test result, add @ref testmanual_3_7 "REQUIRED" statement for each line of output to mark it as required.
|
||||
* If the test case produces error messages (contained in parse.rules), which are expected in that test and should not be considered as its failure (e.g. test for *checkshape* command), add REQUIRED statement for each error to mark it as required output.
|
||||
4. To check whether the data files needed for the test are already present in the database, use DRAW command *testfile* (see below).
|
||||
If the data file is already present, use it for new test instead of adding a duplicate.
|
||||
If the data file(s) are not yet present in the test database, put them to some folder and add it to the environment variable *CSF_TestDataPath* to be found by the test system.
|
||||
Information on where the data files can be accessed by OCC team for putting to official database should be provided in comment to Mantis issue, clearly indicating how names of the files used by the test script match the actual names of the files.
|
||||
If the data file is already present, use it for a new test instead of adding a duplicate.
|
||||
If the data file(s) are not yet present in the test database, put them to a folder and add it to the environment variable *CSF_TestDataPath* to be found by the test system.
|
||||
The location of the data files, which need to be accessed by OCC team and put to the official database, should be provided in the comment to Mantis issue, clearly indicating how the names of the files used by the test script match the actual names of the files.
|
||||
The simplest way is to attach the data files to the Mantis issue, with the same names as used by the test script.
|
||||
5. Check that the test case runs as expected (test for fix: OK with the fix, FAILED without the fix; test for existing problem: BAD), and integrate it to the Git branch created for the issue.
|
||||
|
||||
@@ -222,8 +222,8 @@ fixshape result a 0.01 0.01
|
||||
checkshape result
|
||||
~~~~~
|
||||
|
||||
DRAW command testfile should be used to check the data files being used by the test for possible duplication of content or names.
|
||||
The command accepts list of paths to files being checked as single argument, and will give conclusion on each of the files, for instance:
|
||||
DRAW command *testfile* should be used to check the data files used by the test for possible duplication of content or names.
|
||||
The command accepts the list of paths to files to be checked (as a single argument) and gives a conclusion on each of the files, for instance:
|
||||
|
||||
~~~~~
|
||||
Draw[1]> testfile [glob /my/data/path/bug12345*]
|
||||
|
@@ -1503,60 +1503,76 @@ The following obsolete features have been removed:
|
||||
* The container *BiTgte_DataMapOfShapeBox* is replaced with *TopTools_DataMapOfShapeBox*;
|
||||
* The class *BOPTools* has been removed as duplicate of the class *TopExp*;
|
||||
* The method *BOPAlgo_Builder::Splits()* has been removed as excessive. The method *BOPAlgo_Builder::Images()* can be used instead.
|
||||
* The method *BOPTools_AlgoTools::CheckSameGeom()* has been removed as excessive. The method *BOPTools_AlgoTools::AreFacesSameDomain()* can be used instead.
|
||||
|
||||
@section upgrade_occt730 Upgrade to OCCT 7.3.0
|
||||
|
||||
@subsection upgrade_730_lights Light sources
|
||||
|
||||
Multiple changes have been applied to lights management within TKV3d and TKOpenGl:
|
||||
* V3d_Light class is now an alias to Graphic3d_CLight.
|
||||
Graphic3d_CLight is now a Handle class with refactored methods for managing light source parameters
|
||||
(preserving most methods of V3d_Light sub-classes to simplify porting).
|
||||
* Obsolete debugging functionality for drawing lights source has been removed from V3d_Light.
|
||||
Methods and constructors taking parameters for this drawing and not affecting light definition itself has been also removed.
|
||||
* Light constructors taking V3d_Viewer has been marked deprecated.
|
||||
Application may call V3d_Viewer::AddLight() explicitly to register new light sources created by new constructors within V3d_Viewer, but this step is now optional.
|
||||
Multiple changes have been applied to lights management within *TKV3d* and *TKOpenGl*:
|
||||
* *V3d_Light* class is now an alias to *Graphic3d_CLight*.
|
||||
*Graphic3d_CLight* is now a Handle class with refactored methods for managing light source parameters.
|
||||
Most methods of *V3d_Light* sub-classes have been preserved to simplify porting.
|
||||
* Obsolete debugging functionality for drawing a light source has been removed from *V3d_Light*.
|
||||
Methods and constructors that take parameters for debug display and do not affect the light definition itself have also been removed.
|
||||
* Light constructors taking *V3d_Viewer* have been marked as deprecated.
|
||||
Use method *AddLight()* of the class *V3d_Viewer* or *V3d_View* to add new light sources to a scene or a single view, respectively.
|
||||
* The upper limit of 8 light sources has been removed.
|
||||
* Dedicated classes per light source type V3d_AmbientLight, V3d_DirectionalLight, V3d_PositionalLight and V3d_SpotLight have been preserved,
|
||||
but it is now possible defining light of any type by creating base class Graphic3d_CLight directly.
|
||||
Dedicated classes only hides visibility of unrelated light properties depending on its type.
|
||||
* Calling V3d_Viewer::UpdateLights() is no more required after modifying light sources properties (color, position, etc.).
|
||||
* The classes for specific light source types: *V3d_AmbientLight, V3d_DirectionalLight, V3d_PositionalLight* and *V3d_SpotLight* have been preserved, but it is now possible to define the light of any type by creating base class *Graphic3d_CLight* directly. The specific classes only hide unrelated light properties depending on the type of light source.
|
||||
* It is no more required to call *V3d_Viewer::UpdateLights()* after modifying the properties of light sources (color, position, etc.)
|
||||
|
||||
@subsection upgrade_730_shadingmodels Shading Models
|
||||
|
||||
*Graphic3d_AspectFillArea3d* has been extended by a new property *ShadingModel()*, which previously has been defined globally for entire View.
|
||||
*Graphic3d_AspectFillArea3d* has been extended by a new property *ShadingModel()*, which previously has been defined globally for the entire View.
|
||||
|
||||
Previously, triangle array without normal vertex attributes was implicitly considered as unshaded,
|
||||
Previously, a triangle array without normal vertex attributes was implicitly considered as unshaded,
|
||||
but now such array will be shaded using *Graphic3d_TOSM_FACET* model (e.g. by computing per-triangle normals).
|
||||
Therefore, *Graphic3d_TOSM_UNLIT* should be explicitly specified for disabling shading or triangles array.
|
||||
Alternatively, material without reflectance properties can be used for disabling shading as before.
|
||||
Therefore, *Graphic3d_TOSM_UNLIT* should be explicitly specified to disable shading of triangles array.
|
||||
Alternatively, a material without reflectance properties can be used to disable shading (as before).
|
||||
|
||||
@subsection upgrade_730_tkopengl Custom low-level OpenGL elements
|
||||
|
||||
The following API changes should be considered while porting custom OpenGl_Element objects:
|
||||
The following API changes should be considered while porting custom *OpenGl_Element* objects:
|
||||
* *OpenGl_ShaderManager::BindFaceProgram()*, *BindLineProgram()*, *BindMarkerProgram()* now take enumeration arguments instead of Boolean flags.
|
||||
|
||||
@subsection upgrade_730_BOPAlgo_Section Changes in BOPAlgo_Section
|
||||
|
||||
The public method *BuildSection()* in the class *BOPAlgo_Section* has became protected. The methods *Perform()* or *PerformWithFiller()* should be called for construction of the result of SECTION operation.
|
||||
The public method *BuildSection()* in the class *BOPAlgo_Section* has become protected. The methods *Perform()* or *PerformWithFiller()* should be called for construction of the result of SECTION operation.
|
||||
|
||||
@subsection upgrade_730_BRepAdaptor_CompCurve Changes in BRepAdaptor_CompCurve
|
||||
|
||||
The method BRepAdaptor_CompCurve::SetPeriodic has been eliminated.
|
||||
Since new version, the method BRepAdaptor_CompCurve::IsPeriodic() will always return FALSE. Earlier, it could return TRUE in case if the wire contained only one edge based on periodic curve.
|
||||
The method *BRepAdaptor_CompCurve::SetPeriodic* has been eliminated.
|
||||
Since the new version, the method *BRepAdaptor_CompCurve::IsPeriodic()* will always return FALSE. Earlier, it could return TRUE in case if the wire contained only one edge based on a periodic curve.
|
||||
|
||||
@subsection upgrade_730_removed Removed features
|
||||
* The methods *SetDeflection*, *SetEpsilonT*, *SetDiscretize* of the class *IntTools_EdgeFace* have been removed as excessive.
|
||||
|
||||
@subsection upgrade_730_IntersectionAPI Changes in classes responsible for intersection algorithm
|
||||
|
||||
Interfaces of the following methods have been changed: IntPatch_WLineTool::ComputePurgedWLine(...), IntPatch_PrmPrmIntersection::Perform(...), IntPatch_Intersection::Perform(...), IntPatch_Intersection::ParamParamPerfom(...), IntPatch_Intersection::GeomGeomPerfom(...). Please see documentation about corresponding methods.
|
||||
* The methods *SetDeflection*, *SetEpsilonT*, *SetDiscretize* of the class *IntTools_EdgeFace* have been removed as redundant.
|
||||
|
||||
@subsection upgrade_730_BuilderSolid Boolean Operations - Solid Builder algorithm
|
||||
|
||||
Previously, the unclassified faces of *BOPAlgo_BuilderSolid* algorithm (the faces which have not been used for solids creation and located outside of all created solids) have been used to form an additional solid (not closed one) with INTERNAL orientation.
|
||||
Since new version, these unclassified faces are no longer added into resulting solids. Instead, the @ref occt_algorithms_ers "warning" containing these faces appears.
|
||||
Previously, the unclassified faces of *BOPAlgo_BuilderSolid* algorithm (i.e. the faces not used for solids creation and located outside of all created solids) were used to form an additional (not closed) solid with INTERNAL orientation.
|
||||
Since the new version, these unclassified faces are no longer added into the resulting solids. Instead, the @ref occt_algorithms_ers "warning" with a list of these faces appears.
|
||||
|
||||
The following public methods of the *BOPAlgo_BuilderSolid* class have been removed as excessive:
|
||||
* void SetSolid(const TopoDS_Solid& theSolid);
|
||||
* const TopoDS_Solid& Solid() const;
|
||||
The following public methods of the *BOPAlgo_BuilderSolid* class have been removed as redundant:
|
||||
* *void SetSolid(const TopoDS_Solid& theSolid);*
|
||||
* *const TopoDS_Solid& Solid() const;*
|
||||
|
||||
@subsection upgrade_730_BRepAlgoBO Boolean Operation classes in BRepAlgo are deprecated
|
||||
|
||||
The API classes in the package BRepAlgo providing access to old Boolean operations are marked as deprecated:
|
||||
* BRepAlgo_Fuse
|
||||
* BRepAlgo_Common
|
||||
* BRepAlgo_Cut
|
||||
* BRepAlgo_Section
|
||||
Corresponding classes from the package BRepAlgoAPI should be used instead.
|
||||
|
||||
@subsection upgrade_730_replace_CDM_MessageDriver_interface_by_Message_Messenger Unification of the Error/Warning reporting system of Application Framework
|
||||
|
||||
Class *CDM_MessageDriver* and its descendants have been removed; class *Message_Messenger* is used instead in all OCAF packages.
|
||||
By default, messenger returned by *Message::DefaultMessenger()* is used, thus all messages generated by OCAF are directed in the common message queue of OCCT.
|
||||
|
||||
In classes implementing OCAF persistence for custom attributes (those inheriting from *BinMDF_ADriver*, *XmlMDF_ADriver*), uses of method *WriteMessage()* should be replaced by call to method *Send()* of the inherited field *myMessageDriver*. Note that this method takes additional argument indicating the gravity of the message (Trace, Info, Warning, Alarm, or Fail).
|
||||
|
||||
Class *Message_PrinterOStream* can be used instead of *CDM_COutMessageDriver* to direct all messages to a stream.
|
||||
If custom driver class is used in the application, that class shall be reimplemented inheriting from *Message_Printer* instead of *CDM_MessageDriver*.
|
||||
Method *Send()* should be redefined instead of method *Write()* of *CDM_MessageDriver*.
|
||||
To use the custom printer in OCAF, it can be either added to default messenger or set into the custom *Message_Messenger* object created in the method *MessageDriver()* of a class inheriting *CDF_Application*.
|
||||
|
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 6.0 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 8.0 KiB |
@@ -18,7 +18,7 @@ modeling (CAD), manufacturing / measuring (CAM) or numerical simulation (CAE).
|
||||
@section OCCT_OVW_SECTION_2 Copyrights
|
||||
|
||||
Open CASCADE Technology and all materials, including this documentation, is
|
||||
Copyright (c) 1999-2017 by OPEN CASCADE S.A.S. All rights reserved.
|
||||
Copyright (c) 1999-2018 by OPEN CASCADE S.A.S. All rights reserved.
|
||||
|
||||
@htmlonly<center>@endhtmlonly
|
||||
https://www.opencascade.com
|
||||
@@ -223,7 +223,7 @@ for which OCCT is certified to work.
|
||||
| Graphic library | OpenGL 3.3+, OpenGL ES 2.0+ <br> Direct3D 9 |
|
||||
| Qt (for samples and demos) | Desktop: Qt 4.8.6+ https://www.qt.io/download/ <br> Android: Qt 5.3.2+ https://www.qt.io/download/ |
|
||||
| TCL (for testing tools) | Tcl/Tk 8.6.3+ https://www.tcl.tk/software/tcltk/download.html <br> or ActiveTcl 8.6 https://www.activestate.com/activetcl/downloads (for Windows)|
|
||||
| Freetype (for text rendering) | FreeType 2.4.11-2.5.5 https://sourceforge.net/projects/freetype/files/ |
|
||||
| Freetype (for text rendering) | FreeType 2.4.11-2.7.1 https://sourceforge.net/projects/freetype/files/ |
|
||||
| FreeImage (optional, for support of common 2D graphic formats) | FreeImage 3.17.0+ https://sourceforge.net/projects/freeimage/files |
|
||||
| FFmpeg (optional, for video recording) | FFmpeg 3.1+ https://www.ffmpeg.org/download.html |
|
||||
| gl2ps (optional, for export contents of OCCT viewer to vector formats) | gl2ps-1.3.8+ http://geuz.org/gl2ps/ |
|
||||
@@ -286,13 +286,13 @@ When the installation is complete, you will find the directories for 3rd party p
|
||||
|
||||
@figure{/overview/images/overview_3rdparty.png}
|
||||
|
||||
The contents of the OCCT-7.0.0 directory (called further "OCCT root", or $CASROOT) are as follows:
|
||||
The contents of the OCCT-7.3.0 directory (called further "OCCT root", or $CASROOT) are as follows:
|
||||
|
||||
@figure{/overview/images/overview_installation.png, "The directory tree"}
|
||||
|
||||
* **adm** This folder contains administration files, which allow rebuilding OCCT;
|
||||
* **adm/cmake** This folder contains files of CMake building procedure;
|
||||
* **adm/msvc** This folder contains Visual Studio projects for Visual C++ 2005, 2008, 2010, 2012 and 2013 which allow rebuilding OCCT under Windows platform in 32 and 64-bit mode;
|
||||
* **adm/msvc** This folder contains Visual Studio projects for Visual C++ 2010, 2012, 2013, 2015 and 2017 which allow rebuilding OCCT under Windows platform in 32 and 64-bit mode;
|
||||
* **data** This folder contains CAD files in different formats, which can be used to test the OCCT functionality;
|
||||
* **doc** This folder contains OCCT documentation in HTML and PDF format;
|
||||
* **dox** This folder contains sources of OCCT documentation in plain text (MarkDown) format;
|
||||
@@ -300,6 +300,7 @@ The contents of the OCCT-7.0.0 directory (called further "OCCT root", or $CASROO
|
||||
* **samples** This folder contains sample applications.
|
||||
* **src** This folder contains OCCT source files. They are organized in folders, one per development unit;
|
||||
* **tests** This folder contains scripts for OCCT testing.
|
||||
* **tools** This folder contains sources of Inspector tool.
|
||||
* **win64/vc10** This folder contains executable and library files built in optimize mode for Windows platform by Visual C++ 2010;
|
||||
|
||||
@section OCCT_OVW_SECTION_4_2 Environment Variables
|
||||
@@ -310,7 +311,7 @@ To run any Open CASCADE Technology application you need to set the environment v
|
||||
|
||||
You can define the environment variables with env.bat script located in the
|
||||
$CASROOT folder. This script accepts two arguments to be used:
|
||||
the version of Visual Studio (vc8 -- vc12) and the architecture (win32 or win64).
|
||||
the version of Visual Studio (vc10 -- vc141) and the architecture (win32 or win64).
|
||||
|
||||
The additional environment settings necessary for compiling OCCT libraries and samples
|
||||
by Microsoft Visual Studio can be set using script custom.bat located in the same folder.
|
||||
|
@@ -2171,7 +2171,7 @@ aMV.SetArguments(aLS);
|
||||
// setting options for this algorithm is similar to setting options for GF algorithm (see "GF Usage" chapter)
|
||||
...
|
||||
// Additional option of the algorithm
|
||||
Standard_Boolean bAvoidInternalShapes = Standard_False; /* Avoid or not the internal for solids shapes in the result*/
|
||||
Standard_Boolean bAvoidInternalShapes = Standard_False; // Set to True to exclude from the result any shapes internal to the solids
|
||||
aMV.SetAvoidInternalShapes(bAvoidInternalShapes);
|
||||
|
||||
// Perform the operation
|
||||
@@ -2819,10 +2819,10 @@ To enable the safe processing mode for the operation in DRAW, it is necessary to
|
||||
bnondestructive 1
|
||||
~~~~
|
||||
|
||||
@subsection occt_algorithms_11a_4 Disabling check of the input solids for inverted status
|
||||
@subsection occt_algorithms_11a_4 How to disable check of input solids for inverted status
|
||||
|
||||
By default, all input solids are checked for inverted status, i.e. the solids are classified to understand if they are holes in the space (negative volumes) or normal solids (positive volumes). The possibility to disable the check of the input solids for inverted status is the advanced option in Boolean Operation component. This option can be applied to all Basic operations such as General Fuse, Splitting, Boolean, Section, Maker Volume, Cells building.
|
||||
This option allows avoiding time-consuming classification of the input solids and operate with them as with positive volumes, saving up to 10 percent of time on the cases with big number of input solids.
|
||||
By default, all input solids are checked for inverted status, i.e. the solids are classified to understand if they are holes in the space (negative volumes) or normal solids (positive volumes). The possibility to disable the check of the input solids for inverted status is the advanced option in Boolean Operation component. This option can be applied to all Basic operations, such as General Fuse, Splitting, Boolean, Section, Maker Volume and Cells building.
|
||||
This option allows avoiding time-consuming classification of the input solids and processing them in the same way as positive volumes, saving up to 10 percent of time on the cases with a big number of input solids.
|
||||
|
||||
The classification should be disabled only if the user is sure that there are no negative volumes among the input solids, otherwise the result may be invalid.
|
||||
|
||||
@@ -2842,7 +2842,7 @@ aGF.SetCheckInverted(Standard_False);
|
||||
~~~~
|
||||
|
||||
#### TCL level
|
||||
To enable/disable the classification of the solids in DRAW, it is necessary to call the *bcheckinverted* command with appropriate value:
|
||||
To enable/disable the classification of the solids in DRAW, it is necessary to call *bcheckinverted* command with the appropriate value:
|
||||
* 0 - disabling the classification;
|
||||
* 1 - default value, enabling the classification.
|
||||
|
||||
@@ -2852,7 +2852,7 @@ bcheckinverted 0
|
||||
|
||||
@subsection occt_algorithms_11a_5_obb Usage of Oriented Bounding Boxes
|
||||
|
||||
Since Oriented Bounding Boxes are usually much tighter than Axes Aligned Bounding Boxes (for more information on OBB please see the @ref occt_modat_6 "Bounding boxes" chapter of Modeling data User guide) its usage can significantly speed-up the intersection stage of the operation by reducing the number of interfering objects.
|
||||
Since Oriented Bounding Boxes are usually much tighter than Axes Aligned Bounding Boxes (for more information on OBB see the @ref occt_modat_6 "Bounding boxes" chapter of Modeling data User guide) its usage can significantly speed-up the intersection stage of the operation by reducing the number of interfering objects.
|
||||
|
||||
@subsubsection occt_algorithms_11a_5_obb_1 Usage
|
||||
|
||||
@@ -3026,7 +3026,7 @@ modified m2 cut_hist e2
|
||||
|
||||
@subsubsection occt_algorithms_history_gen Generated shapes
|
||||
|
||||
The two intersecting edges will both have the intersection vertices Generated from them.
|
||||
Two intersecting edges will both have the intersection vertices Generated from them.
|
||||
|
||||
As for the operation with intersecting faces, consider the following example:
|
||||
|
||||
|
@@ -5577,7 +5577,7 @@ intconcon curve1 curve2
|
||||
|
||||
Displays the intersection points between two 2d curves.
|
||||
Curves must be only conic sections: 2d lines, circles, ellipses,
|
||||
hyperbolas, parabolas. Algorithm from IntAna2d_AnaIntersection is used.
|
||||
hyperbolas, parabolas. The algorithm from *IntAna2d_AnaIntersection* is used.
|
||||
|
||||
**Example:**
|
||||
~~~~~
|
||||
@@ -7405,12 +7405,12 @@ Syntax:
|
||||
bounding {-s shape | -c xmin ymin zmin xmax ymax zmax} [-obb] [-shape name] [-dump] [-notriangulation] [-perfmeter name NbIters] [-save xmin ymin zmin xmax ymax zmax] [-nodraw] [-optimal] [-exttoler]
|
||||
~~~~~
|
||||
|
||||
Computes and displays the bounding box (BndBox) of a shape. The bounding box is a cuboid circumscribes the source shape.
|
||||
Generaly, bounding boxes can be divided on two main types:
|
||||
- axis-aligned BndBox (AABB). I.e. the box whose edges are parallel to the some axis of World Coordinate System (WCS);
|
||||
Computes and displays the bounding box (BndBox) of a shape. The bounding box is a cuboid that circumscribes the source shape.
|
||||
Generaly, bounding boxes can be divided into two main types:
|
||||
- axis-aligned BndBox (AABB). I.e. the box whose edges are parallel to an axis of World Coordinate System (WCS);
|
||||
- oriented BndBox (OBB). I.e. not AABB.
|
||||
|
||||
Detailed information about this command is availabe in DRAW help-system (enter "help bounding" in DRAW-application).
|
||||
Detailed information about this command is availabe in DRAW help-system (enter "help bounding" in DRAW application).
|
||||
|
||||
**Example 1: Creation of AABB with given corners**
|
||||
~~~~~
|
||||
@@ -7491,7 +7491,7 @@ Syntax:
|
||||
isbbinterf shape1 shape2 [-o]
|
||||
~~~~~
|
||||
|
||||
Checks whether the bounding-boxes created from the given shapes are interfered. If "-o"-option is switched on then the oriented boxes will be checked. Otherwise, axes-aligned boxes will be checked.
|
||||
Checks whether the bounding boxes created from the given shapes are interfered. If "-o"-option is switched on then the oriented boxes will be checked. Otherwise, axis-aligned boxes will be checked.
|
||||
|
||||
**Example 1: Not interfered AABB**
|
||||
~~~~~
|
||||
@@ -7540,7 +7540,7 @@ Syntax:
|
||||
distmini name Shape1 Shape2
|
||||
~~~~~
|
||||
|
||||
Calculates the minimum distance between two shapes. The calculation returns the number of solutions, If more than one solution exists. The options are displayed in the viewer(red) and the results are listed in the shell window. The *distmini* lines are considered as shapes which have a value v.
|
||||
Calculates the minimum distance between two shapes. The calculation returns the number of solutions, if more than one solution exists. The options are displayed in the viewer in red and the results are listed in the shell window. The *distmini* lines are considered as shapes which have a value v.
|
||||
|
||||
**Example:**
|
||||
~~~~~
|
||||
@@ -7610,8 +7610,8 @@ checkshape [-top] shape [result] [-short]
|
||||
|
||||
Where:
|
||||
* *top* -- optional parameter, which allows checking only topological validity of a shape.
|
||||
* *shape* -- the only required parameter which represents the name of the shape to check.
|
||||
* *result* -- optional parameter which is the prefix of the output shape names.
|
||||
* *shape* -- the only required parameter, defines the name of the shape to check.
|
||||
* *result* -- optional parameter, defines custom prefix for the output shape names.
|
||||
* *short* -- a short description of the check.
|
||||
|
||||
**checkshape** examines the selected object for topological and geometric coherence. The object should be a three dimensional shape.
|
||||
@@ -7656,9 +7656,9 @@ validrange edge [(out) u1 u2]
|
||||
|
||||
Where:
|
||||
* *edge* -- the name of the edge to analyze.
|
||||
* *u1*, *u2* -- optional names of variables to put the range into.
|
||||
* *u1*, *u2* -- optional names of variables to put into the range.
|
||||
|
||||
**validrange** computes valid range of the edge. If *u1* and *u2* are not given it returns first and last parameters. Otherwise, it sets the variables u1 and u2.
|
||||
**validrange** computes valid range of the edge. If *u1* and *u2* are not given, it returns the first and the last parameters. Otherwise, it sets variables *u1* and *u2*.
|
||||
|
||||
**Example:**
|
||||
~~~~~
|
||||
@@ -8034,7 +8034,7 @@ Options:
|
||||
|
||||
@subsection occt_draw_hist History commands
|
||||
|
||||
Draw module for @ref occt_modalg_hist "History Information support" includes the command to save history into a drawable object and the actual history commands:
|
||||
Draw module for @ref occt_modalg_hist "History Information support" includes the command to save history of modifications performed by Boolean operation or sibling commands into a drawable object and the actual history commands:
|
||||
|
||||
* *savehistory*;
|
||||
* *isdeleted*;
|
||||
@@ -8050,8 +8050,8 @@ Syntax:
|
||||
savehistory : savehistory name
|
||||
~~~~
|
||||
|
||||
If the history of some operation is needed the *savehistory* command should be called after the command performing the operation.
|
||||
If some other operation supporting history will be performed before the history of first operation is saved it will be overwritten with the new history.
|
||||
If the history of shape modifications performed during an operation is needed, the *savehistory* command should be called after the command performing the operation.
|
||||
If another operation supporting history will be performed before the history of the first operation is saved it will be overwritten with the new history.
|
||||
|
||||
Example:
|
||||
~~~~
|
||||
@@ -8102,7 +8102,7 @@ foreach s [join [list [explode b2 v] [explode b2 e] [explode b2 f] ] ] {
|
||||
|
||||
@subsubsection occt_draw_hist_mod modified
|
||||
|
||||
*modified* command returns the shapes Modified from the given shape in the given history. All modified shapes are put into compound. If the shape has not been modified the resulting compound will be empty. Note that if the shape has been modified into a single shape only, it will be returned without enclosure into compound.
|
||||
*modified* command returns the shapes Modified from the given shape in the given history. All modified shapes are put into a compound. If the shape has not been modified, the resulting compound will be empty. Note that if the shape has been modified into a single shape only, it will be returned without enclosure into the compound.
|
||||
|
||||
Syntax:
|
||||
~~~~
|
||||
@@ -8125,7 +8125,7 @@ modified m5 fillet_hist b_5
|
||||
|
||||
@subsubsection occt_draw_hist_gen generated
|
||||
|
||||
*generated* command returns the shapes Generated from the given shape in the given history. All generated shapes are put into compound. If no shapes have been generated from the shape the resulting compound will be empty. Note that if the shape has generated a single shape only, it will be returned without enclosure into compound.
|
||||
*generated* command returns the shapes Generated from the given shape in the given history. All generated shapes are put into a compound. If no shapes have been generated from the shape, the resulting compound will be empty. Note that; if the shape has generated a single shape only, it will be returned without enclosure into the compound.
|
||||
|
||||
Syntax:
|
||||
~~~~
|
||||
@@ -11020,24 +11020,24 @@ tinspector [-plugins {name1 ... [nameN] | all}]
|
||||
[-select {object | name1 ... [nameN]}]
|
||||
[-show {0|1} = 1]
|
||||
~~~~~
|
||||
Starts tool of inspection.
|
||||
Starts inspection tool.
|
||||
Options:
|
||||
* *plugins* enters plugins that should be added in the inspector.
|
||||
Available names are: dfbrowser, vinspector and shapeview.
|
||||
Plugins order will be the same as defined in arguments.
|
||||
Available names are: *dfbrowser*, *vinspector* and *shapeview*.
|
||||
Plugins order will be the same as defined in the arguments.
|
||||
'all' adds all available plugins in the order:
|
||||
DFBrowser, VInspector and ShapeView.
|
||||
If at the first call this option is not used, 'all' option is applyed;
|
||||
If at the first call this option is not used, 'all' option is applied;
|
||||
* *activate* activates the plugin in the tool view.
|
||||
If at the first call this option is not used, the first plugin is activated;
|
||||
* *shape* initializes plugin/s by the shape object. If 'name' is empty, initializes all plugins;
|
||||
* *open* gives the file to the plugin/s. If the plugin is active, after open, update content will be done;
|
||||
* *shape* initializes plugin(s) by the shape object. If 'name' is empty, initializes all plugins;
|
||||
* *open* gives the file to the plugin(s). If the plugin is active after open, the content will be updated;
|
||||
* *update* updates content of the active plugin;
|
||||
* *select* sets the parameter that should be selected in an active tool view.
|
||||
Depending on active tool the parameter is:
|
||||
ShapeView: 'object' is an instance of TopoDS_Shape TShape,
|
||||
DFBrowser: 'name' is an entry of TDF_Label and name2(optionaly) for TDF_Attribute type name,
|
||||
VInspector: 'object' is an instance of AIS_InteractiveObject;
|
||||
Depending on the active tool the parameter is:
|
||||
ShapeView: 'object' is an instance of *TopoDS_Shape TShape*,
|
||||
DFBrowser: 'name' is an entry of *TDF_Label* and 'name2' (optionally) for *TDF_Attribute* type name,
|
||||
VInspector: 'object' is an instance of *AIS_InteractiveObject*;
|
||||
* *show* sets Inspector view visible or hidden. The first call of this command will show it.
|
||||
|
||||
**Example:**
|
||||
|
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 6.0 KiB |
BIN
dox/user_guides/inspector/images/3DView_set_orientation.png
Normal file
After Width: | Height: | Size: 8.3 KiB |
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 38 KiB |
@@ -73,8 +73,8 @@
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="1"
|
||||
inkscape:cx="128.94698"
|
||||
inkscape:cy="215.23058"
|
||||
inkscape:cx="529.17338"
|
||||
inkscape:cy="317.0623"
|
||||
inkscape:document-units="mm"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
@@ -85,10 +85,10 @@
|
||||
inkscape:showpageshadow="false"
|
||||
inkscape:snap-nodes="false"
|
||||
inkscape:snap-global="false"
|
||||
inkscape:window-width="1522"
|
||||
inkscape:window-width="1332"
|
||||
inkscape:window-height="784"
|
||||
inkscape:window-x="1725"
|
||||
inkscape:window-y="5"
|
||||
inkscape:window-x="581"
|
||||
inkscape:window-y="97"
|
||||
inkscape:window-maximized="0" />
|
||||
<metadata
|
||||
id="metadata3732">
|
||||
@@ -200,5 +200,19 @@
|
||||
inkscape:export-filename="D:\OCCT\master_CR29018\dox\user_guides\inspector\images\selection_in_tree_view.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90" />
|
||||
<image
|
||||
y="55.529915"
|
||||
x="167.95375"
|
||||
id="image1593"
|
||||
xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAIAAABLixI0AAAAA3NCSVQICAjb4U/gAAAAsElEQVQ4
|
||||
jcWU4QnEIAyFtWSKCg4hbucmzuQUYufI/fCQeG1VTODer5TCx3tJjA4hKCGBc857zwfFGKFW1tpt
|
||||
Ss65FgffUVPHQkQxFlMdS2stxpLMyPQF9AMRG+6ROzYObz9KuVi+qIw5xVjqFnM6mdF+0ZgrkUdz
|
||||
NOasiFKulciT/aq4xd7N92t9CP9+27rXM2vxDVH7tN68ORXx05P9+3Vv7nfv283mCJRSKSU+SFgf
|
||||
ylJCrIGwaxIAAAAASUVORK5CYII=
|
||||
"
|
||||
style="image-rendering:optimizeSpeed"
|
||||
preserveAspectRatio="none"
|
||||
height="6.6145835"
|
||||
width="6.6145835" />
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 49 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
BIN
dox/user_guides/inspector/images/preferences.png
Normal file
After Width: | Height: | Size: 6.0 KiB |
@@ -57,9 +57,9 @@
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="1"
|
||||
inkscape:cx="314.86686"
|
||||
inkscape:cy="103.10687"
|
||||
inkscape:zoom="4"
|
||||
inkscape:cx="585.11712"
|
||||
inkscape:cy="337.7975"
|
||||
inkscape:document-units="mm"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
@@ -70,8 +70,8 @@
|
||||
fit-margin-bottom="0"
|
||||
inkscape:window-width="1252"
|
||||
inkscape:window-height="826"
|
||||
inkscape:window-x="2069"
|
||||
inkscape:window-y="98"
|
||||
inkscape:window-x="276"
|
||||
inkscape:window-y="50"
|
||||
inkscape:window-maximized="0" />
|
||||
<metadata
|
||||
id="metadata3933">
|
||||
@@ -81,7 +81,7 @@
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
<dc:title />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
@@ -155,5 +155,19 @@
|
||||
inkscape:export-filename="D:\OCCT\master_CR29018\dox\user_guides\inspector\images\selection_in_tree_view.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90" />
|
||||
<image
|
||||
y="102.39896"
|
||||
x="62.498363"
|
||||
id="image5982"
|
||||
xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAIAAABLixI0AAAAA3NCSVQICAjb4U/gAAAAsElEQVQ4
|
||||
jcWU4QnEIAyFtWSKCg4hbucmzuQUYufI/fCQeG1VTODer5TCx3tJjA4hKCGBc857zwfFGKFW1tpt
|
||||
Ss65FgffUVPHQkQxFlMdS2stxpLMyPQF9AMRG+6ROzYObz9KuVi+qIw5xVjqFnM6mdF+0ZgrkUdz
|
||||
NOasiFKulciT/aq4xd7N92t9CP9+27rXM2vxDVH7tN68ORXx05P9+3Vv7nfv283mCJRSKSU+SFgf
|
||||
ylJCrIGwaxIAAAAASUVORK5CYII=
|
||||
"
|
||||
style="image-rendering:optimizeSpeed"
|
||||
preserveAspectRatio="none"
|
||||
height="6.6145835"
|
||||
width="6.6145835" />
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 37 KiB |
BIN
dox/user_guides/inspector/images/shapeview_tree_columns.png
Normal file
After Width: | Height: | Size: 39 KiB |
417
dox/user_guides/inspector/images/treeview_preferences.svg
Normal file
@@ -0,0 +1,417 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="165.36458mm"
|
||||
height="99.483337mm"
|
||||
viewBox="0 0 165.36458 99.483337"
|
||||
version="1.1"
|
||||
id="svg8"
|
||||
sodipodi:docname="treeview_preferences.svg"
|
||||
inkscape:version="0.92.2 (5c3e80d, 2017-08-06)">
|
||||
<defs
|
||||
id="defs2">
|
||||
<linearGradient
|
||||
id="linearGradient920"
|
||||
osb:paint="solid">
|
||||
<stop
|
||||
style="stop-color:#f0f0f0;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop918" />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="0.98994949"
|
||||
inkscape:cx="237.05748"
|
||||
inkscape:cy="217.01184"
|
||||
inkscape:document-units="mm"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
inkscape:window-width="1336"
|
||||
inkscape:window-height="850"
|
||||
inkscape:window-x="276"
|
||||
inkscape:window-y="52"
|
||||
inkscape:window-maximized="1"
|
||||
fit-margin-top="0"
|
||||
fit-margin-left="0"
|
||||
fit-margin-right="0"
|
||||
fit-margin-bottom="0"
|
||||
showborder="true"
|
||||
inkscape:showpageshadow="false" />
|
||||
<metadata
|
||||
id="metadata5">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(-208.35938,-140.66904)">
|
||||
<rect
|
||||
style="opacity:1;fill:#000000;fill-opacity:0;fill-rule:evenodd;stroke:#000000;stroke-width:0.52916667;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
|
||||
id="rect4147-9"
|
||||
width="164.83542"
|
||||
height="98.95417"
|
||||
x="208.62396"
|
||||
y="140.93362"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90" />
|
||||
<rect
|
||||
style="opacity:1;fill:#e3f4d7;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.52916667;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
|
||||
id="rect4159-1"
|
||||
width="155.83388"
|
||||
height="89.326508"
|
||||
x="212.62471"
|
||||
y="145.50125"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90" />
|
||||
<rect
|
||||
style="opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.42238337;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
|
||||
id="rect4195-1-1"
|
||||
width="40.466312"
|
||||
height="11.316654"
|
||||
x="280.74753"
|
||||
y="149.43106"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90" />
|
||||
<rect
|
||||
style="opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.42572066;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
|
||||
id="rect4195-1-5-9"
|
||||
width="41.108295"
|
||||
height="11.316654"
|
||||
x="321.21384"
|
||||
y="149.43106"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:3.38666677px;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.28222224px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
x="291.19687"
|
||||
y="156.27933"
|
||||
id="text5675-5"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan5677-3"
|
||||
x="291.19687"
|
||||
y="156.27933"
|
||||
style="font-size:3.88055563px;line-height:1.25;stroke-width:0.28222224px">Column_1</tspan></text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:3.38666677px;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.28222224px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
x="331.87143"
|
||||
y="156.27933"
|
||||
id="text5679-5"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan5681-0"
|
||||
x="331.87143"
|
||||
y="156.27933"
|
||||
style="font-size:3.88055563px;line-height:1.25;stroke-width:0.28222224px">Column_4</tspan></text>
|
||||
<rect
|
||||
style="opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1.97454143;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
|
||||
id="rect4195-7-0"
|
||||
width="145.13353"
|
||||
height="68.954567"
|
||||
x="217.1886"
|
||||
y="160.74771"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90" />
|
||||
<rect
|
||||
style="opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.5293566;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
|
||||
id="rect4195-1-1-3"
|
||||
width="63.558933"
|
||||
height="11.316654"
|
||||
x="217.1886"
|
||||
y="149.43106"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:3.38666677px;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.28222224px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
x="243.21165"
|
||||
y="156.4707"
|
||||
id="text5675-5-2"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan5677-3-2"
|
||||
x="243.21165"
|
||||
y="156.4707"
|
||||
style="font-size:3.88055563px;line-height:1.25;stroke-width:0.28222224px">Name</tspan></text>
|
||||
<rect
|
||||
style="opacity:1;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.52916667;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
|
||||
id="rect4157-5-8"
|
||||
width="63.558926"
|
||||
height="80.271225"
|
||||
x="217.1886"
|
||||
y="149.43106"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90" />
|
||||
<rect
|
||||
style="opacity:1;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.52916667;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
|
||||
id="rect4157-5-8-8"
|
||||
width="40.466305"
|
||||
height="80.271225"
|
||||
x="280.74753"
|
||||
y="149.43106"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90" />
|
||||
<rect
|
||||
style="opacity:1;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.52916667;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
|
||||
id="rect4157-5-8-8-8"
|
||||
width="41.108303"
|
||||
height="80.271225"
|
||||
x="321.21384"
|
||||
y="149.43106"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90" />
|
||||
<rect
|
||||
style="opacity:1;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.1984375;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
|
||||
id="rect4157-5-8-1"
|
||||
width="63.558929"
|
||||
height="11.316656"
|
||||
x="217.1886"
|
||||
y="149.43106"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90" />
|
||||
<rect
|
||||
style="opacity:1;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.1984375;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
|
||||
id="rect4157-5-8-1-0"
|
||||
width="40.466309"
|
||||
height="11.316656"
|
||||
x="280.74753"
|
||||
y="149.43106"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90" />
|
||||
<rect
|
||||
style="opacity:1;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.1984375;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
|
||||
id="rect4157-5-8-1-7"
|
||||
width="41.108307"
|
||||
height="11.316656"
|
||||
x="321.21384"
|
||||
y="149.43106"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90" />
|
||||
<rect
|
||||
style="opacity:1;fill:#f0f0f0;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.44990167;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
|
||||
id="rect4157-5"
|
||||
width="38.957039"
|
||||
height="58.495327"
|
||||
x="307.89423"
|
||||
y="158.80739"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:3.38666677px;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.28222224px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
x="317.94843"
|
||||
y="174.62115"
|
||||
id="text5675-5-4"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan5677-3-6"
|
||||
x="317.94843"
|
||||
y="174.62115"
|
||||
style="font-size:3.88055563px;line-height:1.25;stroke-width:0.28222224px">Column_1</tspan></text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:3.38666677px;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.28222224px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
x="317.78735"
|
||||
y="165.06331"
|
||||
id="text5675-5-2-9"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan5677-3-2-1"
|
||||
x="317.78735"
|
||||
y="165.06331"
|
||||
style="font-size:3.88055563px;line-height:1.25;stroke-width:0.28222224px">Name</tspan></text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:3.38666677px;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.28222224px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
x="317.94843"
|
||||
y="184.37038"
|
||||
id="text5679-5-9"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan5681-0-2"
|
||||
x="317.94843"
|
||||
y="184.37038"
|
||||
style="font-size:3.88055563px;line-height:1.25;stroke-width:0.28222224px">Column_2</tspan></text>
|
||||
<rect
|
||||
style="opacity:1;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.1984375;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
|
||||
id="rect4157-5-8-1-8"
|
||||
width="38.957031"
|
||||
height="9.7492247"
|
||||
x="307.89423"
|
||||
y="158.80739"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90" />
|
||||
<rect
|
||||
style="opacity:1;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.1984375;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
|
||||
id="rect4157-5-8-1-8-8"
|
||||
width="38.957035"
|
||||
height="9.7492256"
|
||||
x="307.89423"
|
||||
y="168.55661"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90" />
|
||||
<rect
|
||||
style="opacity:1;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.1984375;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
|
||||
id="rect4157-5-8-1-8-7"
|
||||
width="38.957035"
|
||||
height="9.7492256"
|
||||
x="307.89423"
|
||||
y="178.30583"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90" />
|
||||
<rect
|
||||
style="opacity:1;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.1984375;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
|
||||
id="rect4157-5-8-1-8-4"
|
||||
width="38.957035"
|
||||
height="9.7492256"
|
||||
x="307.89423"
|
||||
y="188.05505"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90" />
|
||||
<rect
|
||||
style="opacity:1;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.1984375;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
|
||||
id="rect4157-5-8-1-8-2"
|
||||
width="38.957035"
|
||||
height="9.7492256"
|
||||
x="307.89423"
|
||||
y="197.80428"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90" />
|
||||
<rect
|
||||
style="opacity:1;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.1984375;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.29879999;stroke-opacity:1"
|
||||
id="rect4157-5-8-1-8-71"
|
||||
width="38.957035"
|
||||
height="9.7492256"
|
||||
x="307.89423"
|
||||
y="207.5535"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90" />
|
||||
<image
|
||||
y="170.78539"
|
||||
x="310.04617"
|
||||
id="image1119"
|
||||
xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAIAAAAC64paAAAAA3NCSVQICAjb4U/gAAAAi0lEQVQ4 jWOccOIbA7mAiWydI0Lz+yd3yNR8bHHblvbEL2+fk6z52OK2uye2W8VW8ghL4tP8/skdNOfBdSpb eBFw9sWtc3dOyIHrx6MTi2ar2GpeYUmIfvw6GRgYGDGT569vX3ZPzH335A4DAwMenVhsZmBgYOPi cc2fLCSjgl8ndpuJB0MieQ4bzQCA/UWjCjrjVAAAAABJRU5ErkJggg== "
|
||||
style="image-rendering:optimizeSpeed"
|
||||
preserveAspectRatio="none"
|
||||
height="5.2916665"
|
||||
width="5.2916665" />
|
||||
<image
|
||||
y="161.03616"
|
||||
x="310.04617"
|
||||
id="image1119-4"
|
||||
xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAIAAAAC64paAAAAA3NCSVQICAjb4U/gAAAAi0lEQVQ4 jWOccOIbA7mAiWydI0Lz+yd3yNR8bHHblvbEL2+fk6z52OK2uye2W8VW8ghL4tP8/skdNOfBdSpb eBFw9sWtc3dOyIHrx6MTi2ar2GpeYUmIfvw6GRgYGDGT569vX3ZPzH335A4DAwMenVhsZmBgYOPi cc2fLCSjgl8ndpuJB0MieQ4bzQCA/UWjCjrjVAAAAABJRU5ErkJggg== "
|
||||
style="image-rendering:optimizeSpeed"
|
||||
preserveAspectRatio="none"
|
||||
height="5.2916665"
|
||||
width="5.2916665" />
|
||||
<image
|
||||
y="200.03305"
|
||||
x="310.04617"
|
||||
id="image1119-7"
|
||||
xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAIAAAAC64paAAAAA3NCSVQICAjb4U/gAAAAi0lEQVQ4 jWOccOIbA7mAiWydI0Lz+yd3yNR8bHHblvbEL2+fk6z52OK2uye2W8VW8ghL4tP8/skdNOfBdSpb eBFw9sWtc3dOyIHrx6MTi2ar2GpeYUmIfvw6GRgYGDGT569vX3ZPzH335A4DAwMenVhsZmBgYOPi cc2fLCSjgl8ndpuJB0MieQ4bzQCA/UWjCjrjVAAAAABJRU5ErkJggg== "
|
||||
style="image-rendering:optimizeSpeed"
|
||||
preserveAspectRatio="none"
|
||||
height="5.2916665"
|
||||
width="5.2916665" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:3.38666677px;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.28222224px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
x="317.94843"
|
||||
y="194.1196"
|
||||
id="text5679-5-9-2"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan5681-0-2-3"
|
||||
x="317.94843"
|
||||
y="194.1196"
|
||||
style="font-size:3.88055563px;line-height:1.25;stroke-width:0.28222224px">Column_3</tspan></text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:3.38666677px;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.28222224px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
x="317.94843"
|
||||
y="203.86882"
|
||||
id="text5679-5-9-4"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan5681-0-2-9"
|
||||
x="317.94843"
|
||||
y="203.86882"
|
||||
style="font-size:3.88055563px;line-height:1.25;stroke-width:0.28222224px">Column_4</tspan></text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:3.38666677px;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.28222224px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
x="317.94843"
|
||||
y="213.61804"
|
||||
id="text5679-5-9-9"
|
||||
inkscape:export-filename="F:\OCC\master_CR29018\dox\user_guides\inspector\images\3DView.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan5681-0-2-4"
|
||||
x="317.94843"
|
||||
y="213.61804"
|
||||
style="font-size:3.88055563px;line-height:1.25;stroke-width:0.28222224px">Column_5</tspan></text>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 22 KiB |
BIN
dox/user_guides/inspector/images/vinspector_tree_columns.png
Normal file
After Width: | Height: | Size: 36 KiB |
@@ -5,41 +5,39 @@ Inspector {#occt_user_guides__inspector}
|
||||
|
||||
@section occt_inspector_1 Introduction
|
||||
|
||||
This manual explains how to use Inspector.
|
||||
This manual explains how to use the Inspector.
|
||||
|
||||
@subsection occt_inspector_1_1 Overview
|
||||
Inspector is a Qt-based library that provides functionality to interactively inspect low-level content of the OCAF data model, OCCT viewer and Modelisation Data.
|
||||
Inspector is a Qt-based library that provides functionality to interactively inspect low-level content of the OCAF data model, OCCT viewer and Modeling Data.
|
||||
This component is aimed to assist the developers of OCCT-based applications to debug the problematic situations that occur in their applications.
|
||||
|
||||
Inspector has a plugin-oriented architecture. The current release contains the following plugins:
|
||||
|
||||
| Plugin | OCCT component | Root class of OCCT investigated component |
|
||||
| :----- | :----- | :----- |
|
||||
| @ref occt_inspector_2_2 "DFBrowser"| OCAF | TDocStd_Application |
|
||||
| @ref occt_inspector_2_3 "VInspector"| Visualization | AIS_InteractiveContext |
|
||||
| @ref occt_inspector_2_4 "ShapeView"| Modelisation Data | TopoDS_Shape |
|
||||
| @ref occt_inspector_2_2 "DFBrowser"| OCAF | *TDocStd_Application* |
|
||||
| @ref occt_inspector_2_3 "VInspector"| Visualization | *AIS_InteractiveContext* |
|
||||
| @ref occt_inspector_2_4 "ShapeView"| Modeling Data | *TopoDS_Shape* |
|
||||
|
||||
|
||||
Each plugin implements logic of a corresponding OCCT component.
|
||||
|
||||
Each of the listed plugins is embeded in the common framework.
|
||||
The user is able to manage which plugins should be loaded by Inspector.
|
||||
Also he can extend number of plugins by implementing a new plugin.
|
||||
Each of the listed plugins is embedded in the common framework, thus it is possible to manage, which plugins should be loaded by the Inspector, and to extend their number by implementing a new plugin.
|
||||
|
||||
|
||||
@subsection occt_inspector_1_3 Getting started
|
||||
|
||||
There are two launch modes:
|
||||
1. Launch **TInspectorEXE** executable sample. For more details see @ref occt_inspector_6 "TInspectorEXE" section;
|
||||
2. Launch DRAW, load plugin INSPECTOR, and use **tinspector** command.
|
||||
For more details see @ref occt_inspector_7 "Launch in DRAW Test Harness" section.
|
||||
1. Launch **TInspectorEXE** executable sample. For more details see @ref occt_inspector_4_1 "TInspectorEXE" section;
|
||||
2. Launch DRAW, load plugin INSPECTOR, and use *tinspector* command.
|
||||
For more details see @ref occt_inspector_4_2 "Launch in DRAW Test Harness" section.
|
||||
|
||||
|
||||
Note. If you have no Inspector library in your build directory, please make sure that OCCT is compiled with *BUILD_Inspector*
|
||||
option ON. For more details see @ref occt_inspector_4 "Build procedure".
|
||||
Note. If you have no Inspector library in your build directory, please, make sure that OCCT is compiled with *BUILD_Inspector*
|
||||
option ON. For more details see @ref occt_inspector_5 "Build procedure".
|
||||
|
||||
|
||||
@section occt_inspector_2 Inspector
|
||||
@section occt_inspector_2 Inspector Plugins
|
||||
|
||||
@subsection occt_inspector_2_1 Overview
|
||||
|
||||
@@ -55,9 +53,9 @@ Inspector consists of the following components:
|
||||
|
||||
@figure{dfbrowser.png, "DFBrowser"}
|
||||
|
||||
This plugin visualizes content of TDocStd_Application in a tree view. It shows documents of the application,
|
||||
hierarchy of TDF_Labels, content of TDF_Attributes and interconnection between attributes (e.g. references).
|
||||
Additionally it has 3D view to visualize TopoDS_Shape elements stored in the document.
|
||||
This plugin visualizes the content of *TDocStd_Application* in a tree view. It shows application documents,
|
||||
the hierarchy of *TDF_Labels*, the content of *TDF_Attributes* and interconnection between attributes (e.g. references).
|
||||
Additionally there is a 3D view to visualize *TopoDS_Shape* elements stored in the document.
|
||||
|
||||
@subsubsection occt_inspector_2_2_2 Elements
|
||||
|
||||
@@ -69,96 +67,95 @@ Each OCAF element has own tree view item:
|
||||
|
||||
| Type | Tree item | Text | Description |
|
||||
| :----- | :----- | :----- | :----- |
|
||||
| TDocStd_Application | Application | TDocStd_Application | It is the root of tree view. Children are documents.|
|
||||
| TDocStd_Document | Document | entry : name | It is a child of Application item. Children are Labels and Attributes items.<br> Text view is an entry of the root label and the value of TDataStd_Name attribute for the label if it exists. |
|
||||
| TDF_Label | Label | entry : name | It is a child of a Document or another Label item. Children and text view are the same as for Document item. |
|
||||
| TDF_Attribute | Attribute | attribute type [additional information] | It is a child of a Label. It has no children. <br> Text view is the attribute type (DynamicType()->Name() of TDF_Attribute) and additional information (a combination of attribute values) |
|
||||
| *TDocStd_Application* | Application | *TDocStd_Application* | The root of tree view. Its children are documents.|
|
||||
| *TDocStd_Document* | Document | entry : name | A child of *Application* item. Its children are *Label* and *Attribute* items.<br> Text view is an entry of the root label and the value of *TDataStd_Name* attribute for the label if it exists. |
|
||||
| *TDF_Label* | Label | entry : name | A child of a *Document* or another *Label* item. Its children and text view are the same as for Document item. |
|
||||
| *TDF_Attribute* | Attribute | attribute type [additional information] | A child of a *Label*. It has no children. <br> Text view is the attribute type *(DynamicType()->Name()* of *TDF_Attribute*) and additional information (a combination of attribute values). |
|
||||
|
||||
|
||||
Additional information of TDF_Attributes:
|
||||
Additional information about TDF_Attributes:
|
||||
|
||||
| Type | Text |
|
||||
| :----- | :----- |
|
||||
| TDocStd_Owner | [storage format] |
|
||||
| TDataStd_AsciiString,<br> TDataStd_Name,<br> TDataStd_Real,<br> @ref occt_attribute_simple_types "other Simple types" | [value] |
|
||||
| TDataStd_BooleanList,<br> TDataStd_ExtStringList,<br> @ref occt_attribute_list_types "other List types" | [value_1 ... value_n] |
|
||||
| TDataStd_BooleanArray,<br> TDataStd_ByteArray,<br> @ref occt_attribute_array_types "other Array types" | [value_1 ... value_n] |
|
||||
| TDataStd_TreeNode | [tree node ID ==> Father()->Label()] (if it has father) or <br> [tree node ID <== First()->Label()] (if it has NO father)|
|
||||
| TDataStd_TreeNode(XDE) | [@ref occt_attribute_xde_tree_node_id "XDE tree node ID" ==> Father()->Label()] (if it has father), <br> [@ref occt_attribute_xde_tree_node_id "XDE tree Node ID" <== label_1, ..., label_n] (if it has NO father)|
|
||||
| TNaming_NamedShape | [shape type : evolution] |
|
||||
| TNaming_UsedShapes | [map extent] |
|
||||
| *TDocStd_Owner* | [storage format] |
|
||||
| *TDataStd_AsciiString*,<br> *TDataStd_Name*,<br> *TDataStd_Real*,<br> other *Simple* type attributes | [value] |
|
||||
| *TDataStd_BooleanList*,<br> *TDataStd_ExtStringList*,<br> other *List* attributes | [value_1 ... value_n] |
|
||||
| *TDataStd_BooleanArray*,<br> *TDataStd_ByteArray*,<br> other *Array* type attributes | [value_1 ... value_n] |
|
||||
| *TDataStd_TreeNode* | [tree node ID ==> Father()->Label()] (if it has a father) or <br> [tree node ID <== First()->Label()] (if it has NO father)|
|
||||
| *TDataStd_TreeNode(XDE)* | [XDE tree node ID ==> Father()->Label()] (if it has a father), <br> [XDE tree Node ID <== label_1, ..., label_n] (if it has NO father)|
|
||||
| *TNaming_NamedShape* | [shape type : evolution] |
|
||||
| *TNaming_UsedShapes* | [map extent] |
|
||||
|
||||
|
||||
Custom color of items:
|
||||
|
||||
| OCAF element Type | Color |
|
||||
| :----- | :----- |
|
||||
| TDF_Label | <b>dark green</b>, if the label has TDataStd_Name attribute, <br><b>light grey</b> if the label is empty (has no attributes on all levels of hierarchy),<br> <b>black</b> otherwise |
|
||||
| TNaming_NamedShape | <b>dark gray</b> for TopAbs_FORWARD orientation of TopoDS_Shape, <br> <b>gray</b> for TopAbs_REVERSED orientation of TopoDS_Shape, <br> <b>black</b> for other orientation |
|
||||
| *TDF_Label* | <b>dark green</b>, if the label has *TDataStd_Name* attribute, <br><b>light grey</b> if the label is empty (has no attributes on all levels of hierarchy),<br> <b>black</b> otherwise. |
|
||||
| *TNaming_NamedShape* | <b>dark gray</b> for *TopAbs_FORWARD* orientation of *TopoDS_Shape*, <br> <b>gray</b> for *TopAbs_REVERSED* orientation of *TopoDS_Shape*, <br> <b>black</b> for other orientation. |
|
||||
|
||||
|
||||
Context popup menu:
|
||||
Context pop-up menu:
|
||||
| Action | Functionality |
|
||||
| :----- | :----- |
|
||||
| Expand | Expands the next two levels under the selected item |
|
||||
| Expand All | Expands the whole tree of the selected item |
|
||||
| Collapse All | Collapses the whole tree of the selected item |
|
||||
| Expand | Expands the next two levels under the selected item. |
|
||||
| Expand All | Expands the whole tree of the selected item. |
|
||||
| Collapse All | Collapses the whole tree of the selected item. |
|
||||
|
||||
|
||||
<b>Property Panel</b>
|
||||
|
||||
Property panel is used to display content of Label or Attribute tree view items.
|
||||
This control is used for content of Label or Attribute tree view items or Search result view.
|
||||
Information is usually shown in one or several tables.
|
||||
Property panel is used to display the content of *Label* or *Attribute* tree view items or Search result view.
|
||||
The information is usually shown in one or several tables.
|
||||
|
||||
TDF_Attribute has the following content in Property Panel:
|
||||
*TDF_Attribute* has the following content in the Property Panel:
|
||||
|
||||
<table>
|
||||
<tr><th>Type</th><th>Description</th><th>Content</th></tr>
|
||||
<tr><td>TDF_Label</td>
|
||||
<tr><td><i>TDF_Label</i></td>
|
||||
<td> a table of [entry or attribute name, value]</td>
|
||||
<td>@figure{property_panel_label.png, "",140}</td></tr>
|
||||
<tr><td>TDocStd_Owner,<br> @ref occt_attribute_simple_types "Simple types", <br> @ref occt_attribute_list_types "List types"</td>
|
||||
<tr><td><i>TDocStd_Owner</i>,<br> Simple type attributes, <br> List type attributes</td>
|
||||
<td>a table of [method name, value]</td>
|
||||
<td>@figure{property_panel_simple_type.png, "",140}</td></tr>
|
||||
<tr><td>TDataStd_BooleanArray,<br> TDataStd_ByteArray,<br> @ref occt_attribute_array_types "other Array types"</td>
|
||||
<td>2 controls: <br> * a table of [array bound, value], <br> * table of [method name, value]</td>
|
||||
<tr><td><i>TDataStd_BooleanArray</i>,<br> <i>TDataStd_ByteArray</i>,<br> other Array type attributes</td>
|
||||
<td>2 controls: <br> - a table of [array bound, value], <br> - a table of [method name, value] </td>
|
||||
<td>@figure{property_panel_array.png, "",140}</td></tr>
|
||||
<tr><td>TDataStd_TreeNode</td>
|
||||
<td>2 controls: <br> * a table of [Tree ID, value] (visible only if Tree ID() != ID()), <br> * a tree view of tree nodes starting from Root() of the tree node. The current tree node has <b>dark blue</b> text.</td>
|
||||
<tr><td><i>TDataStd_TreeNode</i></td>
|
||||
<td>2 controls: <br> - a table of [Tree ID, value] (visible only if Tree ID() != ID() ), <br> - a tree view of tree nodes starting from *Root()* of the tree node. The current tree node has <b>dark blue</b> text.</td>
|
||||
<td>@figure{property_panel_tree_node.png, "",140} </td></tr>
|
||||
<tr><td>TDataStd_NamedData</td>
|
||||
<tr><td><i>TDataStd_NamedData</i></td>
|
||||
<td>tab bar of attribute elements, each tab has a table of [name, value]</td>
|
||||
<td>@figure{property_panel_named_data.png, "",140}</td></tr>
|
||||
<tr><td>TNaming_UsedShapes</td>
|
||||
<td>a table of all the shapes handled by the framework</td>
|
||||
<tr><td><i>TNaming_UsedShapes</i></td>
|
||||
<td>a table of all shapes handled by the framework</td>
|
||||
<td>@figure{property_panel_tnaming_used_shapes.png, "",140}</td></tr>
|
||||
<tr><td>TNaming_NamedShape</td>
|
||||
<td>2 controls: <br> * a table of [method name, value] including CurrentShape/OriginalShape methods result of TNaming_Tools, <br> * an evolution table. <br> Tables contain buttons for @ref occt_shape_export "TopoDS_Shape export".</td>
|
||||
<tr><td><i>TNaming_NamedShape</i></td>
|
||||
<td>2 controls: <br> - a table of [method name, value] including CurrentShape/OriginalShape methods result of <i>TNaming_Tools</i>, <br> - an evolution table. <br> Tables contain buttons for @ref occt_shape_export "TopoDS_Shape export".</td>
|
||||
<td>@figure{property_panel_tnaming_named_shape.png, "",140}</td></tr>
|
||||
<tr><td>TNaming_Naming</td>
|
||||
<td>2 controls: <br> * a table of TNaming_Name vlaues,<br> * a table of [method name, value]</td>
|
||||
<tr><td><i>TNaming_Naming</i></td>
|
||||
<td>2 controls: <br> - a table of <i>TNaming_Name</i> values,<br> - a table of [method name, value]</td>
|
||||
<td>@figure{property_panel_tnaming_naming.png, "",140}</td></tr>
|
||||
</table>
|
||||
|
||||
|
||||
<b>Dump view</b>
|
||||
|
||||
@figure{dump_attribute.png, "Dump of TDF_Attribute"}
|
||||
@figure{dump_attribute.png, "Dump of TDF_Attribute",200}
|
||||
|
||||
Dump view shows result of <b>TDF_Attribute::Dump()</b> or <b>TDF_Label::Dump()</b> of selected tree view item.
|
||||
Dump view shows the result of <b>TDF_Attribute::Dump()</b> or <b>TDF_Label::Dump()</b> of the selected tree view item.
|
||||
|
||||
<b>3D view</b>
|
||||
|
||||
3D View visualizes TopoDS_Shape elements of OCAF attribute via AIS facilities.
|
||||
3D View visualizes *TopoDS_Shape* elements of OCAF attribute via AIS facilities.
|
||||
|
||||
DFBrowser creates two kinds presentations depending on the selection place:
|
||||
DFBrowser creates two kinds of presentations depending on the selection place:
|
||||
|
||||
<table>
|
||||
<tr><th>Kind</th><th>Source object</th><th>Visualization propeties</th><th>View</th></tr>
|
||||
<tr><th>Kind</th><th>Source object</th><th>Visualization properties</th><th>View</th></tr>
|
||||
<tr><td>Main presentation</td>
|
||||
<td>Tree view item:<br> TPrsStd_AISPresentation,<br> TNaming_NamedShape,<br> TNaming_Naming</td>
|
||||
<td>Color: a default color for shape type of the current TopoDS_Shape</td>
|
||||
<td>Tree view item:<br> *TPrsStd_AISPresentation*,<br> *TNaming_NamedShape*,<br> *TNaming_Naming*</td>
|
||||
<td>Color: a default color for shape type of the current *TopoDS_Shape*.</td>
|
||||
<td>@figure{display_main_presentation.png, "",100}</td></tr>
|
||||
<tr><td>Additional presentation</td>
|
||||
<td>References in Property panel</td>
|
||||
@@ -171,8 +168,8 @@ DFBrowser creates two kinds presentations depending on the selection place:
|
||||
<b>Tree Navigation</b>
|
||||
|
||||
Tree Navigation shows a path to the item selected in the tree view.
|
||||
The path is a sequence of label entries and attribute type name.
|
||||
Each element in the path is selectable - the user can click on it to select the corresponding tree view item.
|
||||
The path is a sequence of label entries and attribute type names.
|
||||
Each element in the path is selectable - simply click on it to select the corresponding tree view item.
|
||||
|
||||
Navigation control has buttons to go to the previous and the next selected tree view items.
|
||||
|
||||
@@ -184,14 +181,14 @@ Update button synchronizes content of tree view to the current content of OCAF d
|
||||
<b>Search</b>
|
||||
|
||||
The user can search OCAF element by typing:
|
||||
* TDF_Label entry,
|
||||
* TDF_Attribute name,
|
||||
* TDataStd_Name and TDataStd_Comment attributes value.
|
||||
* *TDF_Label* entry,
|
||||
* *TDF_Attribute* name,
|
||||
* *TDataStd_Name* and *TDataStd_Comment* attributes value.
|
||||
|
||||
@figure{search.png,"Search"}
|
||||
@figure{search.png,"Search",360}
|
||||
|
||||
As soon as the user confirms the typed criteria, the Property panel is filled by all satisfied values.
|
||||
The user can click a value to hightligt the corresponding tree view item. By double click the item will be selected.
|
||||
The user can click a value to highlight the corresponding tree view item. By double click the item will be selected.
|
||||
|
||||
|
||||
@subsubsection occt_inspector_2_2_3 Elements cooperation
|
||||
@@ -199,22 +196,22 @@ The user can click a value to hightligt the corresponding tree view item. By dou
|
||||
<b>Tree item selection</b>
|
||||
|
||||
Selection of tree view item updates content of the following controls:
|
||||
* Navigation line
|
||||
* Property Panel
|
||||
* 3D View (if it is possible to create an interactive presentation)
|
||||
* Dump View
|
||||
* Navigation line;
|
||||
* Property Panel;
|
||||
* 3D View (if it is possible to create an interactive presentation);
|
||||
* Dump View.
|
||||
|
||||
@figure{dfbrowser_selection_in_tree_view.svg,"",360}
|
||||
|
||||
<b>Property Panel item selection </b>
|
||||
|
||||
If property panel shows content of TDF_Label:
|
||||
* selection of the table row hightlights the corresponding item in tree view,
|
||||
* double click on the table row selects this item in tree view.
|
||||
If the property panel shows content of *TDF_Label*:
|
||||
* selection of the table row highlights the corresponding item in the tree view,
|
||||
* double click on the table row selects this item in the tree view.
|
||||
|
||||
If property panel shows content of TDF_Attribute that has reference to another attribute, selection of this reference:
|
||||
* highlights the referenced item in TreeView,
|
||||
* displays additional presentation in 3D view if it can be created.
|
||||
If the property panel shows content of *TDF_Attribute* that has reference to another attribute, selection of this reference:
|
||||
* highlights the referenced item in the tree view,
|
||||
* displays additional presentation in the 3D view if it can be created.
|
||||
|
||||
@figure{property_panel_item_selection.svg,"",360}
|
||||
|
||||
@@ -222,28 +219,28 @@ Attributes having references:
|
||||
|
||||
| Type | Reference | Additional presentation
|
||||
| :----- | :----- | :----- |
|
||||
| TDF_Reference | TDF_Label | |
|
||||
| TDataStd_ReferenceArray, <br> TDataStd_ReferenceList, <br> TNaming_Naming | one or several TDF_Label in a container | |
|
||||
| TDataStd_TreeNode | TDF_Label | |
|
||||
| TNaming_NamedShape | TDF_Label in Evolution table | selected TopoDS_Shapes in property panel tables |
|
||||
| TNaming_UsedShapes | one or several TNaming_NamedShape | TopoDS_Shapes of selected TNaming_NamedShape |
|
||||
| *TDF_Reference* | *TDF_Label* | |
|
||||
| *TDataStd_ReferenceArray*, <br> *TDataStd_ReferenceList*, <br> *TNaming_Naming* | One or several *TDF_Label* in a container. | |
|
||||
| *TDataStd_TreeNode* | *TDF_Label* | |
|
||||
| *TNaming_NamedShape* | *TDF_Label* in Evolution table | *TopoDS_Shapes* selected in the property panel tables. |
|
||||
| *TNaming_UsedShapes* | one or several *TNaming_NamedShape* | *TopoDS_Shapes* of the selected *TNaming_NamedShape*. |
|
||||
|
||||
|
||||
@subsubsection occt_shape_export TopoDS_Shape export
|
||||
|
||||
Property panel of TNaming_NamedShape attribute has controls to export TopoDS_Shape to:
|
||||
* BREP. The save file dialog is started to enter the result file name,
|
||||
* @ref occt_inspector_2_4 "ShapeView" plugin. Dialog about exporting element to ShapeView is shown with a possibility to activate this plugin immediatelly.
|
||||
Property panel of *TNaming_NamedShape* attribute has controls to export *TopoDS_Shape* to:
|
||||
* BREP. **Save file** dialog is open to enter the result file name,
|
||||
* @ref occt_inspector_2_4 "ShapeView" plugin. The dialog for exporting element to ShapeView allows activating this plugin immediately.
|
||||
|
||||
|
||||
@subsection occt_inspector_2_3 VInspector Plugin
|
||||
|
||||
@subsubsection occt_inspector_2_3_1 Overview
|
||||
|
||||
@figure{vinspector.png, "VInspector"}
|
||||
@figure{vinspector.png, "VInspector",360}
|
||||
|
||||
It visualizes interactive objects displayed in AIS_InteractiveContext in a tree view with columputed selection
|
||||
components for each presentation. It shows the selected elements in the context and allows to select these elements.
|
||||
This plugin visualizes interactive objects displayed in *AIS_InteractiveContext* in a tree view with computed selection
|
||||
components for each presentation. It shows the selected elements in the context and allows selecting these elements.
|
||||
|
||||
@subsubsection occt_inspector_2_3_2 Elements
|
||||
|
||||
@@ -251,81 +248,85 @@ components for each presentation. It shows the selected elements in the context
|
||||
|
||||
<b>Presentations tree view</b>
|
||||
|
||||
It shows presentations and selection computed of them. Also, the view has columns with information about state of visualization elements.
|
||||
This view shows presentations and selection computed on them. Also, the view has columns with information about the state of visualization elements.
|
||||
|
||||
VInspector tree items.
|
||||
|
||||
| Type | Description |
|
||||
| :----- | :----- |
|
||||
| AIS_InteractiveContext | It is the root of tree view. Children are interactive objects obtained by *DisplayedObjects* and *ErasedObjects* methods.|
|
||||
| AIS_InteractiveObject | It is a child of AIS_InteractiveContext item. Children are SelectMgr_Selection obtained by iteration on *CurrentSelection* |
|
||||
| SelectMgr_Selection | It is a child of AIS_InteractiveObject. Children are SelectMgr_SensitiveEntity obtaining by iteration on *Sensitive* |
|
||||
| SelectMgr_SensitiveEntity | It is a child of SelectMgr_Selection. Children are SelectMgr_SensitiveEntity obtaining by iteration on *OwnerId* |
|
||||
| SelectBasics_EntityOwner | It is a child SelectMgr_SensitiveEntity. It has no children. |
|
||||
| *AIS_InteractiveContext* | The root of tree view. Its children are interactive objects obtained by *DisplayedObjects* and *ErasedObjects* methods.|
|
||||
| *AIS_InteractiveObject* | A child of *AIS_InteractiveContext* item. Its children are *SelectMgr_Selection* obtained by iteration on *CurrentSelection*. |
|
||||
| *SelectMgr_Selection* | A child of *AIS_InteractiveObject*. Its children are *SelectMgr_SensitiveEntity* obtaining by iteration on *Sensitive*. |
|
||||
| *SelectMgr_SensitiveEntity* | A child of *SelectMgr_Selection*. Its children are *SelectMgr_SensitiveEntity* obtaining by iteration on *OwnerId*. |
|
||||
| *SelectBasics_EntityOwner* | A child of *SelectMgr_SensitiveEntity*. It has no children. |
|
||||
|
||||
|
||||
Custom color of tree view items:
|
||||
|
||||
| OCAF element Type | Column | What | Color |
|
||||
| :----- | :----- | :----- | :----- |
|
||||
| AIS_InteractiveObject | 0 | Text | <b>dark gray</b>, it is in *ErasedObjects* list of AIS_InteractiveContext,<br> <b>black</b> otherwise |
|
||||
| AIS_InteractiveObject, <br> SelectMgr_SensitiveEntity, <br> SelectBasics_EntityOwner| 1 | Background | <b>dark blue</b>, if there is a selected owner under the item, <br> <b>black</b> otherwise |
|
||||
| SelectMgr_Selection,<br> SelectMgr_SensitiveEntity,<br> SelectBasics_EntityOwner| all | Text | <b>dark gray</b>, if *SelectionState* of SelectMgr_Selection is not *SelectMgr_SOS_Activated*,<br> <b>black</b> otherwise |
|
||||
| *AIS_InteractiveObject* | 0 | Text | <b>dark gray</b> in *ErasedObjects* list of *AIS_InteractiveContext*,<br> <b>black</b> otherwise |
|
||||
| *AIS_InteractiveObject*, <br> *SelectMgr_SensitiveEntity*, <br> *SelectBasics_EntityOwner*| 1 | Background | <b>dark blue</b>, if there is a selected owner under the item, <br> <b>black</b> otherwise |
|
||||
| *SelectMgr_Selection*,<br> *SelectMgr_SensitiveEntity*,<br> *electBasics_EntityOwner* | all | Text | <b>dark gray</b>, if *SelectionState* of *SelectMgr_Selection* is not *SelectMgr_SOS_Activated*,<br> <b>black</b> otherwise |
|
||||
|
||||
|
||||
Context popup menu in tree view:
|
||||
| Action | Item | Functionality |
|
||||
| :----- | :----- | :----- |
|
||||
| Export to ShapeView | AIS_InteractiveObject | Exports TopoDS_Shape of AIS_Interactive presentation to ShapeView plugin. <br> It should be AIS_Shape presentation and ShapeView plugin should be registered in Inspector<br> Dialog about exporting element to ShapeView is shown with a possibility to activate this plugin immediatelly. |
|
||||
| Show | AIS_InteractiveObject | *Display* presentation in AIS_InteractiveContext |
|
||||
| Hide | AIS_InteractiveObject | *Erase* presentation from AIS_InteractiveContext |
|
||||
| Export to ShapeView | *AIS_InteractiveObject* | Exports *TopoDS_Shape* of the *AIS_Interactive* presentation to ShapeView plugin. <br> It should be *AIS_Shape* presentation and ShapeView plugin should be registered in Inspector<br> Dialog about exporting element to ShapeView is shown with a possibility to activate this plugin immediately. |
|
||||
| Show | *AIS_InteractiveObject* | Displays presentation in *AIS_InteractiveContext*. |
|
||||
| Hide | *AIS_InteractiveObject* | Erases presentation from *AIS_InteractiveContext*. |
|
||||
|
||||
<b>Update</b>
|
||||
|
||||
It synchronizes content of the plugin to the current state of AIS_InteractiveContext.
|
||||
It updates the presence of items and the current selection for the items.
|
||||
This button synchronizes the plugin content with the current state of *AIS_InteractiveContext* and updates the presence of items and their current selection.
|
||||
|
||||
<b>Selection controls</b>
|
||||
|
||||
Selection controls switch on/off the posibility to set selection in the context from VInspector plugin.
|
||||
Selection controls switch on/off the possibility to set selection in the context from VInspector plugin.
|
||||
|
||||
| Action | Tree view item | Functionality |
|
||||
| :----- | :----- | :----- |
|
||||
| Select Presentations | AIS_InteractiveObject | Calls *AddOrRemoveSelected* of interactive object for the selected item |
|
||||
| Select Owners | SelectMgr_EntityOwner or <br> SelectMgr_SensitiveEntity | Calls *AddOrRemoveSelected* of SelectMgr_EntityOwner for the selected item |
|
||||
| Select Presentations | *AIS_InteractiveObject* | Calls *AddOrRemoveSelected* of interactive object for the selected item. |
|
||||
| Select Owners | *SelectMgr_EntityOwner* or <br> *SelectMgr_SensitiveEntity* | Calls *AddOrRemoveSelected* of *SelectMgr_EntityOwner* for the selected item. |
|
||||
|
||||
Please note, that the initial selection in context will be cleared.
|
||||
Please, note that the initial selection in the context will be cleared.
|
||||
If the button is toggled, the button selection is active. Only one button may be toggled at the moment.
|
||||
|
||||
|
||||
<b>History view</b>
|
||||
|
||||
At present the History view is under implementation and may be used only in a custom application where Inspector is loaded.
|
||||
At present, the History view is under implementation and may be used only in a custom application where Inspector is loaded.
|
||||
|
||||
To fill this view, VInspectorAPI_CallBack should be redefined in the application and send signals about some actions applyed to context.
|
||||
After, the call back should be given as parameter in the plugin.
|
||||
To fill this view, *VInspectorAPI_CallBack* should be redefined in the application and send signals about some actions applied to the context.
|
||||
After that, the call back should be given as a parameter in the plugin.
|
||||
If done, new items will be created in the history view for each action.
|
||||
|
||||
@subsubsection occt_inspector_2_3_3 Elements cooperation
|
||||
|
||||
Vinspector markes current selected presentations in AIS_InteractiveContext with blue background in tree items. Use "Update" button to synchronize VInspector selected items state to the context.
|
||||
*VInspector* marks the presentations currently selected in *AIS_InteractiveContext* with a blue background in tree items. Use **Update** button to synchronize VInspector selected items state to the context.
|
||||
|
||||
It is also possible to perform selection in context using "Selection controls" VInspector. However, it should be performed carefully as
|
||||
it clears the current selection in AIS_InteractiveContext.
|
||||
It is also possible to perform selection in the context using "Selection controls" VInspector feature. However, this operation should be performed carefully as
|
||||
it clears the current selection in *AIS_InteractiveContext*.
|
||||
|
||||
Selection change:
|
||||
| From | To | Action | Result |
|
||||
| :----- | :----- | :----- | :----- |
|
||||
| AIS_InteractiveContext | VInspector | perform selection in AIS_InteractiveContext | Click "Update" button in VInspector and check "Selection" column: <br> AIS_InteractiveContext item has anount of selected objects,<br> some of AIS_InteractiveObject have filled value if it selection happens for this presentation or entity owner of it |
|
||||
| VInspector | AIS_InteractiveContext | activate one of Selection controls and select one or several elements in tree view | The objects become selected in AIS_InteractiveContext |
|
||||
| *AIS_InteractiveContext* | VInspector | Performs selection in *AIS_InteractiveContext*. | Click **Update** button in VInspector and check **Selection** column: <br> *AIS_InteractiveContext* item contains some selected objects, <br> the value of some *AIS_InteractiveObject* is filled if they are selected for this presentation or its entity owner. |
|
||||
| VInspector | *AIS_InteractiveContext* | Activates one of Selection controls and selects one or several elements in the tree view. | The objects become selected in *AIS_InteractiveContext*. |
|
||||
|
||||
@subsubsection occt_inspector_2_3_4 VInspector tree view columns
|
||||
|
||||
Use context pop-up menu on the tree view header to select, which columns should be displayed.
|
||||
@figure{vinspector_tree_columns.png, "Vinspector tree header context menu",360}
|
||||
|
||||
@subsection occt_inspector_2_4 ShapeView Plugin
|
||||
|
||||
@subsubsection occt_inspector_2_4_1 Overview
|
||||
|
||||
@figure{shapeview.png, "ShapeView"}
|
||||
@figure{shapeview.png, "ShapeView",360}
|
||||
|
||||
This plugin visualizes content of TopoDS_Shape in a tree view.
|
||||
This plugin visualizes content of *TopoDS_Shape* in a tree view.
|
||||
|
||||
@subsubsection occt_inspector_2_4_2 Elements
|
||||
|
||||
@@ -333,99 +334,147 @@ This plugin visualizes content of TopoDS_Shape in a tree view.
|
||||
|
||||
<b>TopoDS_Shape View</b>
|
||||
|
||||
Elements of the view are TopoDS_Shape objects.
|
||||
This shape is exploded into sub-shapes using TopoDS_Iterator of the TopoDS_Shape.
|
||||
Child sub-shapes are presented in the view as children of the initial shape.
|
||||
Iterating recursively by all shapes we obtain a tree view of items shown in the ShapeView.
|
||||
The view elements are *TopoDS_Shape* objects.
|
||||
The shape is exploded into sub-shapes using *TopoDS_Iterator* of the *TopoDS_Shape*.
|
||||
Children sub-shapes are presented in the view as children of the initial shape.
|
||||
By iterating recursively through all shapes we obtain a tree view of items shown in the ShapeView.
|
||||
|
||||
The columns of the View show some information about *TopoDS_Shape* of the item.
|
||||
The first column allows changing the visibility of the item shape in the 3D view.
|
||||
|
||||
Columns of the View show some information about TopoDS_Shape of the item.
|
||||
The most informative column is the last column of TopoDS_Vertex and TopoDS_Edge shape types.
|
||||
|
||||
For TopoDS_Vertex it contains the point coordinates,
|
||||
|
||||
for TopoDS_Edge it contains the first and the last point coordinates, the edge length and some other parameters.
|
||||
|
||||
|
||||
Context popup menu in tree view:
|
||||
Context pop-up menu in tree view:
|
||||
| Action | Functionality |
|
||||
| :----- | :----- |
|
||||
| Load BREP file | Opens selected file and appends the result TopoDS_Shape into tree view |
|
||||
| Remove all shape items | Clears tree view |
|
||||
| BREP view | Shows text view with BREP content of the selected item. It creates BREP file in temporary directory of the plugin. |
|
||||
| Close All BREP views | Closes all opened text views |
|
||||
| BREP directory | Displays folder where temporary BREP files have been stored. |
|
||||
| Load BREP file | Opens the selected file and appends the resulting *TopoDS_Shape* into the tree view. |
|
||||
| Remove all shape items | Clears tree view. |
|
||||
| BREP view | Shows the text view with BREP content of the selected item. Creates the BREP file in a temporary directory of the plugin. |
|
||||
| Close All BREP views | Closes all opened text views. |
|
||||
| BREP directory | Displays the folder, where temporary BREP files have been stored. |
|
||||
|
||||
@subsubsection occt_inspector_2_4_3 Elements cooperation
|
||||
|
||||
Selection of one or several items in TopoDS_Shape View creates AIS_Shape presentation for it and displays it in the 3D View.
|
||||
Selection of one or several items in *TopoDS_Shape* View creates its *AIS_Shape* presentation and displays it in the 3D View.
|
||||
|
||||
@subsubsection occt_inspector_2_4_4 ShapeView tree view columns
|
||||
|
||||
Use context pop-up menu on the tree view header to select, which columns should be displayed.
|
||||
@figure{shapeview_tree_columns.png, "ShapeView tree header context menu",360}
|
||||
|
||||
|
||||
@section occt_inspector_3 Common controls
|
||||
@subsection occt_inspector_3_1 3D View
|
||||
|
||||
@subsubsection occt_inspector_3_1_1 Overview
|
||||
@subsection occt_inspector_3_1 Tree View
|
||||
|
||||
@figure{3DView.png, "3D View"}
|
||||
This control shows presentation hierarchy of the investigated OCCT element, e.g. *TDocStd_Application* for DFBrowser, see @ref occt_inspector_1_1 "Overview".
|
||||
The first column contains the name, other columns are informative.
|
||||
|
||||
Control for OCCT 3D viewer. It creates visualization view components with possibilities to perform some
|
||||
user actions for the view.
|
||||
The tree view has a context menu with plugin-specific actions.
|
||||
|
||||
@subsubsection occt_inspector_3_1_1 Tree View preferences
|
||||
|
||||
It is possible to define visibility and width of columns.
|
||||
This option is available in a view that contains more than one column,
|
||||
e.g. @ref occt_inspector_2_3_4 "VInspector tree view columns"
|
||||
and @ref occt_inspector_2_4_4 "ShapeView tree view columns".
|
||||
|
||||
@figure{treeview_preferences.svg, "Preferences schema",360}
|
||||
|
||||
|
||||
@subsubsection occt_inspector_3_1_2 Elements
|
||||
@subsection occt_inspector_3_2 3D View
|
||||
|
||||
@figure{3DView_elements.svg,"3DView Elements"}
|
||||
@subsubsection occt_inspector_3_2_1 Overview
|
||||
|
||||
3D View contains:
|
||||
@figure{3DView.png, "3D View",360}
|
||||
|
||||
This control for OCCT 3D viewer creates visualization view components and allows performing some user actions in the view.
|
||||
|
||||
|
||||
@subsubsection occt_inspector_3_2_2 Elements
|
||||
|
||||
@figure{3DView_elements.svg,"3DView Elements",360}
|
||||
|
||||
3D View contains the following elements:
|
||||
| Element | Functionality |
|
||||
| :----- | :----- |
|
||||
| 3D view | V3d viewer with mouse events processing |
|
||||
| Context | choice of another context that should be used in the plugin. <br> It is possible to use the next contexts:<br> Own - context of this view, <br> External - context come in parameters which intializes plugin, <br> None - do not perform visualization at all |
|
||||
| Multi/Single | Buttons defined what to do with the previous displayed objects: <br> Multi displays new presentations in additional to already displayed, <br> Single removes all previuos displayed presentations |
|
||||
| Clean | Removes all displayed presentations |
|
||||
| Fit All,<br> Fit Area,<br> Zoom,<br> Pan,<br> Rotation | Scene manipulation actions |
|
||||
| Display Mode | Sets *AIS_Shading* or *AIS_WireFrame* display mode for all presentations |
|
||||
| 3D view | V3d viewer with mouse events processing. |
|
||||
| Context | Allows choosing another context that should be used in the plugin. The following contexts are available:<br> **Own** - the context of this view, <br> **External** - the context of the @ref occt_inspector_4_3 "external application", which initializes the plugin, <br> **None** - the visualization is not performed at all (useful if the presentation is too complex). |
|
||||
| Multi/Single | The buttons define what to do with the previously displayed objects: <br> **Multi** displays new presentations together with already displayed ones, <br> **Single** removes all previously displayed presentations. |
|
||||
| Clean | Removes all displayed presentations. |
|
||||
| Fit All,<br> Fit Area,<br> Zoom,<br> Pan,<br> Rotation | Scene manipulation actions<br> (Fit All is checkable. If checked(by double click), display/hide of new objects will perform **Fit All** of the scene.) |
|
||||
| Display Mode | Sets *AIS_Shading* or *AIS_WireFrame* display mode for all presentations. |
|
||||
|
||||
Context popup menu:
|
||||
| Action | Functionality |
|
||||
| :----- | :----- |
|
||||
| Set View Orientation | Shows the list of available *V3d_View* projections. Selection of an item with change the view. |
|
||||
|
||||
@figure{3DView_set_orientation.png,"Set view orientation",360}
|
||||
|
||||
@subsubsection occt_inspector_3_2_3 3D View preferences.
|
||||
View preferences store the current view orientation.
|
||||
|
||||
@subsection occt_inspector_3_3 Preferences context menu
|
||||
|
||||
@figure{preferences.png,"Plugin preferences",360}
|
||||
|
||||
Context menu contains:
|
||||
| Element | Functionality |
|
||||
| :----- | :----- |
|
||||
| Tree Level Line,<br> PropertyPanel,<br> Dump, <br> View| Names of dock widgets in the active plugin. If the button is checked, dock widget is visible. |
|
||||
| Store Preferences | Creates ".tinspector.xml" preferences file with the current settings for each plugin.<br> This file is created in TEMP/TMP directory (by default) or in a user-defined directory. |
|
||||
| Remove Preferences | Removes preferences file. After the Inspector is restarted, default values will be applied. |
|
||||
|
||||
|
||||
@section occt_inspector_6 TInspectorEXE sample
|
||||
The following controls have store/restore preferences:
|
||||
| Element | Preferences |
|
||||
| :----- | :----- |
|
||||
| Geometry| Inspector window size and position. <br>State of dockable widgets : visibility, position, size.|
|
||||
| @ref occt_inspector_3_1_1 "Tree View preferences"| Columns visible in the tree view and their width. |
|
||||
| @ref occt_inspector_3_2_3 "3D View preferences"| 3D view camera direction. |
|
||||
|
||||
Inspector functionality can be tried using this sample.
|
||||
@section occt_inspector_4 Getting Started
|
||||
|
||||
Use *inspector.bat* script file placed in binary directory of OCCT to launch it.
|
||||
@subsection occt_inspector_4_1 TInspectorEXE sample
|
||||
|
||||
This script accepts the names of plugin's DLL that should be loaded. By default it loads all described above plugins.
|
||||
This sample allows trying Inspector functionality.
|
||||
|
||||
Use *inspector.bat* script file placed in a binary directory of OCCT to launch it.
|
||||
|
||||
This script accepts the names of plugin's DLL that should be loaded. By default it loads all plugins described above.
|
||||
|
||||
|
||||
@figure{TStandaloneEXE.png, "TStandaloneEXE"}
|
||||
@figure{TStandaloneEXE.png, "TStandaloneEXE",360}
|
||||
|
||||
Click on the Open button shows the dialog to select a file. The user is able to select one of the sample files or load own one.
|
||||
@figure{TStandaloneEXE_open.png, ""}
|
||||
Click on the Open button shows the dialog to select a file.
|
||||
@figure{TStandaloneEXE_open.png, "",360}
|
||||
|
||||
Depending on the active plugin, the following files should be selected in the dialog:
|
||||
OCAF document or STEP files for DFBRowser and BREP files for VInspector and ShapeView plugins.
|
||||
Depending on the active plugin, it is possible to select the following files in the dialog:<br>
|
||||
- DFBRowser: OCAF document or STEP files;
|
||||
- VInspector: BREP files;
|
||||
- ShapeView: BREP files.
|
||||
|
||||
It is possible to click the file name in the proposed directory, enter it manually or using Browser button.
|
||||
The last Loading icon becomes enabled if file name is correct.
|
||||
Click the file name in the proposed directory and enter it manually or using **Browse** button.
|
||||
|
||||
|
||||
By default TInspectorEXE opens the next files for plugins:
|
||||
By default, TInspectorEXE opens the following files for plugins:
|
||||
| Plugin DLL library name | Files |
|
||||
| :----- | :----- |
|
||||
| TKDFBrowser | step/screw.step |
|
||||
| TKVInspector | occ/hammer.brep |
|
||||
| TKShapeView | occ/face1.brep, <br> occ/face2.brep |
|
||||
|
||||
These files are found relatively *CSF_OCCTDataPath*.
|
||||
These files are found relatively to *CSF_OCCTDataPath*.
|
||||
|
||||
@subsubsection occt_inspector_4_1_1 TInspectorEXE preferences
|
||||
The application stores recently loaded files. On the application start, the last file is activated.
|
||||
**Open file** dialog contains recently loaded files.
|
||||
Selection of a new file updates the container of recently loaded files and rewrites preferences.
|
||||
|
||||
Source code of TIspectorEXE is a good sample for @ref occt_inspector_8 "Using Inspector in a custom application".
|
||||
Source code of *TIspectorEXE* is a good sample for @ref occt_inspector_4_3 "using the Inspector in a custom application".
|
||||
|
||||
@subsection occt_inspector_4_2 How to launch the Inspector in DRAW Test Harness
|
||||
|
||||
@section occt_inspector_7 Launch in DRAW Test Harness
|
||||
|
||||
TKToolsDraw plugin is created to provide DRAW commands for Qt tools. Use INSPECTOR parameter of @ref occt_draw_1_3_3 "pload"
|
||||
command to download commands of this library. It contains tinspector command to start Inspector under DRAW.
|
||||
*TKToolsDraw* plugin provides DRAW commands for Qt tools. Use *INSPECTOR* parameter of @ref occt_draw_1_3_3 "pload"
|
||||
command to download the commands of this library. It contains *tinspector* command to start Inspector under DRAW.
|
||||
See more detailed description of the @ref occt_draw_13_1 "tinspector" command.
|
||||
|
||||
The simple code to start Inspector with all plugins loaded:
|
||||
@@ -435,26 +484,31 @@ pload INSPECTOR
|
||||
tinspector
|
||||
~~~~~
|
||||
|
||||
@figure{drawexe_tinspector.png,"tinspector"}
|
||||
@figure{drawexe_tinspector.png,"tinspector",360}
|
||||
|
||||
Result of this command is the next:
|
||||
- all available Plugins are presented in the Inspector. These are @ref occt_inspector_2_2 "DFBrowser", @ref occt_inspector_2_3 "VInspector" and @ref occt_inspector_2_4 "ShapeView".
|
||||
- DFBrowser is an active plugin
|
||||
- tree of OCAF is empty.
|
||||
This command does the following:
|
||||
- all available Plugins are presented in the Inspector. These are @ref occt_inspector_2_2 "DFBrowser", @ref occt_inspector_2_3 "VInspector" and @ref occt_inspector_2_4 "ShapeView";
|
||||
- DFBrowser is the active plugin;
|
||||
- OCAF tree is empty.
|
||||
|
||||
After, we should create objects in DRAW and update tinspector.
|
||||
After this, we should create objects in DRAW and update *tinspector*.
|
||||
The examples of using Inspector in DRAW can be found in OCCT source directory /tests/tools.
|
||||
|
||||
@section occt_inspector_8 Using in a custom application
|
||||
@subsection occt_inspector_4_3 How to use the Inspector in a custom application
|
||||
|
||||
To use Inspector in an application, the next steps should be done:
|
||||
* Set dependencies to OCCT and Qt in application (Header and Link)
|
||||
* Create an instance of TInspector_Communicator.
|
||||
* Register plugins of interest in the communicator by DLL library name
|
||||
* Initialize communicator with objects that will be investigated
|
||||
* Set visible true for commumicator
|
||||
The example of using the Inspector in a custom application is presented in OCCT qt sample - <b>FuncDemo</b>.
|
||||
For building qt samples, switch on *BUILD_SAMPLES_QT* variable in @ref build_cmake_conf "Configuration process".
|
||||
|
||||
In general, the following steps should be taken:
|
||||
* Set dependencies to OCCT and Qt in the application (Header and Link);
|
||||
* Create an instance of *TInspector_Communicator*;
|
||||
* Register the plugins of interest in the communicator by DLL library name;
|
||||
* Initialize the communicator with objects that will be investigated;
|
||||
* Set visible true for the communicator.
|
||||
|
||||
|
||||
C++ code is similar:
|
||||
|
||||
Here is an example of C++ implementation:
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
|
||||
#include <inspector/TInspector_Communicator.hxx>
|
||||
@@ -479,100 +533,56 @@ void CreateInspector()
|
||||
}
|
||||
MyTCommunicator->SetVisible (true);
|
||||
}
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Give one the following objects for a plugin using a container of parameters:
|
||||
|
||||
| Plugin | to be initialized by |
|
||||
| :----- | :----- |
|
||||
| TKDFBrowser | TDocStd_Application |
|
||||
| TKVInspector | AIS_InteractiveContext |
|
||||
| TKShapeView | TopoDS_TShape |
|
||||
| *TKDFBrowser* | *TDocStd_Application* |
|
||||
| *TKVInspector* | *AIS_InteractiveContext* |
|
||||
| *TKShapeView* | *TopoDS_TShape* |
|
||||
|
||||
|
||||
@section occt_inspector_5 Build procedure
|
||||
|
||||
@section occt_inspector_4 Build procedure
|
||||
|
||||
@subsection occt_inspector_5_1 Building with CMake within OCCT
|
||||
|
||||
By default the Inspector compilation is off.
|
||||
To compile it, set the <b>BUILD_Inspector</b> flag to "ON". See @ref build_cmake_conf "Configuration process".
|
||||
To compile it, set the *BUILD_Inspector* flag to "ON". See @ref build_cmake_conf "Configuration process".
|
||||
|
||||
When this option is switched On, MS Visual Studio project has an additional tree of folders:
|
||||
When this option is switched ON, MS Visual Studio project has an additional tree of folders:
|
||||
|
||||
@figure{VStudio_projects.png,"Inspector packages in MS Visual Studio"}
|
||||
@figure{VStudio_projects.png,"Inspector packages in MS Visual Studio",160}
|
||||
|
||||
|
||||
@section occt_inspector_5 Sources and packaging
|
||||
@section occt_inspector_6 Sources and packaging
|
||||
|
||||
OCCT sources are extended by the /tools directory.
|
||||
|
||||
Distribution of packages participated in plugins:
|
||||
| Sources packages| Plugin |
|
||||
Distribution of plugin packages :
|
||||
| Source packages | Plugin |
|
||||
| :----- | :----- |
|
||||
| DFBrowser, <br> DFBrowserPane, <br> DFBrowserPaneXDE, <br> TKDFBrowser | DFBrowser |
|
||||
| VInspector, <br> TKVInspector | VInspector |
|
||||
| ShapeView, <br> TKShapeView | ShapeView |
|
||||
| *DFBrowser*, <br> *DFBrowserPane*, <br> *DFBrowserPaneXDE*, <br> *TKDFBrowser* | DFBrowser |
|
||||
| *VInspector*, <br> *TKVInspector* | VInspector |
|
||||
| *ShapeView*, <br> *TKShapeView* | ShapeView |
|
||||
|
||||
Other packages:
|
||||
| Sources packages| Used in |
|
||||
| Source packages| Used in |
|
||||
| :----- | :----- |
|
||||
| TInspectorAPI, <br> TKInspectorAPI | Iterface for connection to plugin. |
|
||||
| TreeModel, <br> TKTreeView | Items-oriented model to simplify work with GUI tree control. |
|
||||
| View, <br> TKView | 3D View component |
|
||||
| TInspector, <br> TKTInspector | Inspector window where plugins are placed |
|
||||
| ToolsDraw, <br> TKToolsDraw | Plugin for DRAW to start Inspector |
|
||||
| *TInspectorAPI*, <br> *TKInspectorAPI* | Interface for connection to plugin. |
|
||||
| *TreeModel*, <br> *TKTreeView* | Items-oriented model to simplify work with GUI tree control. |
|
||||
| *View*, <br> *TKView* | 3D View component. |
|
||||
| *TInspector*, <br> *TKTInspector* | Inspector window, where plugins are placed. |
|
||||
| *ToolsDraw*, <br> *TKToolsDraw* | Plugin for DRAW to start Inspector. |
|
||||
|
||||
|
||||
In MSVC studio the separate folder contains Inspector projects.
|
||||
In MSVC studio, a separate folder contains Inspector projects.
|
||||
|
||||
@section occt_inspector_9 Glossary
|
||||
* **Component** -- OCCT part, e.g. OCAF, VISUALIZATION, MODELING and others.
|
||||
* **Plugin** -- library that is loaded in some executable/library. Here, the plugins are:
|
||||
@section occt_inspector_7 Glossary
|
||||
* **Component** -- a part of OCCT , e.g. OCAF, VISUALIZATION, MODELING and others.
|
||||
* **Plugin** -- a library that is loaded in some executable/library. Here, the plugins are:
|
||||
* DFBrowser,
|
||||
* ShapeView,
|
||||
* VInspector.
|
||||
|
||||
@subsection occt_attribute_simple_types TDF_Attribute Simple types
|
||||
Types where the content is a single value
|
||||
|
||||
| Type | Kind of value |
|
||||
| :----- | :----- |
|
||||
| TDataStd_AsciiString | TDataStd_AsciiString |
|
||||
| TDataStd_Comment | TCollection_ExtendedString |
|
||||
| TDataStd_Integer | Standard_Integer |
|
||||
| TDataStd_Name | TCollection_ExtendedString |
|
||||
| TDataStd_Real | Standard_Real |
|
||||
| TDF_Reference | TDF_Label |
|
||||
| TDF_TagSource | Standard_Integer |
|
||||
|
||||
|
||||
@subsection occt_attribute_list_types TDF_Attribute List types
|
||||
|
||||
| Type | Kind of value (container of) |
|
||||
| :----- | :----- |
|
||||
| TDataStd_BooleanList | Standard_Boolean |
|
||||
| TDataStd_ExtStringList | TCollection_ExtendedString |
|
||||
| TDataStd_IntegerList | Standard_Integer |
|
||||
| TDataStd_RealList | Standard_Real |
|
||||
| TDataStd_ReferenceList | TDF_Label |
|
||||
|
||||
@subsection occt_attribute_array_types TDF_Attribute Array types
|
||||
|
||||
| Type | Kind of value (container of) |
|
||||
| :----- | :----- |
|
||||
| TDataStd_BooleanArray | Standard_Boolean |
|
||||
| TDataStd_ByteArray | Standard_Byte |
|
||||
| TDataStd_ExtStringArray | TCollection_ExtendedString |
|
||||
| TDataStd_IntegerArray | Standard_Integer |
|
||||
| TDataStd_RealArray | Standard_Real |
|
||||
| TDataStd_ReferenceArray | TDF_Label |
|
||||
|
||||
@subsection occt_attribute_xde_tree_node_id XDE tree node ID description
|
||||
| GUID | Text |
|
||||
| :----- | :----- |
|
||||
| XCAFDoc::ShapeRefGUID() | Shape Instance Link |
|
||||
| XCAFDoc::ColorRefGUID (XCAFDoc_ColorGen) | Generic Color Link |
|
||||
| XCAFDoc::ColorRefGUID (XCAFDoc_ColorSurf) | Surface Color Link |
|
||||
| XCAFDoc::ColorRefGUID (XCAFDoc_ColorCurv) | Curve Color Link |
|
||||
| XCAFDoc::DimTolRefGUID() | DGT Link |
|
||||
| XCAFDoc::DatumRefGUID() | Datum Link |
|
||||
| XCAFDoc::MaterialRefGUID() | Material Link |
|
||||
|
||||
|
@@ -1286,11 +1286,11 @@ TopoDS_Edge E = ME;
|
||||
|
||||
@subsection occt_modalg_hist History support
|
||||
|
||||
All topological API algorithms support the history of shapes modifications (or just History) for their arguments.
|
||||
All topological API algorithms support the history of shape modifications (or just History) for their arguments.
|
||||
Generally, the history is available for the following types of sub-shapes of input shapes:
|
||||
* Vertex
|
||||
* Edge
|
||||
* Face
|
||||
* Vertex;
|
||||
* Edge;
|
||||
* Face.
|
||||
|
||||
Some algorithms also support the history for Solids.
|
||||
|
||||
@@ -1300,7 +1300,7 @@ The history information consists of the following information:
|
||||
* Information about Generated shapes.
|
||||
|
||||
The History is filled basing on the result of the operation. History cannot return any shapes not contained in the result.
|
||||
Thus, if the result of the operation is empty shape, all input shapes will be considered as Deleted and none will have Modified and Generated shapes.
|
||||
If the result of the operation is an empty shape, all input shapes will be considered as Deleted and none will have Modified and Generated shapes.
|
||||
|
||||
The history information can be accessed by the API methods:
|
||||
* *Standard_Boolean IsDeleted(const TopoDS_Shape& theS)* - to check if the shape has been Deleted during the operation;
|
||||
@@ -1310,7 +1310,7 @@ The history information can be accessed by the API methods:
|
||||
@subsubsection occt_modalg_hist_del Deleted shapes
|
||||
|
||||
The shape is considered as Deleted during the operation if all of the following conditions are met:
|
||||
* The shape is the part of the argument shapes of the operation;
|
||||
* The shape is a part of the argument shapes of the operation;
|
||||
* The result shape does not contain the shape itself;
|
||||
* The result shape does not contain any of the splits of the shape.
|
||||
|
||||
@@ -1318,19 +1318,19 @@ For example, in the CUT operation between two intersecting solids all vertices/e
|
||||
|
||||
@subsubsection occt_modalg_hist_mod Modified shapes
|
||||
|
||||
The shape is considered as Modified during the operation if the result shape contains the splits of the shape, not the shape itself. The shape can be modified only into the shapes with same dimension.
|
||||
The shape is considered as Modified during the operation if the result shape contains the splits of the shape, not the shape itself. The shape can be modified only into the shapes with the same dimension.
|
||||
The splits of the shape contained in the result shape are Modified from the shape.
|
||||
The Modified shapes are created from the sub-shapes of the input shapes and, generally, repeat their geometry.
|
||||
|
||||
The list of Modified elements will contain only those which are contained in the result of the operation. If the list is empty the shape has not been modified and it is necessary to check if it has been Deleted.
|
||||
The list of Modified elements will contain only those contributing to the result of the operation. If the list is empty, the shape has not been modified and it is necessary to check if it has been Deleted.
|
||||
|
||||
For example, after translation of the shape in any direction all its sub-shapes will be modified into their translated copies.
|
||||
|
||||
@subsubsection occt_modalg_hist_gen Generated shapes
|
||||
|
||||
The shapes contained in the result shape are considered as Generated from the input shape if they were produced during the operation and have different dimension with the shapes from which they were created.
|
||||
The shapes contained in the result shape are considered as Generated from the input shape if they were produced during the operation and have a different dimension from the shapes from which they were created.
|
||||
|
||||
The list of Generated elements will contain only those which are contained in the result of the operation. If the list is empty no new shapes have been Generated from the shape.
|
||||
The list of Generated elements will contain only those included in the result of the operation. If the list is empty, no new shapes have been Generated from the shape.
|
||||
|
||||
For example, extrusion of the edge in some direction will create a face. This face will be generated from the edge.
|
||||
|
||||
@@ -1338,7 +1338,7 @@ For example, extrusion of the edge in some direction will create a face. This fa
|
||||
|
||||
*BRepTools_History* is the general History tool intended for unification of the histories of different algorithms.
|
||||
|
||||
BRepTools_History can be created from any algorithm supporting the standard history methods (IsDeleted(), Modified() and Generated()):
|
||||
*BRepTools_History* can be created from any algorithm supporting the standard history methods *(IsDeleted(), Modified()* and *Generated())*:
|
||||
~~~~
|
||||
// The arguments of the operation
|
||||
TopoDS_Shape aS = ...;
|
||||
@@ -1355,7 +1355,7 @@ anArguments.Append(aS);
|
||||
BRepTools_History aHistory(anArguments, aTransformer);
|
||||
~~~~
|
||||
|
||||
BRepTools_History also allows merging of the histories. Thus, if you have two or more subsequent operations you can get one final history combined from histories of these operations:
|
||||
*BRepTools_History* also allows merging histories. Thus, if you have two or more subsequent operations you can get one final history combined from histories of these operations:
|
||||
|
||||
~~~~
|
||||
Handle(BRepTools_History) aHist1 = ...; // History of first operation
|
||||
@@ -1374,27 +1374,27 @@ aResHistory->Merge(aHist1);
|
||||
aResHistory->Merge(aHist2);
|
||||
~~~~
|
||||
|
||||
The possibility of Merging of the histories and its creation from the API algorithms allows providing easy History support for the new algorithms.
|
||||
The possibilities of Merging histories and history creation from the API algorithms allow providing easy History support for the new algorithms.
|
||||
|
||||
@subsubsection occt_modalg_hist_draw DRAW history support
|
||||
|
||||
DRAW History support for the algorithms supporting history is provided by three basic commands:
|
||||
DRAW History support for the algorithms is provided by three basic commands:
|
||||
* *isdeleted*;
|
||||
* *modified*;
|
||||
* *generated*.
|
||||
|
||||
For more information on the Draw History mechanism please refer the corresponding chapter in the Draw users guide - @ref occt_draw_hist "History commands".
|
||||
For more information on the Draw History mechanism please refer to the corresponding chapter in the Draw users guide - @ref occt_draw_hist "History commands".
|
||||
|
||||
|
||||
@section occt_modalg_3 Standard Topological Objects
|
||||
|
||||
The following standard topological objects can be created:
|
||||
* Vertices
|
||||
* Edges
|
||||
* Faces
|
||||
* Wires
|
||||
* Polygonal wires
|
||||
* Shells
|
||||
* Vertices;
|
||||
* Edges;
|
||||
* Faces;
|
||||
* Wires;
|
||||
* Polygonal wires;
|
||||
* Shells;
|
||||
* Solids.
|
||||
|
||||
There are two root classes for their construction and modification:
|
||||
@@ -3141,23 +3141,23 @@ You can obtain information on the shape by first exploring it. To access triangu
|
||||
|
||||
@section occt_modalg_defeaturing 3D Model Defeaturing
|
||||
|
||||
The Open CASCADE Technology Defeaturing algorithm is intended for removal of the unwanted parts or features from the model. These parts could be the holes, protrusions, gaps, chamfers, fillets etc.
|
||||
The Open CASCADE Technology Defeaturing algorithm is intended for removal of the unwanted parts or features from the model. These parts can be holes, protrusions, gaps, chamfers, fillets, etc.
|
||||
|
||||
Feature detection is not performed, and all features desired for removal should be defined by the user. The input shape is not modified during Defeaturing, the new shape is built in the result.
|
||||
Feature detection is not performed, and all features to be removed should be defined by the user. The input shape is not modified during Defeaturing, the new shape is built in the result.
|
||||
|
||||
On the API level the Defeaturing algorithm is implemented in the *BRepAlgoAPI_Defeaturing* class. On the input the algorithm accepts the shape to remove the features from and the features (one or many) to remove from the shape.
|
||||
Currently, the input shape should either be SOLID, or COMPSOLID, or COMPOUND of SOLIDs.
|
||||
The features to remove are the sets of faces forming the features. It does not matter how the feature faces are given. It could be the separate faces or the collections of them. The faces should belong to the initial shape, and those that do not belong will be ignored.
|
||||
On the API level the Defeaturing algorithm is implemented in the *BRepAlgoAPI_Defeaturing* class. At input the algorithm accepts the shape to remove the features from and the features (one or many) to be removed from the shape.
|
||||
Currently, the input shape should be either SOLID, or COMPSOLID, or COMPOUND of SOLIDs.
|
||||
The features to be removed are defined by the sets of faces forming them. It does not matter how the feature faces are given: as separate faces or their collections. The faces should belong to the initial shape, else they are ignored.
|
||||
|
||||
The actual features removal is performed by the low-level *BOPAlgo_RemoveFeatures* algorithm. On the API level, all the inputs are passed into the tool and the method *BOPAlgo_RemoveFeatures::Perform()* is called.
|
||||
The actual features removal is performed by the low-level *BOPAlgo_RemoveFeatures* algorithm. On the API level, all inputs are passed into the tool and the method *BOPAlgo_RemoveFeatures::Perform()* is called.
|
||||
|
||||
Before starting Features removal all the faces requested for removal from the shape are sorted on the connected blocks - each block represents single feature to remove.
|
||||
The features will be removed from the shape one by one, which will allow removing all possible features even if there were some problems with the removal of some of them (due to e.g. incorrect input data).
|
||||
Before removing features, all faces to be removed from the shape are sorted into connected blocks - each block represents a single feature to be removed.
|
||||
The features are removed from the shape one by one, which allows removing all possible features even if there are some problems with their removal (e.g. due to incorrect input data).
|
||||
|
||||
The removed feature is filled by the extension of the faces adjacent to the feature. In general, the algorithm of removing of the single feature from the shape looks as follows:
|
||||
The removed feature is filled by the extension of the faces adjacent to it. In general, the algorithm removing a single feature from the shape goes as follows:
|
||||
* Find the faces adjacent to the feature;
|
||||
* Extend the adjacent faces to cover the feature;
|
||||
* Trim the extended faces by the bounds of original face (except for bounds common with the feature), so it will cover the feature only;
|
||||
* Trim the extended faces by the bounds of the original face (except for the bounds common with the feature), so that they cover the feature only;
|
||||
* Rebuild the solids with reconstructed adjacent faces avoiding the feature faces.
|
||||
|
||||
If the single feature removal was successful, the result shape is overwritten with the new shape, otherwise the results are not kept, and the warning is given.
|
||||
@@ -3170,27 +3170,27 @@ and the options available from base class (*BOPAlgo_Options*):
|
||||
* Error/Warning reporting system;
|
||||
* Parallel processing mode.
|
||||
|
||||
Please note that the other options of the base class are not supported here and will have no effect.
|
||||
Note that the other options of the base class are not supported here and will have no effect.
|
||||
|
||||
<b>History support</b> allows tracking modification of the input shape in terms of Modified, IsDeleted and Generated. By default, the history is collected, but it is possible to disable it using the method *TrackHistory(false)*.
|
||||
On the low-level the history information is collected by the history tool *BRepTools_History*, which can be accessed through the method *BOPAlgo_RemoveFeatures::History()*.
|
||||
|
||||
<b>Error/Warning reporting system</b> - allows obtaining the extended overview of the Errors/Warnings occurred during the operation. As soon as any error appears the algorithm stops working. The warnings allow continuing the job, informing the user that something went wrong. The algorithm returns the following errors/warnings:
|
||||
* BOPAlgo_AlertUnsupportedType - the alert will be given as an error if the input shape does not contain any solids, and as a warning if the input shape contains not only solids, but also other shapes;
|
||||
* BOPAlgo_AlertNoFacesToRemove - the error alert is given in case there are no faces to remove from the shape (nothing to do);
|
||||
* BOPAlgo_AlertUnableToRemoveTheFeature - the warning alert is given to inform the user the removal of the feature is not possible. The algorithm will still try to remove the other features;
|
||||
* BOPAlgo_AlertRemoveFeaturesFailed - the error alert is given in case if the operation was aborted by the unknown reason.
|
||||
<b>Error/Warning reporting system</b> allows obtaining the extended overview of the Errors/Warnings occurred during the operation. As soon as any error appears, the algorithm stops working. The warnings allow continuing the job and informing the user that something went wrong. The algorithm returns the following errors/warnings:
|
||||
* *BOPAlgo_AlertUnsupportedType* - the alert will be given as an error if the input shape does not contain any solids, and as a warning if the input shape contains not only solids, but also other shapes;
|
||||
* *BOPAlgo_AlertNoFacesToRemove* - the error alert is given in case there are no faces to remove from the shape (nothing to do);
|
||||
* *BOPAlgo_AlertUnableToRemoveTheFeature* - the warning alert is given to inform the user the removal of the feature is not possible. The algorithm will still try to remove the other features;
|
||||
* *BOPAlgo_AlertRemoveFeaturesFailed* - the error alert is given in case if the operation was aborted by the unknown reason.
|
||||
|
||||
For more information on the error/warning reporting system please see the chapter @ref occt_algorithms_ers "Errors and warnings reporting system" of Boolean operations user guide.
|
||||
|
||||
<b>Parallel processing mode</b> - allows running the algorithm in parallel mode obtaining the result faster.
|
||||
|
||||
The algorithm has certain limitations:
|
||||
* Intersection of the surfaces of the connected faces adjacent to the feature should not be empty. It means, that such faces should not be tangent to each other.
|
||||
* Intersection of the surfaces of the connected faces adjacent to the feature should not be empty. It means, that such faces should not be tangent to each other.
|
||||
If the intersection of the adjacent faces will be empty, the algorithm will be unable to trim the faces correctly and, most likely, the feature will not be removed.
|
||||
* The algorithm does not process the INTERNAL parts of the solids, they are simply removed during reconstruction.
|
||||
|
||||
Note, that for successful removal of the feature, the extended faces adjacent to the feature should cover the feature completely, otherwise the solids will not be rebuild.
|
||||
Note, that for successful removal of the feature, the extended faces adjacent to the feature should cover the feature completely, otherwise the solids will not be rebuild.
|
||||
Take a look at the simple shape on the image below:
|
||||
@figure{/user_guides/modeling_algos/images/modeling_algos_rf_im001.png,"",220}
|
||||
|
||||
@@ -3234,7 +3234,7 @@ if (aDF.HasWarnings()) // Check for the warnings
|
||||
const TopoDS_Shape& aResult = aDF.Shape(); // Result shape
|
||||
~~~~
|
||||
|
||||
To track the history of a shape use the API history methods:
|
||||
Use the API history methods to track the history of a shape:
|
||||
~~~~
|
||||
// Obtain modification of the shape
|
||||
const TopTools_ListOfShape& BRepAlgoAPI_Defeaturing::Modified(const TopoDS_Shape& theS);
|
||||
@@ -3246,17 +3246,15 @@ const TopTools_ListOfShape& BRepAlgoAPI_Defeaturing::Generated(const TopoDS_Shap
|
||||
Standard_Boolean BRepAlgoAPI_Defeaturing::IsDeleted(const TopoDS_Shape& theS);
|
||||
~~~~
|
||||
|
||||
For the usage of the Defeaturing algorithm on the Draw level the command <b>removefeatures</b> has been implemented.
|
||||
The command <b>removefeatures</b> allows using the Defeaturing algorithm on the Draw level.
|
||||
|
||||
To track the history of a shape modification during Defeaturing the @ref occt_draw_hist "standard history commands" can be used.
|
||||
The @ref occt_draw_hist "standard history commands" can be used to track the history of shape modification during Defeaturing.
|
||||
|
||||
For more details on commands above please refer the @ref occt_draw_defeaturing "Defeaturing commands" of the Draw test harness user guide.
|
||||
|
||||
To have possibility to access the error/warning shapes of the operation use the *bdrawwarnshapes* command before running the algorithm (see command usage in the @ref occt_algorithms_ers "Errors and warnings reporting system" of Boolean operations user guide).
|
||||
For more details on commands above, refer to the @ref occt_draw_defeaturing "Defeaturing commands" of the Draw test harness user guide.
|
||||
|
||||
@subsection occt_modalg_defeaturing_examples Examples
|
||||
|
||||
Here are the few examples of defeaturing of the ANC101 model:
|
||||
Here are the examples of defeaturing of the ANC101 model:
|
||||
|
||||
@figure{/user_guides/modeling_algos/images/modeling_algos_rf_im004.png,"ANC101 model",220}</td>
|
||||
|
||||
|
Before Width: | Height: | Size: 641 KiB After Width: | Height: | Size: 30 KiB |
@@ -1296,28 +1296,29 @@ The following sample code reads a shape from ASCII file and writes it to a binar
|
||||
|
||||
@section occt_modat_6 Bounding boxes
|
||||
|
||||
*Bounding box(es) (BndBox(es))* is used in many OCCT algorithms. In general, it is some filter to avoid check of excess interferences between pairs of shapes (check of interferences between BndBoxes is much simpler then between shapes and if BndBoxes do not interfere then there is no point in searching interferences between the corresponding shapes).
|
||||
Generally, BndBoxes can be divided on two main types:
|
||||
- axis-aligned BndBox (AABB). I.e. the box whose edges are parallel to the axes of World Coordinate System (WCS);
|
||||
- oriented BndBox (OBB). I.e. not AABB.
|
||||
In fact, every AABB is a specific case of OBB.<br>
|
||||
Bounding boxes are used in many OCCT algorithms. The most common use is as a filter avoiding check of excess interferences between pairs of shapes (check of interferences between bounding boxes is much simpler then between shapes and if they do not interfere then there is no point in searching interferences between the corresponding shapes).
|
||||
Generally, bounding boxes can be divided into two main types:
|
||||
- axis-aligned bounding box (AABB) is the box whose edges are parallel to the axes of the World Coordinate System (WCS);
|
||||
- oriented BndBox (OBB) is defined in its own coordinate system that can be rotated with respect to the WCS.
|
||||
Indeed, an AABB is a specific case of OBB.<br>
|
||||
|
||||
The image below illustrates the example, when using OBB is better than AABB.
|
||||
|
||||
@figure{/user_guides/modeling_data/images/modeling_data_image015.png,"Illustrating the problem with AABB.",320}
|
||||
|
||||
AABBs in this picture are interfered. Therefore, many OCCT-algorithms will spend much time to interfere the shapes. However, if we check OBBs, which are not interfered, then searching of interferences between the shapes will not be necessary. At that, creation and analysis of OBBs takes significantly more time than the analogical operations with AABB.
|
||||
AABBs in this picture are interfered. Therefore, many OCCT algorithms will spend much time to interfere the shapes. However, if we check OBBs, which are not interfered, then searching of interferences between the shapes will not be necessary. At that, creation and analysis of OBBs takes significantly more time than the analogical operations with AABB.
|
||||
|
||||
Later in this section, the BndBox having the smallest surface area will be called as <b> optimal </b>.
|
||||
Later in this section, the bounding boxes having the smallest surface area will be called *optimal*.
|
||||
|
||||
In OCCT, BndBox(es) are described in Bnd package. In general, Bnd_Box class describes AABB, Bnd_OBB class describes OBB. These classes contain the following common methods (this list is not complete; please see the documentation about corresponding class for detailed information):
|
||||
In OCCT, bounding boxes are defined in *Bnd* package. *Bnd_Box* class defines AABB, *Bnd_OBB* class defines OBB. These classes contain the following common methods (this list is not complete; see the documentation about the corresponding class for detailed information):
|
||||
|
||||
- SetVoid() and IsVoid(). SetVoid method clears the existing BndBox. IsVoid method indicates whether the BndBox is initialized.
|
||||
- Enlarge(...). Extends the current BndBox.
|
||||
- Add(...). Rebuilds the current BndBox in order to cover all previous objects (which it was created from) and the argument of the method.
|
||||
- IsOut(...). Checks whether the argument is inside/outside of the current BndBox.
|
||||
- *IsVoid* method indicates whether the bounding box is empty (uninitialized).
|
||||
- *SetVoid* method clears the existing bounding box.
|
||||
- *Enlarge(...)* extends the current bounding box.
|
||||
- *Add(...)* extends the bounding box as necessary to include the object (a point, a shape, etc.) passed as the argument.
|
||||
- *IsOut(...)* checks whether the argument is inside/outside of the current BndBox.
|
||||
|
||||
Also, BRepBndLib class contains methods to provide creation of BndBox (both AABB and OBB) from the complex shape.
|
||||
BRepBndLib class contains methods for creation of bounding boxes (both AABB and OBB) from the shapes.
|
||||
|
||||
@subsection occt_modat_6_1 Brief description of some algorithms working with OBB
|
||||
|
||||
@@ -1340,22 +1341,22 @@ Further, let us consider the triangle \f$ T_{0}\left \langle p_{0}, p_{1}, p_{2}
|
||||
<span>10.</span> Compute the center of OBB and its half dimensions.<br>
|
||||
<span>11.</span> Create OBB using the center, axes and half dimensions.<br>
|
||||
|
||||
This algorithm is realized in Bnd_OBB::ReBuild(...) method.
|
||||
This algorithm is implemented in the *Bnd_OBB::ReBuild(...)* method.
|
||||
|
||||
@subsubsection occt_modat_6_1_2 Creation of OBB based on Axes of inertia
|
||||
|
||||
The algorithm contains the following steps:
|
||||
1. Calculate three inertia axes, which will be the axes of the OBB.
|
||||
2. Transform the source object (TopoDS_Shape) into the local coordinate system based on the axes from item 1.
|
||||
2. Transform the source object *(TopoDS_Shape)* into the local coordinate system based on the axes from item 1.
|
||||
3. Create an AABB for the shape obtained in the item 2.
|
||||
4. Compute the center of AABB and its half dimensions
|
||||
5. Transform the center into the WCS
|
||||
4. Compute the center of AABB and its half dimensions.
|
||||
5. Transform the center into the WCS.
|
||||
6. Create OBB using the center, axes and half dimensions.
|
||||
|
||||
@subsubsection occt_modat_6_1_3 Method IsOut for a point
|
||||
|
||||
1. Project the point to each axis.
|
||||
2. Check, whether the absolute value of the projection parameter greater than the correspond half-dimension. In this case, IsOut method will return TRUE.
|
||||
2. Check, whether the absolute value of the projection parameter greater than the correspond half-dimension. In this case, *IsOut* method will return TRUE.
|
||||
|
||||
@subsubsection occt_modat_6_1_4 Method IsOut for another OBB
|
||||
|
||||
@@ -1366,27 +1367,27 @@ The algorithm of analyzing axis \f$ \mathbf{l} \f$ is following:
|
||||
|
||||
If OBBs are not interfered in terms of at least one axis (of 15) then they are not interfered at all.
|
||||
|
||||
@subsubsection occt_modat_6_1_5 Method Add for point or another BndBox
|
||||
@subsubsection occt_modat_6_1_5 Method Add for point or another bounding box
|
||||
|
||||
Create new OBB (see the section @ref occt_modat_6_1_1) based on the source point and all vertices of the given BndBoxes.
|
||||
Create a new OBB (see the section @ref occt_modat_6_1_1) based on the source point and all vertices of the given bounding boxes.
|
||||
|
||||
@subsection occt_modat_6_2 Add a shape
|
||||
|
||||
Method BRepBndLib::AddOBB(...) allows creating BndBox from the complex object (TopoDS_Shape). This method uses both algorithms described in the sections @ref occt_modat_6_1_1 and sections @ref occt_modat_6_1_2.
|
||||
Method *BRepBndLib::AddOBB(...)* allows creating the bounding box from a complex object *(TopoDS_Shape)*. This method uses both algorithms described in the sections @ref occt_modat_6_1_1 and sections @ref occt_modat_6_1_2.
|
||||
|
||||
The first algorithm is used if the shape outer shell can be represented by a set of points contained in the shape. Namely, only the following elements are the source of set of points:
|
||||
The first algorithm is used if the outer shell of the shape can be represented by a set of points contained in it. Namely, only the following elements are the source of set of points:
|
||||
|
||||
- Nodes of triangulation;
|
||||
- Nodes of Poly_Polygon3D;
|
||||
- Vertices of edges with linear 3D-curve lying in the planar face;
|
||||
- Vertices of edges with linear 3D-curve if the source shape does not contain more complex topological structure (e.g. the source shape is a compound of edges);
|
||||
- Vertices if the source shape does not contain more complex topological structure (e.g. the source shape is a compound of vertices).
|
||||
- Nodes of *Poly_Polygon3D*;
|
||||
- Vertices of edges with a linear 3D-curve lying in the planar face;
|
||||
- Vertices of edges with a linear 3D-curve if the source shape does not contain a more complex topological structure (e.g. the source shape is a compound of edges);
|
||||
- Vertices if the source shape does not contain a more complex topological structure (e.g. the source shape is a compound of vertices).
|
||||
|
||||
If required set of points cannot be extracted then the algorithm from section @ref occt_modat_6_1_2 is used for OBB creation.
|
||||
If the required set of points cannot be extracted then the algorithm from section @ref occt_modat_6_1_2 is used for OBB creation.
|
||||
|
||||
The package BRepBndLib contains the methods BRepBndLib::Add(...), BRepBndLib::AddClose(...) and BRepBndLib::AddOptimal(...) for creation of AABB of a shape. Please see reference manual for detailed information.
|
||||
The package *BRepBndLib* contains methods *BRepBndLib::Add(...), BRepBndLib::AddClose(...)* and *BRepBndLib::AddOptimal(...)* for creation of AABB of a shape. See the reference manual for the detailed information.
|
||||
|
||||
@subsection occt_modat_6_3 Limitations of algorithm for OBB creation.
|
||||
|
||||
1. The algorithm described in the section @ref occt_modat_6_1_1 works significantly better (finds resulting OBB with less surface area) and faster than the algorithm from the section @ref occt_modat_6_1_2. Nevertheless, (in general) the result returned by both algorithms is not always optimal (i.e. sometimes another OBB exists having less surface area). Moreover, the first method does not allow computing OBB of shapes with complex geometry.
|
||||
2. Currently, the algorithm of OBB creation is implemented for objects in 3D-space only.
|
||||
1. The algorithm described in the section @ref occt_modat_6_1_1 works significantly better (finds resulting OBB with less surface area) and faster than the algorithm from the section @ref occt_modat_6_1_2. Nevertheless, (in general) the result returned by both algorithms is not always optimal (i.e. sometimes another OBB exists with a smaller surface area). Moreover, the first method does not allow computing OBBs of shapes with a complex geometry.
|
||||
2. Currently, the algorithm of OBB creation is implemented for objects in 3D space only.
|
||||
|
@@ -440,6 +440,9 @@ current.Add (INT); // INT is now attached to current
|
||||
current.Add (INT); // causes failure
|
||||
TDF_Label attach = INT->Label();
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Note. There is an exception from this rule for some sub-set of Standard attributes. See for details chapter 6.Standard Attributes.
|
||||
|
||||
@subsubsection occt_ocaf_3_5_4 Testing the attachment to a label
|
||||
|
||||
You can test whether an attribute is attached to a label or not by using *TDF_Attribute::IsA* with the GUID of the attribute as an argument. In the example below, you test whether the current label has an integer attribute, and then, if that is so, how many attributes are attached to it. *TDataStd_Integer::GetID* provides the GUID argument needed by the method IsAttribute.
|
||||
@@ -1102,6 +1105,30 @@ Standard attributes are ready-to-use attributes, which allow creating and modify
|
||||
|
||||
All attributes inherit class *TDF_Attribute*, so, each attribute has its own GUID and standard methods for attribute creation, manipulation, getting access to the data framework.
|
||||
|
||||
### Attributes supporting several attributes of the same type on the same label
|
||||
|
||||
By default only one attribute of the same type on the same lable is supported. For example, you can set only one TDataStd_Real attribute
|
||||
on the same label. This limitation was removed for some predefined sub-set of standard attributes by adding so called 'user defined ID'
|
||||
feature to the attribute.
|
||||
The listed below attributes received this new feature:
|
||||
|
||||
* **TDataStd_AsciiString**
|
||||
* **TDataStd_Integer**
|
||||
* **TDataStd_Name**
|
||||
* **TDataStd_Real**
|
||||
* **TDataStd_BooleanArray**
|
||||
* **TDataStd_BooleanList**
|
||||
* **TDataStd_ByteArray**
|
||||
* **TDataStd_ExtStringArray**
|
||||
* **TDataStd_ExtStringList**
|
||||
* **TDataStd_IntegerArray**
|
||||
* **TDataStd_IntegerList**
|
||||
* **TDataStd_RealArray**
|
||||
* **TDataStd_RealList**
|
||||
* **TDataStd_ReferenceArray**
|
||||
* **TDataStd_ReferenceList**
|
||||
|
||||
See for details paragraph 6.4.
|
||||
|
||||
@subsection occt_ocaf_6_2 Services common to all attributes
|
||||
|
||||
@@ -1228,6 +1255,60 @@ It is possible to describe any model by means of standard OCAF attributes.
|
||||
Most of the models may be implemented using only standard OCAF attributes.
|
||||
Some other models need special treatment and require implementation of new OCAF attributes.
|
||||
|
||||
|
||||
@subsection occt_ocaf_6_4 Standard Attributes with User Defined GUID
|
||||
|
||||
The listed above attributes allow to set at the same Label as many attributes of the same type as you want thanks to specific user's ID.
|
||||
Let's consider it on the example of the TDataStd_Real attribute. The previous version of the attribute allowed to set the attribute using
|
||||
static method Set in next way:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
static Handle(TDataStd_Real) Set (const TDF_Label& label, const Standard_Real value);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
This is a default form which is kept by the attribute. It uses the default GUID for the attribute identification - TDataStd_Real::GetID().
|
||||
In case if you want to use the new feature (user defined Real attribute), for example to define several attributes which should keep a value
|
||||
of the same type - Standard_Real, but to be associated with different user's notions (or objects) the new static method Set should be used.
|
||||
In our example we will define two Real attributes which presents two customer's objects - Density and Volume and will be put on the same Label.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
#define DENSITY Standard_GUID("12e9454b-6dbc-11d4-b9c8-0060b0ee2810")
|
||||
#define VOLUME Standard_GUID("161595c0-3628-4737-915a-c160ce94c6f7")
|
||||
|
||||
TDF_Label aLabel = ...;
|
||||
|
||||
// Real attribute type with user defined GUID associated with user's object "Density"
|
||||
TDataStd_Real::Set(aLabel, DENSITY, 1.2);
|
||||
|
||||
// Real attribute type with user defined GUID associated with user's object "Volume"
|
||||
TDataStd_Real::Set(aLabel, VOLUME, 185.5);
|
||||
|
||||
To find an user defined Real attribute just use a corresponding GUID:
|
||||
Handle (TDataStd_Real) anAtt;
|
||||
aLabel.FindAttribute (DENSITY, anAtt);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@subsection occt_ocaf_6_4_1 Creation Attributes with User Defined GUID.
|
||||
|
||||
You can create a new instance of an attribute with user define GUID and add it to label in two ways.
|
||||
1. Using static method Set(). For example:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
TDF_Label aLabel = ...;
|
||||
Standard_Integer aValue = ...;
|
||||
Standard_GUID aGuid = TDataStd_Integer::GetID();
|
||||
TDataStd_Integer::Set(aLabel, aGuid, aValue);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
2. Using the default constructor
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
Handle(TDataStd_Integer) anInt = new TDataStd_Integer();
|
||||
anInt->SetID(aGuid);
|
||||
aLabel.Add(anInt);
|
||||
anInt->Set(aValue);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
||||
@section occt_ocaf_7 Visualization Attributes
|
||||
|
||||
|
@@ -138,7 +138,7 @@ Selectable object stores information about all created selection modes and sensi
|
||||
All successors of a selectable object must implement the method that splits its presentation into sensitive entities according to the given mode. The computed entities are arranged in one selection and added to the list of all selections of this object. No selection will be removed from the list until the object is deleted permanently.
|
||||
|
||||
For all standard OCCT shapes, zero mode is supposed to select the whole object (but it may be redefined easily in the custom object). For example, the standard OCCT selection mechanism and *AIS_Shape* determine the following modes:
|
||||
- 0 -- selection of entire object (AIS_Shape);
|
||||
- 0 -- selection of the entire object *(AIS_Shape)*;
|
||||
- 1 -- selection of the vertices;
|
||||
- 2 -- selection of the edges;
|
||||
- 3 -- selection of the wires;
|
||||
@@ -765,10 +765,10 @@ theCtx->SetDisplayMode (2, true);
|
||||
The Local Selection is defined by index (Selection Mode). The Selection Modes implemented by a specific interactive object and their meaning should be checked within the documentation of this class.
|
||||
See, for example, *MeshVS_SelectionModeFlags* for *MeshVS_Mesh* object.
|
||||
|
||||
The interactive object, which is used the most by applications, is *AIS_Shape*. Consequently, there are standard functions, which allow you to easily prepare selection operations on the constituent elements of shapes (selection of vertices, edges, faces, etc.). The Selection Mode for a specific shape type (*TopAbs_ShapeEnum*) is returned by method *AIS_Shape::SelectionMode()*.
|
||||
*AIS_Shape* is the most used interactive object. It provides API to manage selection operations on the constituent elements of shapes (selection of vertices, edges, faces, etc.). The Selection Mode for a specific shape type (*TopAbs_ShapeEnum*) is returned by method *AIS_Shape::SelectionMode()*.
|
||||
|
||||
The function *AIS_InteractiveObject::Display* (without argument taking Selection Mode) activates the object's default Selection Mode.
|
||||
The functions *AIS_InteractiveContext::Activate* and *AIS_InteractiveContext::Deactivate* activate and deactivate specific Selection Mode.
|
||||
The method *AIS_InteractiveObject::Display()* without a Selection Mode argument activates the default Selection Mode of the object.
|
||||
The methods *AIS_InteractiveContext::Activate()* and *AIS_InteractiveContext::Deactivate()* activate and deactivate a specific Selection Mode.
|
||||
|
||||
More than one Selection Mode can be activated at the same time (but default 0 mode for selecting entire object is exclusive - it cannot be combined with others).
|
||||
The list of active modes can be retrieved using function *AIS_InteractiveContext::ActivatedModes*.
|
||||
@@ -843,8 +843,8 @@ After using the *Select* and *ShiftSelect* functions, you can explore the list o
|
||||
* *AIS_InteractiveContext::NextSelected* -- moves the iterator to the next position;
|
||||
* *AIS_InteractiveContext::SelectedOwner* -- returns an entity at the current iterator position.
|
||||
|
||||
The owner object *SelectMgr_EntityOwner* is a key object identifying selectable entitiy in the viewer (returned by methods *AIS_InteractiveContext::DetectedOwner* and *AIS_InteractiveContext::SelectedOwner*).
|
||||
The Interactive Object itself can be retrieved by method *SelectMgr_EntityOwner::Selectable*, while identifying sub-part depends on type of Interactive Object.
|
||||
The owner object *SelectMgr_EntityOwner* is a key object identifying the selectable entity in the viewer (returned by methods *AIS_InteractiveContext::DetectedOwner* and *AIS_InteractiveContext::SelectedOwner*).
|
||||
The Interactive Object itself can be retrieved by method *SelectMgr_EntityOwner::Selectable*, while identifying a sub-part depends on the type of Interactive Object.
|
||||
In case of *AIS_Shape*, the (sub)shape is returned by method *StdSelect_BRepOwner::Shape*.
|
||||
|
||||
#### Example
|
||||
@@ -1121,9 +1121,9 @@ The root is the top of a structure hierarchy or structure network. The attribute
|
||||
* Have a type, a scale factor, and a color,
|
||||
* Have a size, shape, and orientation independent of transformations.
|
||||
* **Triangulation**
|
||||
* Have at least three vertices,
|
||||
* Have nodal normals defined for shading,
|
||||
* Have interior attributes -- style, color, front and back material, texture and reflection ratio,
|
||||
* Has at least three vertices,
|
||||
* Has nodal normals defined for shading,
|
||||
* Has interior attributes -- style, color, front and back material, texture and reflection ratio.
|
||||
* **Polylines** or **Segments**
|
||||
* Have two or more vertices,
|
||||
* Have the following attributes -- type, width scale factor, color.
|
||||
@@ -1196,7 +1196,7 @@ aGroup->SetGroupPrimitivesAspect (myDrawer->ShadingAspect()->Aspect());
|
||||
|
||||
@subsubsection occt_visu_4_2_5 Text primitive
|
||||
|
||||
TKOpenGL toolkit renders text labels using texture fonts. *Graphic3d* text primitives have the following features:
|
||||
*TKOpenGL* toolkit renders text labels using texture fonts. *Graphic3d* text primitives have the following features:
|
||||
* fixed size (non-zoomable) or zoomable,
|
||||
* can be rotated to any angle in the view plane,
|
||||
* support unicode charset.
|
||||
@@ -1213,8 +1213,16 @@ void Graphic3d_Group::Text (const Standard_CString theText,
|
||||
const Graphic3d_VerticalTextAlignment theVta,
|
||||
const Standard_Boolean theToEvalMinMax);
|
||||
~~~~~
|
||||
*theText* parameter is the text string, *thePoint* is the three-dimensional position of the text, *theHeight* is the text height, *theAngle* is the orientation of the text (at the moment, this parameter has no effect, but you can specify the text orientation through the *Graphic3d_AspectText3d* attributes).
|
||||
*theTp* parameter defines the text path, *theHta* is the horizontal alignment of the text, *theVta* is the vertical alignment of the text.
|
||||
|
||||
The meaning of these parameters is as follows:
|
||||
* *theText* - the text string,
|
||||
* *thePoint* - the three-dimensional position of the text,
|
||||
* *theHeight* - the text height,
|
||||
* *theAngle* - the text orientation (at the moment, this parameter has no effect, but you can specify the text orientation through the *Graphic3d_AspectText3d* attributes).
|
||||
* *theTp* defines the text path,
|
||||
* *theHta* - the horizontal alignment of the text,
|
||||
* *theVta* - the vertical alignment of the text.
|
||||
|
||||
You can pass FALSE as *theToEvalMinMax* if you do not want the graphic3d structure boundaries to be affected by the text position.
|
||||
|
||||
**Note** that the text orientation angle can be defined by *Graphic3d_AspectText3d* attributes.
|
||||
|
@@ -100,7 +100,7 @@ for the Representation and Presentation of Product Manufacturing Information (PM
|
||||
XDE can read and write GD\&T data of the following types:
|
||||
* dimensions, such as distance, length, radius and so on;
|
||||
* geometric tolerances;
|
||||
* datums, i.e a theoretically exact geometric references, such as point, line or plane, to which toleranced features are related.
|
||||
* datums, i.e theoretically exact geometric references, such as point, line or plane, to which toleranced features are related.
|
||||
|
||||
XDE supports two presentations of GD\&T data:
|
||||
* semantic presentation, i.e. data is stored in a machine-consumable way and includes all information required to understand the
|
||||
@@ -116,7 +116,7 @@ XDE provides capabilities for adding, editing and removing clipping planes.
|
||||
|
||||
@subsection occt_xde_1_9 Saved views
|
||||
|
||||
XDE supports reading from STEP views. Views allow to save information about camera parameters (position, direction, zoom factor, etc.)
|
||||
XDE supports reading from STEP views. Views allow saving information about camera parameters (position, direction, zoom factor, etc.)
|
||||
and visible shapes, PMIs, used clipping planes and notes. Currently, XDE supports saving of clipping planes in XBF format only.
|
||||
|
||||
XDE provides the following view management capabilities:
|
||||
@@ -677,7 +677,7 @@ Each GD\&T entity then corresponds to the dedicated label, the property itself i
|
||||
* *XCAFDimTolObject_GeomToleranceObject* - for geometric tolerances;
|
||||
* *XCAFDimTolObject_DatumObject* - for geometric tolerance Datums.
|
||||
|
||||
GD\&Ts and Shapes are related to by Graph Nodes.
|
||||
GD\&Ts and Shapes are related by Graph Nodes.
|
||||
|
||||
These definitions are common to various exchange formats, at least for STEP.
|
||||
|
||||
@@ -710,7 +710,7 @@ A similar approach can be used for other GD\&T types.
|
||||
|
||||
@subsubsection occt_xde_2_7_3 Editing a GD\&T
|
||||
A newly added GD\&T entity is empty. To set its data a corresponding access object should be used as it is demonstrated
|
||||
below, where the dimension becomes the linear distance between two points.
|
||||
below, where the dimension becomes a linear distance between two points.
|
||||
~~~~~
|
||||
Handle(XCAFDoc_Dimension) aDimAttr;
|
||||
aDimLabel.FindAttribute(XCAFDoc_Dimension::GetID(), aDimAttr);
|
||||
@@ -732,7 +732,7 @@ A similar approach can be used for other GD\&T types.
|
||||
To link a GD\&T entity with other OCAF labels (e.g. representing shapes) one should use the following methods:
|
||||
* *SetDimension* - for dimensions;
|
||||
* *SetGeomTolerance* - for geometric tolerances;
|
||||
* SetDatum - for geometric tolerance datums.
|
||||
* *SetDatum* - for geometric tolerance datums.
|
||||
|
||||
These methods can take a single label or a sequence of labels. All previous links will be removed.
|
||||
|
||||
@@ -751,7 +751,7 @@ In addition, a special method *SetDatumToGeomTol* should be used to link a datum
|
||||
@subsubsection occt_xde_2_7_5 Finding GD\&Ts and reference shapes
|
||||
|
||||
*XCAFDimTolObjects_Tool* class provides basic capabilities for searching GD\&Ts linked to shapes.
|
||||
Using the tool one can get sequences of dimensions, geometric tolerances and datums linked with a shape. A series of related datums is also returned for geometric tolerances.
|
||||
The tool provides sequences of dimensions, geometric tolerances and datums linked with a shape. A series of related datums is also returned for geometric tolerances.
|
||||
|
||||
To get reference shapes for a GD\&T entity one can use *GetRefShapeLabel* from *XCAFDoc_DimTolTool*.
|
||||
|
||||
@@ -798,7 +798,7 @@ if (!myClipPlaneTool->RemoveClippingPlane(aClipPlnLbl))
|
||||
~~~~~
|
||||
The plane will not be removed if it is referenced in at least one view.
|
||||
|
||||
To change clipping plane and its name use *UpdateClippingPlane* method, e.g.:
|
||||
To change the clipping plane and its name use *UpdateClippingPlane* method, e.g.:
|
||||
~~~~~
|
||||
gp_Pln aPln = ...
|
||||
myClipPlaneTool->UpdateClippingPlane(aClipPlnLbl, aPln, "New name of plane");
|
||||
@@ -810,7 +810,7 @@ Standard_Boolean aCapping = ...
|
||||
myClipPlaneTool->SetCapping(aClipPlnLbl, aCapping);
|
||||
~~~~~
|
||||
|
||||
*XCAFDoc_ClippingPlaneTool* can be used to get all clipping plane labels and to check if a label belongs to the ClippingPlane table, e.g.:
|
||||
*XCAFDoc_ClippingPlaneTool* can be used to get all clipping plane labels and to check if a label belongs to the *ClippingPlane table*, e.g.:
|
||||
~~~~~
|
||||
TDF_LabelSequence aClipPlaneLbls;
|
||||
myClipPlaneTool->GetClippingPlanes(aClipPlaneLbls);
|
||||
@@ -834,7 +834,7 @@ for (TDF_LabelSequence::Iterator anIt(aClipPlaneLbls); anIt.More(); anIt.Next())
|
||||
|
||||
@subsection occt_xde_2_9 Saved views
|
||||
|
||||
In an XDE document, Views are managed by the class *XCAFDoc_ViewTool*. It works basing on the same principles as ShapeTool works with Shapes. This tool can be provided on the Main Label or on any sub-label. Views are stored in a child of the starting document label 0.1.7, where a view itself is defined as *XCAFDoc_View* sub-class of *TDF_Attribute*. Views and selected shapes, clipping planes, GD\&Ts and notes are related to by Graph Nodes.
|
||||
In an XDE document, Views are managed by the class *XCAFDoc_ViewTool*. It works basing on the same principles as ShapeTool works with Shapes. This tool can be provided on the Main Label or on any sub-label. Views are stored in a child of the starting document label 0.1.7, where a view itself is defined as *XCAFDoc_View* sub-class of *TDF_Attribute*. Views and selected shapes, clipping planes, GD\&Ts and notes are related by Graph Nodes.
|
||||
|
||||
To query, edit, or initialize a Document to handle views of XCAF, use:
|
||||
~~~~~
|
||||
@@ -899,11 +899,11 @@ To get shapes, clipping planes, GD\&Ts or notes associated with a particular vie
|
||||
* *GetRefAnnotationLabel* - returns a sequence of associated annotated labels.
|
||||
|
||||
And vice versa, to get views that display a particular clipping plane, GD\&T or note use the following methods:
|
||||
* *GetViewLabelsForShape* - returns a sequence of associated view labels for a shape;
|
||||
* *GetViewLabelsForGDT* - returns a sequence of associated view labels for a GD\&T;
|
||||
* *GetViewLabelsForClippingPlane* - returns a sequence of associated view labels for a clipping plane;
|
||||
* *GetViewLabelsForNote* - returns a sequence of associated view labels for a note;
|
||||
* *GetViewLabelsForAnnotation* - returns a sequence of associated view labels for an annotated label.
|
||||
* *GetViewLabelsForShape* - returns a sequence of view labels associated with a shape;
|
||||
* *GetViewLabelsForGDT* - returns a sequence of view labels associated with a GD\&T;
|
||||
* *GetViewLabelsForClippingPlane* - returns a sequence of view labels associated with a clipping plane;
|
||||
* *GetViewLabelsForNote* - returns a sequence of view labels associated with a note;
|
||||
* *GetViewLabelsForAnnotation* - returns a sequence of view labels associated with an annotated label.
|
||||
|
||||
@subsection occt_xde_2_10 Custom notes
|
||||
|
||||
@@ -952,6 +952,26 @@ if (!myCommentNote.IsNull()) {
|
||||
myCommentNote->Set("New comment");
|
||||
}
|
||||
~~~~~
|
||||
In order to edit auxiliary note data such as text and attachment position, plane for rendering and tesselated presentation,
|
||||
one should use a transfer object *XCAFNoteObjects_NoteObject* by GetObject and SetObject methods of *XCAFDoc_Note* class.
|
||||
*XCAFNoteObjects_NoteObject* class provides the following functionality:
|
||||
- HasPlane, GetPlane and SetPlane methods test, get and set plane for note rendering
|
||||
- HasPoint, GetPoint and SetPoint methods test, get and set note attachment position on the annotated object
|
||||
- HasPointText, GetPointText, SetPointText methods test, get and set test position
|
||||
- GetPresentation and SetPresentation methods allow to test for and specify tesselated presentation
|
||||
|
||||
After getting, the transfer object can be edited and set back to the note:
|
||||
~~~~~
|
||||
Handle(XCAFNoteObjects_NoteObject) aNoteObj = myNote->GetObject();
|
||||
if (!aNoteObj.IsNull())
|
||||
{
|
||||
gp_Pnt aPntTxt (...);
|
||||
aNoteObj->SetPointText (aPntTxt);
|
||||
TopoDS_Shape aS = ...;
|
||||
aNoteObj->SetPresentation (aS);
|
||||
myNote->SetObject (aNoteObj);
|
||||
}
|
||||
~~~~~
|
||||
|
||||
@subsubsection occt_xde_2_10_4 Adding Notes
|
||||
|
||||
|
@@ -14,9 +14,9 @@ Requirements for building sample:
|
||||
* Android NDK r9d or newer
|
||||
* Apache Ant 1.9.4 or higher
|
||||
* OCCT compiled under Android platform and placed in directories:
|
||||
* occt\libs\armeabi-v7a\*.so and occt\inc\*.hxx (libraries and include files of OCCT install)
|
||||
* android\assets\opencascade\shared\Shaders\* (Shaders folder of OCCT install: \share\opencascade\resources\Shaders)
|
||||
* 3rdparty\include\freetype2\*, 3rdparty\include\FreeImage.h and 3rdparty\libs\armeabi-v7a\libFreeImage.so and 3rdparty\libs\armeabi-v7a\libfreetype.so
|
||||
* occt/libs/armeabi-v7a/*.so and occt/inc/*.hxx (libraries and include files of OCCT install)
|
||||
* android/assets/opencascade/shared/Shaders/* (Shaders folder of OCCT install: /share/opencascade/resources/Shaders)
|
||||
* 3rdparty/include/freetype2/*, 3rdparty/include/FreeImage.h and 3rdparty/libs/armeabi-v7a/libFreeImage.so and 3rdparty/libs/armeabi-v7a/libfreetype.so
|
||||
|
||||
It is also possible to to correct OCCT.pri file an get resources from another tree of directories.
|
||||
|
||||
|
@@ -3,3 +3,7 @@ project(FuncDemo)
|
||||
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit_prepare_sample)
|
||||
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit)
|
||||
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit_prepare_sample)
|
||||
|
||||
if (BUILD_Inspector)
|
||||
target_link_libraries (FuncDemo TKTInspector)
|
||||
endif()
|
||||
|
@@ -84,6 +84,11 @@
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_Inspector
|
||||
#include <inspector/TInspector_Communicator.hxx>
|
||||
static TInspector_Communicator* MyTCommunicator;
|
||||
#endif
|
||||
|
||||
MainWindow::MainWindow()
|
||||
{
|
||||
graph = new GraphWidget(this);
|
||||
@@ -224,6 +229,30 @@ void MainWindow::nbThreads()
|
||||
graph->setNbThreads(nb);
|
||||
}
|
||||
|
||||
#ifdef HAVE_Inspector
|
||||
void MainWindow::startDFBrowser()
|
||||
{
|
||||
Handle(AppStd_Application) anApplication = getApplication();
|
||||
if (!anApplication.IsNull())
|
||||
{
|
||||
if (!MyTCommunicator)
|
||||
{
|
||||
MyTCommunicator = new TInspector_Communicator();
|
||||
|
||||
NCollection_List<Handle(Standard_Transient)> aParameters;
|
||||
aParameters.Append(anApplication);
|
||||
|
||||
MyTCommunicator->RegisterPlugin("TKDFBrowser");
|
||||
|
||||
MyTCommunicator->Init(aParameters);
|
||||
MyTCommunicator->Activate("TKDFBrowser");
|
||||
|
||||
}
|
||||
MyTCommunicator->SetVisible(true);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void MainWindow::about()
|
||||
{
|
||||
QMessageBox::about(this, tr("Test-application of the advanced Function Mechanism"),
|
||||
@@ -250,6 +279,12 @@ void MainWindow::createActions()
|
||||
nbThreadsAct->setStatusTip(tr("Number of threads"));
|
||||
connect(nbThreadsAct, SIGNAL(triggered()), this, SLOT(nbThreads()));
|
||||
|
||||
#ifdef HAVE_Inspector
|
||||
dfBrowserAct = new QAction(tr("DFBrowser"), this);
|
||||
dfBrowserAct->setStatusTip(tr("OCAF structure presentation"));
|
||||
connect(dfBrowserAct, SIGNAL(triggered()), this, SLOT(startDFBrowser()));
|
||||
#endif
|
||||
|
||||
exitAct = new QAction(tr("E&xit"), this);
|
||||
exitAct->setShortcut(tr("Ctrl+Q"));
|
||||
exitAct->setStatusTip(tr("Exit the application"));
|
||||
@@ -269,6 +304,10 @@ void MainWindow::createMenus()
|
||||
computeMenu->addAction(computeAct);
|
||||
computeMenu->addAction(nbThreadsAct);
|
||||
computeMenu->addSeparator();
|
||||
#ifdef HAVE_Inspector
|
||||
computeMenu->addAction(dfBrowserAct);
|
||||
computeMenu->addSeparator();
|
||||
#endif
|
||||
computeMenu->addAction(exitAct);
|
||||
|
||||
menuBar()->addSeparator();
|
||||
|
@@ -70,6 +70,9 @@ private slots:
|
||||
void model2();
|
||||
void compute();
|
||||
void nbThreads();
|
||||
#ifdef HAVE_Inspector
|
||||
void startDFBrowser();
|
||||
#endif
|
||||
void about();
|
||||
|
||||
private:
|
||||
@@ -87,6 +90,9 @@ private:
|
||||
QAction *model2Act;
|
||||
QAction *computeAct;
|
||||
QAction *nbThreadsAct;
|
||||
#ifdef HAVE_Inspector
|
||||
QAction *dfBrowserAct;
|
||||
#endif
|
||||
QAction *exitAct;
|
||||
QAction *aboutAct;
|
||||
|
||||
|
@@ -632,6 +632,9 @@ void AIS_ColoredShape::addShapesWithCustomProps (const Handle(Prs3d_Presentation
|
||||
{
|
||||
aShadedGroup = Prs3d_Root::NewGroup (thePrs);
|
||||
aShadedGroup->SetClosed (isClosed);
|
||||
if (isClosed
|
||||
&& !myCappingStyle.IsNull())
|
||||
aShadedGroup->SetGroupPrimitivesAspect (myCappingStyle);
|
||||
}
|
||||
aShadedGroup->SetPrimitivesAspect (aDrawer->ShadingAspect()->Aspect());
|
||||
aShadedGroup->AddPrimitiveArray (aTriangles);
|
||||
|
@@ -2491,6 +2491,33 @@ void AIS_InteractiveContext::ClearGlobalPrs (const Handle(AIS_InteractiveObject)
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ClearDetected
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean AIS_InteractiveContext::ClearDetected (Standard_Boolean theToRedrawImmediate)
|
||||
{
|
||||
myCurDetected = 0;
|
||||
myCurHighlighted = 0;
|
||||
myDetectedSeq.Clear();
|
||||
myLastPicked = myLastinMain;
|
||||
myWasLastMain = Standard_True;
|
||||
Standard_Boolean toUpdate = Standard_False;
|
||||
if (!myLastPicked.IsNull() && myLastPicked->HasSelectable())
|
||||
{
|
||||
toUpdate = Standard_True;
|
||||
clearDynamicHighlight();
|
||||
}
|
||||
myLastinMain.Nullify();
|
||||
myLastPicked.Nullify();
|
||||
myMainSel->ClearPicked();
|
||||
if (toUpdate && theToRedrawImmediate)
|
||||
{
|
||||
myMainVwr->RedrawImmediate();
|
||||
}
|
||||
return toUpdate;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : DrawHiddenLine
|
||||
//purpose :
|
||||
@@ -2783,7 +2810,7 @@ Standard_Boolean AIS_InteractiveContext::PlaneSize (Standard_Real& theX,
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_InteractiveContext::SetZLayer (const Handle(AIS_InteractiveObject)& theIObj,
|
||||
const Standard_Integer theLayerId)
|
||||
const Graphic3d_ZLayerId theLayerId)
|
||||
{
|
||||
if (theIObj.IsNull())
|
||||
return;
|
||||
@@ -2795,7 +2822,7 @@ void AIS_InteractiveContext::SetZLayer (const Handle(AIS_InteractiveObject)& the
|
||||
//function : GetZLayer
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Integer AIS_InteractiveContext::GetZLayer (const Handle(AIS_InteractiveObject)& theIObj) const
|
||||
Graphic3d_ZLayerId AIS_InteractiveContext::GetZLayer (const Handle(AIS_InteractiveObject)& theIObj) const
|
||||
{
|
||||
return !theIObj.IsNull()
|
||||
? theIObj->ZLayer()
|
||||
|
@@ -264,12 +264,12 @@ public: //! @name object presence management (View affinity, Layer, Priority)
|
||||
Standard_EXPORT void SetDisplayPriority (const Handle(AIS_InteractiveObject)& theIObj, const Standard_Integer thePriority);
|
||||
|
||||
//! Get Z layer id set for displayed interactive object.
|
||||
Standard_EXPORT Standard_Integer GetZLayer (const Handle(AIS_InteractiveObject)& theIObj) const;
|
||||
Standard_EXPORT Graphic3d_ZLayerId GetZLayer (const Handle(AIS_InteractiveObject)& theIObj) const;
|
||||
|
||||
//! Set Z layer id for interactive object.
|
||||
//! The Z layers can be used to display temporarily presentations of some object in front of the other objects in the scene.
|
||||
//! The ids for Z layers are generated by V3d_Viewer.
|
||||
Standard_EXPORT void SetZLayer (const Handle(AIS_InteractiveObject)& theIObj, const Standard_Integer theLayerId);
|
||||
Standard_EXPORT void SetZLayer (const Handle(AIS_InteractiveObject)& theIObj, const Graphic3d_ZLayerId theLayerId);
|
||||
|
||||
//! Setup object visibility in specified view.
|
||||
//! Has no effect if object is not displayed in this context.
|
||||
@@ -347,6 +347,11 @@ public: //! @name mouse picking logic (detection and dynamic highlighting of ent
|
||||
const Handle(V3d_View)& theView,
|
||||
const Standard_Boolean theToRedrawOnUpdate);
|
||||
|
||||
//! Clears the list of entities detected by MoveTo() and resets dynamic highlighting.
|
||||
//! @param theToRedrawImmediate if TRUE, the main Viewer will be redrawn on update
|
||||
//! @return TRUE if viewer needs to be updated (e.g. there were actually dynamically highlighted entities)
|
||||
Standard_EXPORT Standard_Boolean ClearDetected (Standard_Boolean theToRedrawImmediate = Standard_False);
|
||||
|
||||
//! Returns true if there is a mouse-detected entity in context.
|
||||
//! @sa DetectedOwner()/HasNextDetected()/HilightPreviousDetected()/HilightNextDetected().
|
||||
Standard_EXPORT Standard_Boolean HasDetected() const;
|
||||
|
@@ -21,6 +21,7 @@
|
||||
#include <Aspect_PolygonOffsetMode.hxx>
|
||||
#include <Bnd_Box.hxx>
|
||||
#include <Graphic3d_AspectFillArea3d.hxx>
|
||||
#include <Graphic3d_AspectFillCapping.hxx>
|
||||
#include <Graphic3d_AspectLine3d.hxx>
|
||||
#include <Graphic3d_AspectMarker3d.hxx>
|
||||
#include <Graphic3d_AspectText3d.hxx>
|
||||
@@ -277,6 +278,37 @@ void AIS_InteractiveObject::UnsetMaterial()
|
||||
hasOwnMaterial = Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetCappingStyle
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_InteractiveObject::SetCappingStyle (const Handle(Graphic3d_AspectFillCapping)& theStyle)
|
||||
{
|
||||
myCappingStyle = theStyle;
|
||||
|
||||
// Modify existing presentations
|
||||
for (Standard_Integer aPrsIter = 1, n = myPresentations.Length(); aPrsIter <= n; ++aPrsIter)
|
||||
{
|
||||
const Handle(PrsMgr_Presentation)& aPrs3d = myPresentations (aPrsIter).Presentation();
|
||||
if (!aPrs3d.IsNull())
|
||||
{
|
||||
const Handle(Graphic3d_Structure)& aStruct = aPrs3d->Presentation();
|
||||
if (!aStruct.IsNull())
|
||||
{
|
||||
const Graphic3d_SequenceOfGroup& aGroups = aStruct->Groups();
|
||||
for (Graphic3d_SequenceOfGroup::Iterator aGroupIter (aGroups); aGroupIter.More(); aGroupIter.Next())
|
||||
{
|
||||
Handle(Graphic3d_Group)& aGrp = aGroupIter.ChangeValue();
|
||||
if (aGrp.IsNull())
|
||||
continue;
|
||||
|
||||
aGrp->SetGroupPrimitivesAspect (theStyle);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetTransparency
|
||||
//purpose :
|
||||
@@ -621,10 +653,11 @@ void AIS_InteractiveObject::SynchronizeAspects()
|
||||
continue;
|
||||
}
|
||||
|
||||
Handle(Graphic3d_AspectLine3d) aLineAspect = aGrp->LineAspect();
|
||||
Handle(Graphic3d_AspectFillArea3d) aFaceAspect = aGrp->FillAreaAspect();
|
||||
Handle(Graphic3d_AspectMarker3d) aMarkerAspect = aGrp->MarkerAspect();
|
||||
Handle(Graphic3d_AspectText3d) aTextAspect = aGrp->TextAspect();
|
||||
Handle(Graphic3d_AspectLine3d) aLineAspect = aGrp->LineAspect();
|
||||
Handle(Graphic3d_AspectFillArea3d) aFaceAspect = aGrp->FillAreaAspect();
|
||||
Handle(Graphic3d_AspectFillCapping) aCappingAspect = aGrp->FillCappingAspect();
|
||||
Handle(Graphic3d_AspectMarker3d) aMarkerAspect = aGrp->MarkerAspect();
|
||||
Handle(Graphic3d_AspectText3d) aTextAspect = aGrp->TextAspect();
|
||||
if (!aLineAspect.IsNull())
|
||||
{
|
||||
aGrp->SetGroupPrimitivesAspect (aLineAspect);
|
||||
@@ -633,6 +666,10 @@ void AIS_InteractiveObject::SynchronizeAspects()
|
||||
{
|
||||
aGrp->SetGroupPrimitivesAspect (aFaceAspect);
|
||||
}
|
||||
if (!aCappingAspect.IsNull())
|
||||
{
|
||||
aGrp->SetGroupPrimitivesAspect (aCappingAspect);
|
||||
}
|
||||
if (!aMarkerAspect.IsNull())
|
||||
{
|
||||
aGrp->SetGroupPrimitivesAspect (aMarkerAspect);
|
||||
@@ -641,6 +678,7 @@ void AIS_InteractiveObject::SynchronizeAspects()
|
||||
{
|
||||
aGrp->SetGroupPrimitivesAspect (aTextAspect);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -306,10 +306,16 @@ public:
|
||||
//! Material aspect determines shading aspect, color and
|
||||
//! transparency of visible entities.
|
||||
Standard_EXPORT virtual void SetMaterial (const Graphic3d_MaterialAspect& aName);
|
||||
|
||||
|
||||
//! Removes the setting for material.
|
||||
Standard_EXPORT virtual void UnsetMaterial();
|
||||
|
||||
|
||||
//! Set style of filling capping section created by clipping planes.
|
||||
Standard_EXPORT virtual void SetCappingStyle (const Handle(Graphic3d_AspectFillCapping)& theStyle);
|
||||
|
||||
//! Returns style for filling capping section created by clipping planes.
|
||||
const Handle(Graphic3d_AspectFillCapping)& CappingStyle() const { return myCappingStyle; }
|
||||
|
||||
//! Attributes a setting aValue for transparency.
|
||||
//! The transparency value should be between 0.0 and 1.0.
|
||||
//! At 0.0 an object will be totally opaque, and at 1.0, fully transparent.
|
||||
@@ -416,7 +422,7 @@ protected:
|
||||
Standard_Boolean hasOwnColor;
|
||||
Standard_Boolean hasOwnMaterial;
|
||||
Standard_Boolean myRecomputeEveryPrs;
|
||||
|
||||
Handle(Graphic3d_AspectFillCapping) myCappingStyle;
|
||||
};
|
||||
|
||||
DEFINE_STANDARD_HANDLE(AIS_InteractiveObject, SelectMgr_SelectableObject)
|
||||
|
@@ -161,10 +161,7 @@ void AIS_Shape::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aPresentat
|
||||
try
|
||||
{
|
||||
OCC_CATCH_SIGNALS
|
||||
StdPrs_ShadedShape::Add (aPrs, myshape, myDrawer,
|
||||
myDrawer->ShadingAspect()->Aspect()->ToMapTexture()
|
||||
&& !myDrawer->ShadingAspect()->Aspect()->TextureMap().IsNull(),
|
||||
myUVOrigin, myUVRepeat, myUVScale);
|
||||
StdPrs_ShadedShape::Add (aPrs, myshape, myDrawer, myCappingStyle);
|
||||
}
|
||||
catch (Standard_Failure const& anException)
|
||||
{
|
||||
|
2104
src/AIS/AIS_ViewCube.cxx
Normal file
1059
src/AIS/AIS_ViewCube.hxx
Normal file
@@ -181,3 +181,5 @@ AIS_TypeOfAxis.hxx
|
||||
AIS_TypeOfDist.hxx
|
||||
AIS_TypeOfIso.hxx
|
||||
AIS_TypeOfPlane.hxx
|
||||
AIS_ViewCube.hxx
|
||||
AIS_ViewCube.cxx
|
||||
|
@@ -91,3 +91,6 @@ Error: The Feature Removal algorithm has failed
|
||||
|
||||
.BOPAlgo_AlertSolidBuilderUnusedFaces
|
||||
Warning: Some of the faces passed to the Solid Builder algorithm have not been classified and not used for solids creation
|
||||
|
||||
.BOPAlgo_AlertUnableToOrientTheShape
|
||||
Warning: Unable to orient the shape correctly
|
||||
|
@@ -104,4 +104,7 @@ DEFINE_SIMPLE_ALERT(BOPAlgo_AlertRemoveFeaturesFailed)
|
||||
//! and not used for solids creation
|
||||
DEFINE_ALERT_WITH_SHAPE(BOPAlgo_AlertSolidBuilderUnusedFaces)
|
||||
|
||||
//! Unable to orient the shape correctly
|
||||
DEFINE_ALERT_WITH_SHAPE(BOPAlgo_AlertUnableToOrientTheShape)
|
||||
|
||||
#endif // _BOPAlgo_Alerts_HeaderFile
|
||||
|
@@ -93,4 +93,7 @@ static const char BOPAlgo_BOPAlgo_msg[] =
|
||||
"Error: The Feature Removal algorithm has failed\n"
|
||||
"\n"
|
||||
".BOPAlgo_AlertSolidBuilderUnusedFaces\n"
|
||||
"Warning: Some of the faces passed to the Solid Builder algorithm have not been classified and not used for solids creation\n";
|
||||
"Warning: Some of the faces passed to the Solid Builder algorithm have not been classified and not used for solids creation\n"
|
||||
"\n"
|
||||
".BOPAlgo_AlertUnableToOrientTheShape\n"
|
||||
"Warning: Unable to orient the shape correctly\n";
|
||||
|
@@ -58,6 +58,10 @@ class BOPAlgo_PaveFiller;
|
||||
//! i.e. the check is performed. Setting this flag to FALSE for inverted solids,
|
||||
//! most likely will lead to incorrect results.
|
||||
//!
|
||||
//! The algorithm returns the following warnings:
|
||||
//! - *BOPAlgo_AlertUnableToOrientTheShape* - in case the check on the orientation of the split shape
|
||||
//! to match the orientation of the original shape has failed.
|
||||
//!
|
||||
//! The algorithm returns the following Error statuses:
|
||||
//! - *BOPAlgo_AlertTooFewArguments* - in case there are no enough arguments to perform the operation;
|
||||
//! - *BOPAlgo_AlertNoFiller* - in case the intersection tool has not been created;
|
||||
|
@@ -226,7 +226,7 @@ void BOPAlgo_Builder::FillImagesVertices()
|
||||
{
|
||||
TopoDS_Shape aSSIm = aItIm.Value();
|
||||
if (!aSSIm.IsEqual(aSS) &&
|
||||
BOPTools_AlgoTools::IsSplitToReverse(aSSIm, aSS, myContext))
|
||||
BOPTools_AlgoTools::IsSplitToReverseWithWarn(aSSIm, aSS, myContext, myReport))
|
||||
{
|
||||
aSSIm.Reverse();
|
||||
}
|
||||
|
@@ -61,7 +61,8 @@
|
||||
static
|
||||
TopoDS_Face BuildDraftFace(const TopoDS_Face& theFace,
|
||||
const TopTools_DataMapOfShapeListOfShape& theImages,
|
||||
Handle(IntTools_Context)& theCtx);
|
||||
Handle(IntTools_Context)& theCtx,
|
||||
const Handle(Message_Report)& theReport);
|
||||
|
||||
//=======================================================================
|
||||
//class : BOPAlgo_PairOfShapeBoolean
|
||||
@@ -311,7 +312,7 @@ void BOPAlgo_Builder::BuildSplitFaces()
|
||||
// the draft face will be null, as such sub-shapes may split the face on parts
|
||||
// (as in the case "bugs modalg_5 bug25245_1").
|
||||
// The BuilderFace algorithm will be called in this case.
|
||||
TopoDS_Face aFD = BuildDraftFace(aF, myImages, myContext);
|
||||
TopoDS_Face aFD = BuildDraftFace(aF, myImages, myContext, myReport);
|
||||
if (!aFD.IsNull())
|
||||
{
|
||||
aFacesIm(aFacesIm.Add(i, TopTools_ListOfShape())).Append(aFD);
|
||||
@@ -404,7 +405,7 @@ void BOPAlgo_Builder::BuildSplitFaces()
|
||||
}// if (bIsClosed){
|
||||
//
|
||||
aSp.Orientation(anOriE);
|
||||
bToReverse=BOPTools_AlgoTools::IsSplitToReverse(aSp, aE, myContext);
|
||||
bToReverse=BOPTools_AlgoTools::IsSplitToReverseWithWarn(aSp, aE, myContext, myReport);
|
||||
if (bToReverse) {
|
||||
aSp.Reverse();
|
||||
}
|
||||
@@ -813,21 +814,27 @@ void BOPAlgo_Builder::FillInternalVertices()
|
||||
//purpose : Checks if the edge has multi-connected vertices.
|
||||
//=======================================================================
|
||||
static Standard_Boolean HasMultiConnected(const TopoDS_Edge& theEdge,
|
||||
TopTools_DataMapOfShapeInteger& theMap)
|
||||
TopTools_DataMapOfShapeListOfShape& theMap)
|
||||
{
|
||||
TopoDS_Iterator itV(theEdge);
|
||||
for (; itV.More(); itV.Next())
|
||||
{
|
||||
const TopoDS_Shape& aV = itV.Value();
|
||||
Standard_Integer *pCounter = theMap.ChangeSeek(aV);
|
||||
if (!pCounter)
|
||||
pCounter = theMap.Bound(aV, 1);
|
||||
TopTools_ListOfShape *pList = theMap.ChangeSeek(aV);
|
||||
if (!pList)
|
||||
{
|
||||
pList = theMap.Bound(aV, TopTools_ListOfShape());
|
||||
pList->Append(theEdge);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (*pCounter == 2)
|
||||
return Standard_True;
|
||||
// The list is expected to be 1-2 elements long,
|
||||
// thus using "Contains" is safe.
|
||||
if (!pList->Contains(theEdge))
|
||||
pList->Append(theEdge);
|
||||
|
||||
++(*pCounter);
|
||||
if (pList->Extent() > 2)
|
||||
return Standard_True;
|
||||
}
|
||||
}
|
||||
return Standard_False;
|
||||
@@ -839,7 +846,8 @@ static Standard_Boolean HasMultiConnected(const TopoDS_Edge& theEdge,
|
||||
//=======================================================================
|
||||
TopoDS_Face BuildDraftFace(const TopoDS_Face& theFace,
|
||||
const TopTools_DataMapOfShapeListOfShape& theImages,
|
||||
Handle(IntTools_Context)& theCtx)
|
||||
Handle(IntTools_Context)& theCtx,
|
||||
const Handle(Message_Report)& theReport)
|
||||
{
|
||||
BRep_Builder aBB;
|
||||
// Take the information from the original face
|
||||
@@ -855,7 +863,7 @@ TopoDS_Face BuildDraftFace(const TopoDS_Face& theFace,
|
||||
// the vertices appearance, and if the multi-connexity is met return
|
||||
// the null face to use the BuilderFace algorithm for checking the
|
||||
// possibility of split.
|
||||
TopTools_DataMapOfShapeInteger aVerticesCounter;
|
||||
TopTools_DataMapOfShapeListOfShape aVerticesCounter;
|
||||
|
||||
// Update wires of the original face and add them to draft face
|
||||
TopoDS_Iterator aItW(theFace.Oriented(TopAbs_FORWARD));
|
||||
@@ -885,20 +893,21 @@ TopoDS_Face BuildDraftFace(const TopoDS_Face& theFace,
|
||||
return TopoDS_Face();
|
||||
}
|
||||
|
||||
// Check if the original edge is degenerated
|
||||
Standard_Boolean bIsDegenerated = BRep_Tool::Degenerated(aE);
|
||||
|
||||
// Check for the splits of the edge
|
||||
const TopTools_ListOfShape* pLEIm = theImages.Seek(aE);
|
||||
if (!pLEIm)
|
||||
{
|
||||
// Check if the edge has multi-connected vertices
|
||||
if (HasMultiConnected(aE, aVerticesCounter))
|
||||
if (!bIsDegenerated && HasMultiConnected(aE, aVerticesCounter))
|
||||
return TopoDS_Face();
|
||||
|
||||
aBB.Add(aNewWire, aE);
|
||||
continue;
|
||||
}
|
||||
|
||||
// Check if the original edge is degenerated
|
||||
Standard_Boolean bIsDegenerated = BRep_Tool::Degenerated(aE);
|
||||
// Check if the original edge is closed on the face
|
||||
Standard_Boolean bIsClosed = BRep_Tool::IsClosed(aE, theFace);
|
||||
|
||||
@@ -908,7 +917,7 @@ TopoDS_Face BuildDraftFace(const TopoDS_Face& theFace,
|
||||
TopoDS_Edge& aSp = TopoDS::Edge(aItLEIm.Value());
|
||||
|
||||
// Check if the split has multi-connected vertices
|
||||
if (HasMultiConnected(aSp, aVerticesCounter))
|
||||
if (!bIsDegenerated && HasMultiConnected(aSp, aVerticesCounter))
|
||||
return TopoDS_Face();
|
||||
|
||||
aSp.Orientation(anOriE);
|
||||
@@ -918,13 +927,13 @@ TopoDS_Face BuildDraftFace(const TopoDS_Face& theFace,
|
||||
continue;
|
||||
}
|
||||
|
||||
// Check closeness of the split edge and if it is not
|
||||
// make the second PCurve
|
||||
// If the original edge is closed on the face check closeness
|
||||
// of the split edge and if it is not closed make the second PCurve
|
||||
if (bIsClosed && !BRep_Tool::IsClosed(aSp, theFace))
|
||||
BOPTools_AlgoTools3D::DoSplitSEAMOnFace(aSp, theFace);
|
||||
|
||||
// Check if the split should be reversed
|
||||
if (BOPTools_AlgoTools::IsSplitToReverse(aSp, aE, theCtx))
|
||||
if (BOPTools_AlgoTools::IsSplitToReverseWithWarn(aSp, aE, theCtx, theReport))
|
||||
aSp.Reverse();
|
||||
|
||||
aBB.Add(aNewWire, aSp);
|
||||
|
@@ -287,8 +287,8 @@ void BOPAlgo_Builder::BuildDraftSolid(const TopoDS_Shape& theSolid,
|
||||
theLIF.Append(aFx);
|
||||
}
|
||||
else {
|
||||
bToReverse=BOPTools_AlgoTools::IsSplitToReverse
|
||||
(aFx, aF, myContext);
|
||||
bToReverse=BOPTools_AlgoTools::IsSplitToReverseWithWarn
|
||||
(aFx, aF, myContext, myReport);
|
||||
if (bToReverse) {
|
||||
aFx.Reverse();
|
||||
}
|
||||
|
@@ -17,6 +17,7 @@
|
||||
|
||||
|
||||
#include <BOPTools_AlgoTools.hxx>
|
||||
#include <BOPAlgo_Alerts.hxx>
|
||||
#include <BOPTools_AlgoTools2D.hxx>
|
||||
#include <BOPTools_AlgoTools3D.hxx>
|
||||
#include <BOPTools_CoupleOfShape.hxx>
|
||||
@@ -64,6 +65,7 @@
|
||||
#include <TopTools_IndexedMapOfShape.hxx>
|
||||
#include <TopTools_MapOfShape.hxx>
|
||||
#include <TopTools_MapOfOrientedShape.hxx>
|
||||
#include <Message_Report.hxx>
|
||||
#include <NCollection_Array1.hxx>
|
||||
#include <algorithm>
|
||||
|
||||
@@ -77,7 +79,7 @@ static
|
||||
Standard_Boolean FindFacePairs (const TopoDS_Edge& theE,
|
||||
const TopTools_ListOfShape& thLF,
|
||||
BOPTools_ListOfCoupleOfShape& theLCFF,
|
||||
Handle(IntTools_Context)& theContext);
|
||||
const Handle(IntTools_Context)& theContext);
|
||||
static
|
||||
TopAbs_Orientation Orientation(const TopoDS_Edge& anE,
|
||||
const TopoDS_Face& aF);
|
||||
@@ -91,7 +93,7 @@ static
|
||||
const Standard_Boolean theSmallFaces,
|
||||
gp_Dir& aDN,
|
||||
gp_Dir& aDB,
|
||||
Handle(IntTools_Context)& theContext,
|
||||
const Handle(IntTools_Context)& theContext,
|
||||
GeomAPI_ProjectPointOnSurf& aProjPL,
|
||||
const Standard_Real aDt);
|
||||
static
|
||||
@@ -99,7 +101,7 @@ static
|
||||
const gp_Pnt& aP,
|
||||
gp_Dir& aDB,
|
||||
gp_Pnt& aPOut,
|
||||
Handle(IntTools_Context)& theContext,
|
||||
const Handle(IntTools_Context)& theContext,
|
||||
GeomAPI_ProjectPointOnSurf& aProjPL,
|
||||
const Standard_Real aDt,
|
||||
const Standard_Real aTolE);
|
||||
@@ -108,7 +110,7 @@ static
|
||||
const TopoDS_Face& theF1,
|
||||
const BOPTools_ListOfCoupleOfShape& theLCS,
|
||||
const gp_Pnt& aP,
|
||||
Handle(IntTools_Context)& theContext,
|
||||
const Handle(IntTools_Context)& theContext,
|
||||
Standard_Boolean& theSmallFaces);
|
||||
|
||||
|
||||
@@ -589,7 +591,7 @@ TopAbs_State BOPTools_AlgoTools::ComputeStateByOnePoint
|
||||
(const TopoDS_Shape& theS,
|
||||
const TopoDS_Solid& theRef,
|
||||
const Standard_Real theTol,
|
||||
Handle(IntTools_Context)& theContext)
|
||||
const Handle(IntTools_Context)& theContext)
|
||||
{
|
||||
TopAbs_State aState;
|
||||
TopAbs_ShapeEnum aType;
|
||||
@@ -616,7 +618,7 @@ TopAbs_State BOPTools_AlgoTools::ComputeState
|
||||
const TopoDS_Solid& theRef,
|
||||
const Standard_Real theTol,
|
||||
TopTools_IndexedMapOfShape& theBounds,
|
||||
Handle(IntTools_Context)& theContext)
|
||||
const Handle(IntTools_Context)& theContext)
|
||||
{
|
||||
TopAbs_State aState;
|
||||
TopExp_Explorer aExp;
|
||||
@@ -665,7 +667,7 @@ TopAbs_State BOPTools_AlgoTools::ComputeState
|
||||
(const TopoDS_Vertex& theV,
|
||||
const TopoDS_Solid& theRef,
|
||||
const Standard_Real theTol,
|
||||
Handle(IntTools_Context)& theContext)
|
||||
const Handle(IntTools_Context)& theContext)
|
||||
{
|
||||
TopAbs_State aState;
|
||||
gp_Pnt aP3D;
|
||||
@@ -683,7 +685,7 @@ TopAbs_State BOPTools_AlgoTools::ComputeState
|
||||
(const TopoDS_Edge& theE,
|
||||
const TopoDS_Solid& theRef,
|
||||
const Standard_Real theTol,
|
||||
Handle(IntTools_Context)& theContext)
|
||||
const Handle(IntTools_Context)& theContext)
|
||||
{
|
||||
Standard_Real aT1, aT2, aT = 0.;
|
||||
TopAbs_State aState;
|
||||
@@ -735,7 +737,7 @@ TopAbs_State BOPTools_AlgoTools::ComputeState
|
||||
(const gp_Pnt& theP,
|
||||
const TopoDS_Solid& theRef,
|
||||
const Standard_Real theTol,
|
||||
Handle(IntTools_Context)& theContext)
|
||||
const Handle(IntTools_Context)& theContext)
|
||||
{
|
||||
TopAbs_State aState;
|
||||
//
|
||||
@@ -755,7 +757,7 @@ Standard_Boolean BOPTools_AlgoTools::IsInternalFace
|
||||
const TopoDS_Solid& theSolid,
|
||||
TopTools_IndexedDataMapOfShapeListOfShape& theMEF,
|
||||
const Standard_Real theTol,
|
||||
Handle(IntTools_Context)& theContext)
|
||||
const Handle(IntTools_Context)& theContext)
|
||||
{
|
||||
Standard_Boolean bDegenerated;
|
||||
Standard_Integer aNbF, iRet, iFound;
|
||||
@@ -866,7 +868,7 @@ Standard_Integer BOPTools_AlgoTools::IsInternalFace
|
||||
(const TopoDS_Face& theFace,
|
||||
const TopoDS_Edge& theEdge,
|
||||
TopTools_ListOfShape& theLF,
|
||||
Handle(IntTools_Context)& theContext)
|
||||
const Handle(IntTools_Context)& theContext)
|
||||
{
|
||||
Standard_Integer aNbF, iRet;
|
||||
//
|
||||
@@ -911,7 +913,7 @@ Standard_Integer BOPTools_AlgoTools::IsInternalFace
|
||||
const TopoDS_Edge& theEdge,
|
||||
const TopoDS_Face& theFace1,
|
||||
const TopoDS_Face& theFace2,
|
||||
Handle(IntTools_Context)& theContext)
|
||||
const Handle(IntTools_Context)& theContext)
|
||||
{
|
||||
Standard_Boolean bRet;
|
||||
Standard_Integer iRet;
|
||||
@@ -965,7 +967,7 @@ Standard_Boolean BOPTools_AlgoTools::GetFaceOff
|
||||
const TopoDS_Face& theF1,
|
||||
BOPTools_ListOfCoupleOfShape& theLCSOff,
|
||||
TopoDS_Face& theFOff,
|
||||
Handle(IntTools_Context)& theContext)
|
||||
const Handle(IntTools_Context)& theContext)
|
||||
{
|
||||
Standard_Boolean bRet, bIsComputed;
|
||||
Standard_Real aT, aT1, aT2, aAngle, aTwoPI, aAngleMin, aDt3D;
|
||||
@@ -1091,7 +1093,7 @@ Standard_Boolean BOPTools_AlgoTools::GetEdgeOff(const TopoDS_Edge& theE1,
|
||||
Standard_Boolean BOPTools_AlgoTools::AreFacesSameDomain
|
||||
(const TopoDS_Face& theF1,
|
||||
const TopoDS_Face& theF2,
|
||||
Handle(IntTools_Context)& theContext,
|
||||
const Handle(IntTools_Context)& theContext,
|
||||
const Standard_Real theFuzz)
|
||||
{
|
||||
Standard_Boolean bFacesSD = Standard_False;
|
||||
@@ -1151,43 +1153,13 @@ Standard_Boolean BOPTools_AlgoTools::AreFacesSameDomain
|
||||
return bFacesSD;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : CheckSameGeom
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean BOPTools_AlgoTools::CheckSameGeom
|
||||
(const TopoDS_Face& theF1,
|
||||
const TopoDS_Face& theF2,
|
||||
Handle(IntTools_Context)& theContext)
|
||||
{
|
||||
Standard_Boolean bRet;
|
||||
Standard_Real aTolF1, aTolF2, aTol;
|
||||
gp_Pnt2d aP2D;
|
||||
gp_Pnt aP;
|
||||
TopExp_Explorer aExp;
|
||||
//
|
||||
bRet=Standard_False;
|
||||
aExp.Init(theF1, TopAbs_EDGE);
|
||||
for (; aExp.More(); aExp.Next()) {
|
||||
const TopoDS_Edge& aE=(*(TopoDS_Edge*)(&aExp.Current()));
|
||||
if (!BRep_Tool::Degenerated(aE)) {
|
||||
aTolF1=BRep_Tool::Tolerance(theF1);
|
||||
aTolF2=BRep_Tool::Tolerance(theF2);
|
||||
aTol=aTolF1+aTolF2;
|
||||
BOPTools_AlgoTools3D::PointNearEdge(aE, theF1, aP2D, aP, theContext);
|
||||
bRet=theContext->IsValidPointForFace(aP, theF2, aTol);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return bRet;
|
||||
}
|
||||
//=======================================================================
|
||||
// function: Sense
|
||||
// purpose:
|
||||
//=======================================================================
|
||||
Standard_Integer BOPTools_AlgoTools::Sense (const TopoDS_Face& theF1,
|
||||
const TopoDS_Face& theF2,
|
||||
const Handle(IntTools_Context)& theContext)
|
||||
Standard_Integer BOPTools_AlgoTools::Sense(const TopoDS_Face& theF1,
|
||||
const TopoDS_Face& theF2,
|
||||
const Handle(IntTools_Context)& theContext)
|
||||
{
|
||||
Standard_Integer iSense=0;
|
||||
gp_Dir aDNF1, aDNF2;
|
||||
@@ -1235,7 +1207,8 @@ Standard_Integer BOPTools_AlgoTools::Sense (const TopoDS_Face& theF1,
|
||||
Standard_Boolean BOPTools_AlgoTools::IsSplitToReverse
|
||||
(const TopoDS_Shape& theSp,
|
||||
const TopoDS_Shape& theSr,
|
||||
Handle(IntTools_Context)& theContext)
|
||||
const Handle(IntTools_Context)& theContext,
|
||||
Standard_Integer *theError)
|
||||
{
|
||||
Standard_Boolean bRet;
|
||||
TopAbs_ShapeEnum aType;
|
||||
@@ -1247,22 +1220,49 @@ Standard_Boolean BOPTools_AlgoTools::IsSplitToReverse
|
||||
case TopAbs_EDGE: {
|
||||
const TopoDS_Edge& aESp=(*(TopoDS_Edge*)(&theSp));
|
||||
const TopoDS_Edge& aESr=(*(TopoDS_Edge*)(&theSr));
|
||||
bRet=BOPTools_AlgoTools::IsSplitToReverse(aESp, aESr, theContext);
|
||||
bRet=BOPTools_AlgoTools::IsSplitToReverse(aESp, aESr, theContext, theError);
|
||||
}
|
||||
break;
|
||||
//
|
||||
case TopAbs_FACE: {
|
||||
const TopoDS_Face& aFSp=(*(TopoDS_Face*)(&theSp));
|
||||
const TopoDS_Face& aFSr=(*(TopoDS_Face*)(&theSr));
|
||||
bRet=BOPTools_AlgoTools::IsSplitToReverse(aFSp, aFSr, theContext);
|
||||
bRet=BOPTools_AlgoTools::IsSplitToReverse(aFSp, aFSr, theContext, theError);
|
||||
}
|
||||
break;
|
||||
//
|
||||
default:
|
||||
if (theError)
|
||||
*theError = 100;
|
||||
break;
|
||||
}
|
||||
return bRet;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsSplitToReverseWithWarn
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean BOPTools_AlgoTools::IsSplitToReverseWithWarn(const TopoDS_Shape& theSplit,
|
||||
const TopoDS_Shape& theShape,
|
||||
const Handle(IntTools_Context)& theContext,
|
||||
const Handle(Message_Report)& theReport)
|
||||
{
|
||||
Standard_Integer anErr;
|
||||
Standard_Boolean isToReverse = BOPTools_AlgoTools::IsSplitToReverse(theSplit, theShape, theContext, &anErr);
|
||||
if (anErr != 0 && !theReport.IsNull())
|
||||
{
|
||||
// The error occurred during the check.
|
||||
// Add warning to the report, storing the shapes into the warning.
|
||||
TopoDS_Compound aWC;
|
||||
BRep_Builder().MakeCompound(aWC);
|
||||
BRep_Builder().Add(aWC, theSplit);
|
||||
BRep_Builder().Add(aWC, theShape);
|
||||
theReport->AddAlert(Message_Warning, new BOPAlgo_AlertUnableToOrientTheShape(aWC));
|
||||
}
|
||||
return isToReverse;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function :IsSplitToReverse
|
||||
//purpose :
|
||||
@@ -1270,8 +1270,13 @@ Standard_Boolean BOPTools_AlgoTools::IsSplitToReverse
|
||||
Standard_Boolean BOPTools_AlgoTools::IsSplitToReverse
|
||||
(const TopoDS_Face& theFSp,
|
||||
const TopoDS_Face& theFSr,
|
||||
Handle(IntTools_Context)& theContext)
|
||||
const Handle(IntTools_Context)& theContext,
|
||||
Standard_Integer *theError)
|
||||
{
|
||||
// Set OK error status
|
||||
if (theError)
|
||||
*theError = 0;
|
||||
|
||||
// Compare surfaces
|
||||
Handle(Geom_Surface) aSFSp = BRep_Tool::Surface(theFSp);
|
||||
Handle(Geom_Surface) aSFOr = BRep_Tool::Surface(theFSr);
|
||||
@@ -1305,6 +1310,8 @@ Standard_Boolean BOPTools_AlgoTools::IsSplitToReverse
|
||||
}
|
||||
//
|
||||
if (!anExp.More()) {
|
||||
if (theError)
|
||||
*theError = 1;
|
||||
// The point has not been found.
|
||||
return bDone;
|
||||
}
|
||||
@@ -1315,6 +1322,8 @@ Standard_Boolean BOPTools_AlgoTools::IsSplitToReverse
|
||||
bDone = BOPTools_AlgoTools3D::GetNormalToSurface
|
||||
(aSFSp, aP2DFSp.X(), aP2DFSp.Y(), aDNFSp);
|
||||
if (!bDone) {
|
||||
if (theError)
|
||||
*theError = 2;
|
||||
return bDone;
|
||||
}
|
||||
//
|
||||
@@ -1328,6 +1337,8 @@ Standard_Boolean BOPTools_AlgoTools::IsSplitToReverse
|
||||
aProjector.Perform(aPFSp);
|
||||
bDone = (aProjector.NbPoints() > 0);
|
||||
if (!bDone) {
|
||||
if (theError)
|
||||
*theError = 3;
|
||||
return bDone;
|
||||
}
|
||||
// UV coordinates of the point on the original face
|
||||
@@ -1338,6 +1349,8 @@ Standard_Boolean BOPTools_AlgoTools::IsSplitToReverse
|
||||
gp_Dir aDNFOr;
|
||||
bDone = BOPTools_AlgoTools3D::GetNormalToSurface(aSFOr, aU, aV, aDNFOr);
|
||||
if (!bDone) {
|
||||
if (theError)
|
||||
*theError = 4;
|
||||
return bDone;
|
||||
}
|
||||
//
|
||||
@@ -1354,51 +1367,88 @@ Standard_Boolean BOPTools_AlgoTools::IsSplitToReverse
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean BOPTools_AlgoTools::IsSplitToReverse
|
||||
(const TopoDS_Edge& aEF1,
|
||||
const TopoDS_Edge& aEF2,
|
||||
Handle(IntTools_Context)& theContext)
|
||||
(const TopoDS_Edge& theESp,
|
||||
const TopoDS_Edge& theEOr,
|
||||
const Handle(IntTools_Context)& theContext,
|
||||
Standard_Integer *theError)
|
||||
{
|
||||
Standard_Boolean bRet, bIsDegenerated;
|
||||
//
|
||||
bRet=Standard_False;
|
||||
bIsDegenerated=(BRep_Tool::Degenerated(aEF1) ||
|
||||
BRep_Tool::Degenerated(aEF2));
|
||||
if (bIsDegenerated) {
|
||||
return bRet;
|
||||
// The idea is to compare the tangent vectors of two edges computed in
|
||||
// the same point. Thus, we need to take the point on split edge (since it is
|
||||
// shorter) and project it onto original edge to find corresponding parameter.
|
||||
|
||||
if (BRep_Tool::Degenerated(theESp) ||
|
||||
BRep_Tool::Degenerated(theEOr))
|
||||
{
|
||||
if (theError)
|
||||
*theError = 1;
|
||||
return Standard_False;
|
||||
}
|
||||
//
|
||||
Standard_Real a, b;
|
||||
TopAbs_Orientation aOrE, aOrSp;
|
||||
Handle(Geom_Curve)aC1, aC2;
|
||||
//
|
||||
aC2=BRep_Tool::Curve(aEF2, a, b);
|
||||
aC1=BRep_Tool::Curve(aEF1, a, b);
|
||||
//
|
||||
if (aC1==aC2) {
|
||||
aOrE=aEF2.Orientation();
|
||||
aOrSp=aEF1.Orientation();
|
||||
bRet=(aOrE!=aOrSp);
|
||||
return bRet;
|
||||
|
||||
// Set OK error status
|
||||
if (theError)
|
||||
*theError = 0;
|
||||
|
||||
// Get the curves from the edges
|
||||
Standard_Real f, l;
|
||||
Handle(Geom_Curve) aCSp = BRep_Tool::Curve(theESp, f, l);
|
||||
Handle(Geom_Curve) aCOr = BRep_Tool::Curve(theEOr, f, l);
|
||||
|
||||
// If the curves are the same, compare orientations only
|
||||
if (aCSp == aCOr)
|
||||
return theESp.Orientation() != theEOr.Orientation();
|
||||
|
||||
// Find valid range of the split edge, to ensure that the point for computing
|
||||
// tangent vectors will be inside both edges.
|
||||
if (!BRepLib::FindValidRange(theESp, f, l))
|
||||
BRep_Tool::Range(theESp, f, l);
|
||||
|
||||
// Error code
|
||||
Standard_Integer anErr = 0;
|
||||
// Try a few sample points on the split edge until first valid found
|
||||
const Standard_Integer aNbP = 11;
|
||||
const Standard_Real aDT = (l - f) / aNbP;
|
||||
for (Standard_Integer i = 1; i < aNbP; ++i)
|
||||
{
|
||||
const Standard_Real aTm = f + i*aDT;
|
||||
// Compute tangent vector on split edge
|
||||
gp_Vec aVSpTgt;
|
||||
if (!BOPTools_AlgoTools2D::EdgeTangent(theESp, aTm, aVSpTgt))
|
||||
{
|
||||
// Unable to compute the tangent vector on the split edge
|
||||
// in this point -> take the next point
|
||||
anErr = 2;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Find corresponding parameter on the original edge
|
||||
Standard_Real aTmOr;
|
||||
if (!theContext->ProjectPointOnEdge(aCSp->Value(aTm), theEOr, aTmOr))
|
||||
{
|
||||
// Unable to project the point inside the split edge
|
||||
// onto the original edge -> take the next point
|
||||
anErr = 3;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Compute tangent vector on original edge
|
||||
gp_Vec aVOrTgt;
|
||||
if (!BOPTools_AlgoTools2D::EdgeTangent(theEOr, aTmOr, aVOrTgt))
|
||||
{
|
||||
// Unable to compute the tangent vector on the original edge
|
||||
// in this point -> take the next point
|
||||
anErr = 4;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Compute the Dot product
|
||||
Standard_Real aCos = aVSpTgt.Dot(aVOrTgt);
|
||||
return (aCos < 0.);
|
||||
}
|
||||
//
|
||||
Standard_Real aT1, aT2, aScPr;
|
||||
gp_Vec aV1, aV2;
|
||||
gp_Pnt aP;
|
||||
//
|
||||
aT1=BOPTools_AlgoTools2D::IntermediatePoint(a, b);
|
||||
aC1->D0(aT1, aP);
|
||||
BOPTools_AlgoTools2D::EdgeTangent(aEF1, aT1, aV1);
|
||||
gp_Dir aDT1(aV1);
|
||||
//
|
||||
theContext->ProjectPointOnEdge(aP, aEF2, aT2);
|
||||
//
|
||||
BOPTools_AlgoTools2D::EdgeTangent(aEF2, aT2, aV2);
|
||||
gp_Dir aDT2(aV2);
|
||||
//
|
||||
aScPr=aDT1*aDT2;
|
||||
bRet=(aScPr<0.);
|
||||
//
|
||||
return bRet;
|
||||
|
||||
if (theError)
|
||||
*theError = anErr;
|
||||
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -1715,7 +1765,7 @@ Standard_Boolean BOPTools_AlgoTools::GetEdgeOnFace
|
||||
Standard_Boolean FindFacePairs (const TopoDS_Edge& theE,
|
||||
const TopTools_ListOfShape& thLF,
|
||||
BOPTools_ListOfCoupleOfShape& theLCFF,
|
||||
Handle(IntTools_Context)& theContext)
|
||||
const Handle(IntTools_Context)& theContext)
|
||||
{
|
||||
Standard_Boolean bFound;
|
||||
Standard_Integer i, aNbCEF;
|
||||
@@ -1841,7 +1891,7 @@ Standard_Boolean BOPTools_AlgoTools::IsBlockInOnFace
|
||||
(const IntTools_Range& aShrR,
|
||||
const TopoDS_Face& aF,
|
||||
const TopoDS_Edge& aE1,
|
||||
Handle(IntTools_Context)& aContext)
|
||||
const Handle(IntTools_Context)& aContext)
|
||||
{
|
||||
Standard_Boolean bFlag;
|
||||
Standard_Real f1, l1, ULD, VLD;
|
||||
@@ -1978,7 +2028,7 @@ Standard_Boolean GetFaceDir(const TopoDS_Edge& aE,
|
||||
const Standard_Boolean theSmallFaces,
|
||||
gp_Dir& aDN,
|
||||
gp_Dir& aDB,
|
||||
Handle(IntTools_Context)& theContext,
|
||||
const Handle(IntTools_Context)& theContext,
|
||||
GeomAPI_ProjectPointOnSurf& aProjPL,
|
||||
const Standard_Real aDt)
|
||||
{
|
||||
@@ -2022,7 +2072,7 @@ Standard_Boolean FindPointInFace(const TopoDS_Face& aF,
|
||||
const gp_Pnt& aP,
|
||||
gp_Dir& aDB,
|
||||
gp_Pnt& aPOut,
|
||||
Handle(IntTools_Context)& theContext,
|
||||
const Handle(IntTools_Context)& theContext,
|
||||
GeomAPI_ProjectPointOnSurf& aProjPL,
|
||||
const Standard_Real aDt,
|
||||
const Standard_Real aTolE)
|
||||
@@ -2092,7 +2142,7 @@ Standard_Real MinStep3D(const TopoDS_Edge& theE1,
|
||||
const TopoDS_Face& theF1,
|
||||
const BOPTools_ListOfCoupleOfShape& theLCS,
|
||||
const gp_Pnt& aP,
|
||||
Handle(IntTools_Context)& theContext,
|
||||
const Handle(IntTools_Context)& theContext,
|
||||
Standard_Boolean& theSmallFaces)
|
||||
{
|
||||
Standard_Real aDt, aTolE, aTolF, aDtMax, aDtMin;
|
||||
|
@@ -45,25 +45,235 @@ class IntTools_Context;
|
||||
class TopoDS_Solid;
|
||||
class IntTools_Range;
|
||||
class TopoDS_Shell;
|
||||
class Message_Report;
|
||||
|
||||
|
||||
class BOPTools_AlgoTools
|
||||
//! Provides tools used in Boolean Operations algorithm:
|
||||
//! - Vertices intersection;
|
||||
//! - Vertex construction;
|
||||
//! - Edge construction;
|
||||
//! - Classification algorithms;
|
||||
//! - Making connexity blocks;
|
||||
//! - Shape validation.
|
||||
class BOPTools_AlgoTools
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
public: //! @name Intersection of the vertices
|
||||
|
||||
//! Intersects the vertex <theV1> with the point <theP> with tolerance <theTolP>.
|
||||
//! Returns the error status:
|
||||
//! - 0 - no error, meaning that the vertex intersects the point;
|
||||
//! - 1 - the distance between vertex and point is grater than the sum of tolerances.
|
||||
Standard_EXPORT static Standard_Integer ComputeVV(const TopoDS_Vertex& theV,
|
||||
const gp_Pnt& theP,
|
||||
const Standard_Real theTolP);
|
||||
|
||||
//! Intersects the given vertices with given fuzzy value.
|
||||
//! Returns the error status:
|
||||
//! - 0 - no error, meaning that the vertices interferes with given tolerance;
|
||||
//! - 1 - the distance between vertices is grater than the sum of their tolerances.
|
||||
Standard_EXPORT static Standard_Integer ComputeVV(const TopoDS_Vertex& theV1,
|
||||
const TopoDS_Vertex& theV2,
|
||||
const Standard_Real theFuzz = Precision::Confusion());
|
||||
|
||||
public: //! @name Vertices construction
|
||||
|
||||
//! Makes the vertex in the middle of given vertices with
|
||||
//! the tolerance covering all tolerance spheres of vertices.
|
||||
Standard_EXPORT static void MakeVertex(const TopTools_ListOfShape& theLV,
|
||||
TopoDS_Vertex& theV);
|
||||
|
||||
//! Make a vertex using 3D-point <aP1> and 3D-tolerance value <aTol>
|
||||
Standard_EXPORT static void MakeNewVertex(const gp_Pnt& aP1,
|
||||
const Standard_Real aTol,
|
||||
TopoDS_Vertex& aNewVertex);
|
||||
|
||||
//! Make a vertex using couple of vertices <aV1, aV2>
|
||||
Standard_EXPORT static void MakeNewVertex(const TopoDS_Vertex& aV1,
|
||||
const TopoDS_Vertex& aV2,
|
||||
TopoDS_Vertex& aNewVertex);
|
||||
|
||||
//! Make a vertex in place of intersection between two edges
|
||||
//! <aE1, aE2> with parameters <aP1, aP2>
|
||||
Standard_EXPORT static void MakeNewVertex(const TopoDS_Edge& aE1,
|
||||
const Standard_Real aP1,
|
||||
const TopoDS_Edge& aE2,
|
||||
const Standard_Real aP2,
|
||||
TopoDS_Vertex& aNewVertex);
|
||||
|
||||
//! Make a vertex in place of intersection between the edge <aE1>
|
||||
//! with parameter <aP1> and the face <aF2>
|
||||
Standard_EXPORT static void MakeNewVertex(const TopoDS_Edge& aE1,
|
||||
const Standard_Real aP1,
|
||||
const TopoDS_Face& aF2,
|
||||
TopoDS_Vertex& aNewVertex);
|
||||
|
||||
|
||||
public: //! @name Updating the vertex
|
||||
|
||||
//! Update the tolerance value for vertex <aV>
|
||||
//! taking into account the fact that <aV> lays on
|
||||
//! the curve <aIC>
|
||||
Standard_EXPORT static void UpdateVertex(const IntTools_Curve& aIC,
|
||||
const Standard_Real aT,
|
||||
const TopoDS_Vertex& aV);
|
||||
|
||||
//! Update the tolerance value for vertex <aV>
|
||||
//! taking into account the fact that <aV> lays on
|
||||
//! the edge <aE>
|
||||
Standard_EXPORT static void UpdateVertex(const TopoDS_Edge& aE,
|
||||
const Standard_Real aT,
|
||||
const TopoDS_Vertex& aV);
|
||||
|
||||
//! Update the tolerance value for vertex <aVN>
|
||||
//! taking into account the fact that <aVN> should
|
||||
//! cover tolerance zone of <aVF>
|
||||
Standard_EXPORT static void UpdateVertex(const TopoDS_Vertex& aVF,
|
||||
const TopoDS_Vertex& aVN);
|
||||
|
||||
|
||||
public: //! @name Edge construction
|
||||
|
||||
//! Makes the edge based on the given curve with given bounding vertices.
|
||||
Standard_EXPORT static void MakeEdge(const IntTools_Curve& theCurve,
|
||||
const TopoDS_Vertex& theV1,
|
||||
const Standard_Real theT1,
|
||||
const TopoDS_Vertex& theV2,
|
||||
const Standard_Real theT2,
|
||||
const Standard_Real theTolR3D,
|
||||
TopoDS_Edge& theE);
|
||||
|
||||
//! Makes a copy of <theEdge> with vertices.
|
||||
Standard_EXPORT static TopoDS_Edge CopyEdge(const TopoDS_Edge& theEdge);
|
||||
|
||||
//! Make the edge from base edge <aE1> and two vertices <aV1,aV2>
|
||||
//! at parameters <aP1,aP2>
|
||||
Standard_EXPORT static void MakeSplitEdge(const TopoDS_Edge& aE1,
|
||||
const TopoDS_Vertex& aV1,
|
||||
const Standard_Real aP1,
|
||||
const TopoDS_Vertex& aV2,
|
||||
const Standard_Real aP2,
|
||||
TopoDS_Edge& aNewEdge);
|
||||
|
||||
//! Make the edge from 3D-Curve <aIC> and two vertices <aV1,aV2>
|
||||
//! at parameters <aP1,aP2>
|
||||
Standard_EXPORT static void MakeSectEdge(const IntTools_Curve& aIC,
|
||||
const TopoDS_Vertex& aV1,
|
||||
const Standard_Real aP1,
|
||||
const TopoDS_Vertex& aV2,
|
||||
const Standard_Real aP2,
|
||||
TopoDS_Edge& aNewEdge);
|
||||
|
||||
|
||||
public: //! @name Point/Edge/Face classification relatively solid
|
||||
|
||||
//! Computes the 3-D state of the point thePoint
|
||||
//! toward solid theSolid.
|
||||
//! theTol - value of precision of computation
|
||||
//! theContext- cahed geometrical tools
|
||||
//! Returns 3-D state.
|
||||
Standard_EXPORT static TopAbs_State ComputeState(const gp_Pnt& thePoint,
|
||||
const TopoDS_Solid& theSolid,
|
||||
const Standard_Real theTol,
|
||||
const Handle(IntTools_Context)& theContext);
|
||||
|
||||
Standard_EXPORT static Standard_Integer ComputeVV (const TopoDS_Vertex& aV1, const gp_Pnt& aP2, const Standard_Real aTolP2);
|
||||
//! Computes the 3-D state of the vertex theVertex
|
||||
//! toward solid theSolid.
|
||||
//! theTol - value of precision of computation
|
||||
//! theContext- cahed geometrical tools
|
||||
//! Returns 3-D state.
|
||||
Standard_EXPORT static TopAbs_State ComputeState(const TopoDS_Vertex& theVertex,
|
||||
const TopoDS_Solid& theSolid,
|
||||
const Standard_Real theTol,
|
||||
const Handle(IntTools_Context)& theContext);
|
||||
|
||||
Standard_EXPORT static Standard_Integer ComputeVV (const TopoDS_Vertex& aV1,
|
||||
const TopoDS_Vertex& aV2,
|
||||
const Standard_Real theFuzz = Precision::Confusion());
|
||||
//! Computes the 3-D state of the edge theEdge
|
||||
//! toward solid theSolid.
|
||||
//! theTol - value of precision of computation
|
||||
//! theContext- cahed geometrical tools
|
||||
//! Returns 3-D state.
|
||||
Standard_EXPORT static TopAbs_State ComputeState(const TopoDS_Edge& theEdge,
|
||||
const TopoDS_Solid& theSolid,
|
||||
const Standard_Real theTol,
|
||||
const Handle(IntTools_Context)& theContext);
|
||||
|
||||
Standard_EXPORT static void MakeVertex (const TopTools_ListOfShape& aLV, TopoDS_Vertex& aV);
|
||||
|
||||
Standard_EXPORT static void MakeEdge (const IntTools_Curve& theCurve, const TopoDS_Vertex& theV1, const Standard_Real theT1, const TopoDS_Vertex& theV2, const Standard_Real theT2, const Standard_Real theTolR3D, TopoDS_Edge& theE);
|
||||
//! Computes the 3-D state of the face theFace
|
||||
//! toward solid theSolid.
|
||||
//! theTol - value of precision of computation
|
||||
//! theBounds - set of edges of theFace to avoid
|
||||
//! theContext- cahed geometrical tools
|
||||
//! Returns 3-D state.
|
||||
Standard_EXPORT static TopAbs_State ComputeState(const TopoDS_Face& theFace,
|
||||
const TopoDS_Solid& theSolid,
|
||||
const Standard_Real theTol,
|
||||
TopTools_IndexedMapOfShape& theBounds,
|
||||
const Handle(IntTools_Context)& theContext);
|
||||
|
||||
//! Computes the 3-D state of the shape theShape
|
||||
//! toward solid theSolid.
|
||||
//! theTol - value of precision of computation
|
||||
//! theContext- cahed geometrical tools
|
||||
//! Returns 3-D state.
|
||||
Standard_EXPORT static TopAbs_State ComputeStateByOnePoint(const TopoDS_Shape& theShape,
|
||||
const TopoDS_Solid& theSolid,
|
||||
const Standard_Real theTol,
|
||||
const Handle(IntTools_Context)& theContext);
|
||||
|
||||
|
||||
public: //! @name Face classification relatively solid
|
||||
|
||||
//! For the face theFace and its edge theEdge
|
||||
//! finds the face suitable to produce shell.
|
||||
//! theLCEF - set of faces to search. All faces
|
||||
//! from theLCEF must share edge theEdge
|
||||
Standard_EXPORT static Standard_Boolean GetFaceOff(const TopoDS_Edge& theEdge,
|
||||
const TopoDS_Face& theFace,
|
||||
BOPTools_ListOfCoupleOfShape& theLCEF,
|
||||
TopoDS_Face& theFaceOff,
|
||||
const Handle(IntTools_Context)& theContext);
|
||||
|
||||
//! Returns True if the face theFace is inside of the
|
||||
//! couple of faces theFace1, theFace2.
|
||||
//! The faces theFace, theFace1, theFace2 must
|
||||
//! share the edge theEdge
|
||||
//! Return values:
|
||||
//! * 0 state is not IN
|
||||
//! * 1 state is IN
|
||||
//! * 2 state can not be found by the method of angles
|
||||
Standard_EXPORT static Standard_Integer IsInternalFace(const TopoDS_Face& theFace,
|
||||
const TopoDS_Edge& theEdge,
|
||||
const TopoDS_Face& theFace1,
|
||||
const TopoDS_Face& theFace2,
|
||||
const Handle(IntTools_Context)& theContext);
|
||||
|
||||
//! Returns True if the face theFace is inside of the
|
||||
//! appropriate couple of faces (from the set theLF) .
|
||||
//! The faces of the set theLF and theFace must
|
||||
//! share the edge theEdge
|
||||
//! * 0 state is not IN
|
||||
//! * 1 state is IN
|
||||
//! * 2 state can not be found by the method of angles
|
||||
Standard_EXPORT static Standard_Integer IsInternalFace(const TopoDS_Face& theFace,
|
||||
const TopoDS_Edge& theEdge,
|
||||
TopTools_ListOfShape& theLF,
|
||||
const Handle(IntTools_Context)& theContext);
|
||||
|
||||
//! Returns True if the face theFace is inside the
|
||||
//! solid theSolid.
|
||||
//! theMEF - Map Edge/Faces for theSolid
|
||||
//! theTol - value of precision of computation
|
||||
//! theContext- cahed geometrical tools
|
||||
Standard_EXPORT static Standard_Boolean IsInternalFace(const TopoDS_Face& theFace,
|
||||
const TopoDS_Solid& theSolid,
|
||||
TopTools_IndexedDataMapOfShapeListOfShape& theMEF,
|
||||
const Standard_Real theTol,
|
||||
const Handle(IntTools_Context)& theContext);
|
||||
|
||||
|
||||
public: //! @name PCurve construction
|
||||
|
||||
//! Makes 2d curve of the edge <theE> on the faces <theF1> and <theF2>.<br>
|
||||
//! <theContext> - storage for caching the geometrical tools
|
||||
Standard_EXPORT static void MakePCurve (const TopoDS_Edge& theE,
|
||||
@@ -73,123 +283,121 @@ public:
|
||||
const Standard_Boolean thePC1,
|
||||
const Standard_Boolean thePC2,
|
||||
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
|
||||
|
||||
Standard_EXPORT static void MakeContainer (const TopAbs_ShapeEnum theType, TopoDS_Shape& theShape);
|
||||
|
||||
Standard_EXPORT static Standard_Boolean IsHole (const TopoDS_Shape& aW, const TopoDS_Shape& aF);
|
||||
|
||||
//! Returns True if the shape theSplit has opposite
|
||||
//! direction than theShape
|
||||
//! theContext - cashed geometrical tools
|
||||
Standard_EXPORT static Standard_Boolean IsSplitToReverse (const TopoDS_Shape& theSplit, const TopoDS_Shape& theShape, Handle(IntTools_Context)& theContext);
|
||||
|
||||
//! Returns True if normal direction of the face
|
||||
//! theShape is not the same as for the face
|
||||
//! theSplit
|
||||
//! theContext - cashed geometrical tools
|
||||
Standard_EXPORT static Standard_Boolean IsSplitToReverse (const TopoDS_Face& theSplit, const TopoDS_Face& theShape, Handle(IntTools_Context)& theContext);
|
||||
|
||||
Standard_EXPORT static Standard_Boolean IsSplitToReverse (const TopoDS_Edge& aE1, const TopoDS_Edge& aE2, Handle(IntTools_Context)& aContext);
|
||||
|
||||
Standard_EXPORT static Standard_Boolean AreFacesSameDomain (const TopoDS_Face& theF1,
|
||||
const TopoDS_Face& theF2,
|
||||
Handle(IntTools_Context)& theContext,
|
||||
const Standard_Real theFuzz = Precision::Confusion());
|
||||
|
||||
Standard_EXPORT static Standard_Boolean CheckSameGeom (const TopoDS_Face& theF1, const TopoDS_Face& theF2, Handle(IntTools_Context)& theContext);
|
||||
|
||||
//! Basing on the normals directions of the faces the method
|
||||
//! Defines whether to reverse the second face or not.<br>
|
||||
//! <theContext> - storage for caching the geometrical tools
|
||||
Standard_EXPORT static Standard_Integer Sense (const TopoDS_Face& theF1,
|
||||
const TopoDS_Face& theF2,
|
||||
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
|
||||
|
||||
//! Returns True if the face theFace contains
|
||||
//! the edge theEdge but with opposite orientation.
|
||||
//! If the method returns True theEdgeOff is the
|
||||
//! edge founded
|
||||
Standard_EXPORT static Standard_Boolean GetEdgeOff (const TopoDS_Edge& theEdge, const TopoDS_Face& theFace, TopoDS_Edge& theEdgeOff);
|
||||
|
||||
//! For the face theFace and its edge theEdge
|
||||
//! finds the face suitable to produce shell.
|
||||
//! theLCEF - set of faces to search. All faces
|
||||
//! from theLCEF must share edge theEdge
|
||||
Standard_EXPORT static Standard_Boolean GetFaceOff (const TopoDS_Edge& theEdge, const TopoDS_Face& theFace, BOPTools_ListOfCoupleOfShape& theLCEF, TopoDS_Face& theFaceOff, Handle(IntTools_Context)& theContext);
|
||||
|
||||
//! Returns True if the face theFace is inside of the
|
||||
//! couple of faces theFace1, theFace2.
|
||||
//! The faces theFace, theFace1, theFace2 must
|
||||
//! share the edge theEdge
|
||||
//! Return values:
|
||||
//! * 0 state is not IN
|
||||
//! * 1 state is IN
|
||||
//! * 2 state can not be found by the method of angles
|
||||
Standard_EXPORT static Standard_Integer IsInternalFace (const TopoDS_Face& theFace, const TopoDS_Edge& theEdge, const TopoDS_Face& theFace1, const TopoDS_Face& theFace2, Handle(IntTools_Context)& theContext);
|
||||
|
||||
//! Returns True if the face theFace is inside of the
|
||||
//! appropriate couple of faces (from the set theLF) .
|
||||
//! The faces of the set theLF and theFace must
|
||||
//! share the edge theEdge
|
||||
//! * 0 state is not IN
|
||||
//! * 1 state is IN
|
||||
//! * 2 state can not be found by the method of angles
|
||||
Standard_EXPORT static Standard_Integer IsInternalFace (const TopoDS_Face& theFace, const TopoDS_Edge& theEdge, TopTools_ListOfShape& theLF, Handle(IntTools_Context)& theContext);
|
||||
|
||||
//! Returns True if the face theFace is inside the
|
||||
//! solid theSolid.
|
||||
//! theMEF - Map Edge/Faces for theSolid
|
||||
//! theTol - value of precision of computation
|
||||
//! theContext- cahed geometrical tools
|
||||
Standard_EXPORT static Standard_Boolean IsInternalFace (const TopoDS_Face& theFace, const TopoDS_Solid& theSolid, TopTools_IndexedDataMapOfShapeListOfShape& theMEF, const Standard_Real theTol, Handle(IntTools_Context)& theContext);
|
||||
|
||||
//! For the face theFace gets the edge theEdgeOnF
|
||||
//! that is the same as theEdge
|
||||
//! Returns True if such edge exists
|
||||
//! Returns False if there is no such edge
|
||||
Standard_EXPORT static Standard_Boolean GetEdgeOnFace (const TopoDS_Edge& theEdge, const TopoDS_Face& theFace, TopoDS_Edge& theEdgeOnF);
|
||||
|
||||
//! Computes the 3-D state of the point thePoint
|
||||
//! toward solid theSolid.
|
||||
//! theTol - value of precision of computation
|
||||
//! theContext- cahed geometrical tools
|
||||
//! Returns 3-D state.
|
||||
Standard_EXPORT static TopAbs_State ComputeState (const gp_Pnt& thePoint, const TopoDS_Solid& theSolid, const Standard_Real theTol, Handle(IntTools_Context)& theContext);
|
||||
|
||||
//! Computes the 3-D state of the vertex theVertex
|
||||
//! toward solid theSolid.
|
||||
//! theTol - value of precision of computation
|
||||
//! theContext- cahed geometrical tools
|
||||
//! Returns 3-D state.
|
||||
Standard_EXPORT static TopAbs_State ComputeState (const TopoDS_Vertex& theVertex, const TopoDS_Solid& theSolid, const Standard_Real theTol, Handle(IntTools_Context)& theContext);
|
||||
|
||||
//! Computes the 3-D state of the edge theEdge
|
||||
//! toward solid theSolid.
|
||||
//! theTol - value of precision of computation
|
||||
//! theContext- cahed geometrical tools
|
||||
//! Returns 3-D state.
|
||||
Standard_EXPORT static TopAbs_State ComputeState (const TopoDS_Edge& theEdge, const TopoDS_Solid& theSolid, const Standard_Real theTol, Handle(IntTools_Context)& theContext);
|
||||
|
||||
//! Computes the 3-D state of the face theFace
|
||||
//! toward solid theSolid.
|
||||
//! theTol - value of precision of computation
|
||||
//! theBounds - set of edges of theFace to avoid
|
||||
//! theContext- cahed geometrical tools
|
||||
//! Returns 3-D state.
|
||||
Standard_EXPORT static TopAbs_State ComputeState (const TopoDS_Face& theFace, const TopoDS_Solid& theSolid, const Standard_Real theTol, TopTools_IndexedMapOfShape& theBounds, Handle(IntTools_Context)& theContext);
|
||||
|
||||
//! Computes the 3-D state of the shape theShape
|
||||
//! toward solid theSolid.
|
||||
//! theTol - value of precision of computation
|
||||
//! theContext- cahed geometrical tools
|
||||
//! Returns 3-D state.
|
||||
Standard_EXPORT static TopAbs_State ComputeStateByOnePoint (const TopoDS_Shape& theShape, const TopoDS_Solid& theSolid, const Standard_Real theTol, Handle(IntTools_Context)& theContext);
|
||||
|
||||
|
||||
|
||||
public: //! @name Wire classification relatively face
|
||||
|
||||
//! Checks if the wire is a hole for the face.
|
||||
Standard_EXPORT static Standard_Boolean IsHole(const TopoDS_Shape& theW,
|
||||
const TopoDS_Shape& theF);
|
||||
|
||||
|
||||
public: //! @name Choosing correct orientation for the split shape
|
||||
|
||||
//! Checks if the direction of the split shape is opposite to
|
||||
//! the direction of the original shape.
|
||||
//! The method is an overload for (Edge,Edge) and (Face,Face) corresponding
|
||||
//! methods and checks only these types of shapes.
|
||||
//! For faces the method checks if normal directions are opposite.
|
||||
//! For edges the method checks if tangent vectors are opposite.
|
||||
//!
|
||||
//! In case the directions do not coincide, it returns TRUE, meaning
|
||||
//! that split shape has to be reversed to match the direction of the
|
||||
//! original shape.
|
||||
//!
|
||||
//! If requested (<theError> is not null), the method returns the status of the operation:
|
||||
//! - 0 - no error;
|
||||
//! - Error from (Edge,Edge) or (Face,Face) corresponding method
|
||||
//! - 100 - bad types.
|
||||
//! In case of any error the method always returns FALSE.
|
||||
//!
|
||||
//! @param theSplit [in] Split shape
|
||||
//! @param theShape [in] Original shape
|
||||
//! @param theContext [in] Cashed geometrical tools
|
||||
//! @param theError [out] Error Status of the operation
|
||||
Standard_EXPORT static Standard_Boolean IsSplitToReverse(const TopoDS_Shape& theSplit,
|
||||
const TopoDS_Shape& theShape,
|
||||
const Handle(IntTools_Context)& theContext,
|
||||
Standard_Integer *theError = NULL);
|
||||
|
||||
//! Add-on for the *IsSplitToReverse()* to check for its errors
|
||||
//! and in case of any add the *BOPAlgo_AlertUnableToOrientTheShape*
|
||||
//! warning to the report.
|
||||
Standard_EXPORT static Standard_Boolean IsSplitToReverseWithWarn(const TopoDS_Shape& theSplit,
|
||||
const TopoDS_Shape& theShape,
|
||||
const Handle(IntTools_Context)& theContext,
|
||||
const Handle(Message_Report)& theReport = NULL);
|
||||
|
||||
//! Checks if the normal direction of the split face is opposite to
|
||||
//! the normal direction of the original face.
|
||||
//! The normal directions for both faces are taken in the same point -
|
||||
//! point inside the split face is projected onto the original face.
|
||||
//! Returns TRUE if the normals do not coincide, meaning the necessity
|
||||
//! to revert the orientation of the split face to match the direction
|
||||
//! of the original face.
|
||||
//!
|
||||
//! If requested (<theError> is not null), the method returns the status of the operation:
|
||||
//! - 0 - no error;
|
||||
//! - 1 - unable to find the point inside split face;
|
||||
//! - 2 - unable to compute the normal for the split face;
|
||||
//! - 3 - unable to project the point inside the split face on the original face;
|
||||
//! - 4 - unable to compute the normal for the original face.
|
||||
//! In case of any error the method always returns FALSE.
|
||||
//!
|
||||
//! @param theSplit [in] Split face
|
||||
//! @param theShape [in] Original face
|
||||
//! @param theContext [in] Cashed geometrical tools
|
||||
//! @param theError [out] Error Status of the operation
|
||||
Standard_EXPORT static Standard_Boolean IsSplitToReverse(const TopoDS_Face& theSplit,
|
||||
const TopoDS_Face& theShape,
|
||||
const Handle(IntTools_Context)& theContext,
|
||||
Standard_Integer *theError = NULL);
|
||||
|
||||
//! Checks if the tangent vector of the split edge is opposite to
|
||||
//! the tangent vector of the original edge.
|
||||
//! The tangent vectors for both edges are computed in the same point -
|
||||
//! point inside the split edge is projected onto the original edge.
|
||||
//! Returns TRUE if the tangent vectors do not coincide, meaning the necessity
|
||||
//! to revert the orientation of the split edge to match the direction
|
||||
//! of the original edge.
|
||||
//!
|
||||
//! If requested (<theError> is not null), the method returns the status of the operation:
|
||||
//! - 0 - no error;
|
||||
//! - 1 - degenerated edges are given;
|
||||
//! - 2 - unable to compute the tangent vector for the split edge;
|
||||
//! - 3 - unable to project the point inside the split edge on the original edge;
|
||||
//! - 4 - unable to compute the tangent vector for the original edge;
|
||||
//! In case of any error the method always returns FALSE.
|
||||
//!
|
||||
//! @param theSplit [in] Split edge
|
||||
//! @param theShape [in] Original edge
|
||||
//! @param theContext [in] Cashed geometrical tools
|
||||
//! @param theError [out] Error Status of the operation
|
||||
Standard_EXPORT static Standard_Boolean IsSplitToReverse(const TopoDS_Edge& theSplit,
|
||||
const TopoDS_Edge& theShape,
|
||||
const Handle(IntTools_Context)& theContext,
|
||||
Standard_Integer *theError = NULL);
|
||||
|
||||
//! Checks if the normals direction of the given faces computed near
|
||||
//! the shared edge coincide.
|
||||
//! Returns the status of operation:
|
||||
//! * 0 - in case of error (shared edge not found or directions are not collinear)
|
||||
//! * 1 - normal directions coincide;
|
||||
//! * -1 - normal directions are opposite.
|
||||
Standard_EXPORT static Standard_Integer Sense(const TopoDS_Face& theF1,
|
||||
const TopoDS_Face& theF2,
|
||||
const Handle(IntTools_Context)& theContext);
|
||||
|
||||
public: //! @name Making connexity blocks
|
||||
|
||||
//! For the list of faces theLS build block
|
||||
//! theLSCB in terms of connexity by edges
|
||||
//! theMapAvoid - set of edges to avoid for
|
||||
//! the treatment
|
||||
Standard_EXPORT static void MakeConnexityBlock (TopTools_ListOfShape& theLS, TopTools_IndexedMapOfShape& theMapAvoid, TopTools_ListOfShape& theLSCB, const Handle(NCollection_BaseAllocator)& theAllocator);
|
||||
Standard_EXPORT static void MakeConnexityBlock(TopTools_ListOfShape& theLS,
|
||||
TopTools_IndexedMapOfShape& theMapAvoid,
|
||||
TopTools_ListOfShape& theLSCB,
|
||||
const Handle(NCollection_BaseAllocator)& theAllocator);
|
||||
|
||||
//! For the compound <theS> builds the blocks (compounds) of
|
||||
//! elements of type <theElementType> connected through the shapes
|
||||
@@ -219,139 +427,136 @@ public:
|
||||
const TopAbs_ShapeEnum theElementType,
|
||||
BOPTools_ListOfConnexityBlock& theLCB);
|
||||
|
||||
public: //! @name Orienting elements in container
|
||||
|
||||
//! Correctly orients edges on the wire
|
||||
Standard_EXPORT static void OrientEdgesOnWire (TopoDS_Shape& theWire);
|
||||
Standard_EXPORT static void OrientEdgesOnWire(TopoDS_Shape& theWire);
|
||||
|
||||
//! Correctly orients faces on the shell
|
||||
Standard_EXPORT static void OrientFacesOnShell (TopoDS_Shape& theShell);
|
||||
|
||||
Standard_EXPORT static void OrientFacesOnShell(TopoDS_Shape& theShell);
|
||||
|
||||
|
||||
public: //! @name Methods for shape validation (correction)
|
||||
|
||||
//! Provides valid values of tolerances for the shape <theS>
|
||||
//! <theTolMax> is max value of the tolerance that can be
|
||||
//! accepted for correction. If real value of the tolerance
|
||||
//! will be greater than <aTolMax>, the correction does not
|
||||
//! perform.
|
||||
Standard_EXPORT static void CorrectTolerances
|
||||
(const TopoDS_Shape& theS,
|
||||
const TopTools_IndexedMapOfShape& theMapToAvoid,
|
||||
const Standard_Real theTolMax = 0.0001,
|
||||
const Standard_Boolean theRunParallel = Standard_False);
|
||||
Standard_EXPORT static void CorrectTolerances(const TopoDS_Shape& theS,
|
||||
const TopTools_IndexedMapOfShape& theMapToAvoid,
|
||||
const Standard_Real theTolMax = 0.0001,
|
||||
const Standard_Boolean theRunParallel = Standard_False);
|
||||
|
||||
//! Provides valid values of tolerances for the shape <theS>
|
||||
//! in terms of BRepCheck_InvalidCurveOnSurface.
|
||||
Standard_EXPORT static void CorrectCurveOnSurface
|
||||
(const TopoDS_Shape& theS,
|
||||
const TopTools_IndexedMapOfShape& theMapToAvoid,
|
||||
const Standard_Real theTolMax = 0.0001,
|
||||
const Standard_Boolean theRunParallel = Standard_False);
|
||||
Standard_EXPORT static void CorrectCurveOnSurface(const TopoDS_Shape& theS,
|
||||
const TopTools_IndexedMapOfShape& theMapToAvoid,
|
||||
const Standard_Real theTolMax = 0.0001,
|
||||
const Standard_Boolean theRunParallel = Standard_False);
|
||||
|
||||
//! Provides valid values of tolerances for the shape <theS>
|
||||
//! in terms of BRepCheck_InvalidPointOnCurve.
|
||||
Standard_EXPORT static void CorrectPointOnCurve
|
||||
(const TopoDS_Shape& theS,
|
||||
const TopTools_IndexedMapOfShape& theMapToAvoid,
|
||||
const Standard_Real theTolMax = 0.0001,
|
||||
const Standard_Boolean theRunParallel = Standard_False);
|
||||
Standard_EXPORT static void CorrectPointOnCurve(const TopoDS_Shape& theS,
|
||||
const TopTools_IndexedMapOfShape& theMapToAvoid,
|
||||
const Standard_Real theTolMax = 0.0001,
|
||||
const Standard_Boolean theRunParallel = Standard_False);
|
||||
|
||||
//! Make a vertex using 3D-point <aP1> and 3D-tolerance value <aTol>
|
||||
Standard_EXPORT static void MakeNewVertex (const gp_Pnt& aP1, const Standard_Real aTol, TopoDS_Vertex& aNewVertex);
|
||||
|
||||
//! Corrects tolerance values of the sub-shapes of the shape <theS> if needed.
|
||||
Standard_EXPORT static void CorrectShapeTolerances(const TopoDS_Shape& theS,
|
||||
const TopTools_IndexedMapOfShape& theMapToAvoid,
|
||||
const Standard_Boolean theRunParallel = Standard_False);
|
||||
|
||||
//! Make a vertex using couple of vertices <aV1, aV2>
|
||||
Standard_EXPORT static void MakeNewVertex (const TopoDS_Vertex& aV1, const TopoDS_Vertex& aV2, TopoDS_Vertex& aNewVertex);
|
||||
|
||||
|
||||
//! Make a vertex in place of intersection between two edges
|
||||
//! <aE1, aE2> with parameters <aP1, aP2>
|
||||
Standard_EXPORT static void MakeNewVertex (const TopoDS_Edge& aE1, const Standard_Real aP1, const TopoDS_Edge& aE2, const Standard_Real aP2, TopoDS_Vertex& aNewVertex);
|
||||
|
||||
public: //! Checking if the faces are coinciding
|
||||
|
||||
//! Make a vertex in place of intersection between the edge <aE1>
|
||||
//! with parameter <aP1> and the face <aF2>
|
||||
Standard_EXPORT static void MakeNewVertex (const TopoDS_Edge& aE1, const Standard_Real aP1, const TopoDS_Face& aF2, TopoDS_Vertex& aNewVertex);
|
||||
|
||||
//! Checks if the given faces are same-domain, i.e. coincide.
|
||||
Standard_EXPORT static Standard_Boolean AreFacesSameDomain(const TopoDS_Face& theF1,
|
||||
const TopoDS_Face& theF2,
|
||||
const Handle(IntTools_Context)& theContext,
|
||||
const Standard_Real theFuzz = Precision::Confusion());
|
||||
|
||||
//! Compute a 3D-point on the edge <aEdge> at parameter <aPrm>
|
||||
Standard_EXPORT static void PointOnEdge (const TopoDS_Edge& aEdge, const Standard_Real aPrm, gp_Pnt& aP);
|
||||
public: //! @name Looking for the edge in the face
|
||||
|
||||
//! Makes a copy of <theEdge> with vertices.
|
||||
Standard_EXPORT static TopoDS_Edge CopyEdge(const TopoDS_Edge& theEdge);
|
||||
//! Returns True if the face theFace contains
|
||||
//! the edge theEdge but with opposite orientation.
|
||||
//! If the method returns True theEdgeOff is the
|
||||
//! edge founded
|
||||
Standard_EXPORT static Standard_Boolean GetEdgeOff(const TopoDS_Edge& theEdge,
|
||||
const TopoDS_Face& theFace,
|
||||
TopoDS_Edge& theEdgeOff);
|
||||
|
||||
//! Make the edge from base edge <aE1> and two vertices <aV1,aV2>
|
||||
//! at parameters <aP1,aP2>
|
||||
Standard_EXPORT static void MakeSplitEdge (const TopoDS_Edge& aE1, const TopoDS_Vertex& aV1, const Standard_Real aP1, const TopoDS_Vertex& aV2, const Standard_Real aP2, TopoDS_Edge& aNewEdge);
|
||||
|
||||
//! For the face theFace gets the edge theEdgeOnF
|
||||
//! that is the same as theEdge
|
||||
//! Returns True if such edge exists
|
||||
//! Returns False if there is no such edge
|
||||
Standard_EXPORT static Standard_Boolean GetEdgeOnFace(const TopoDS_Edge& theEdge,
|
||||
const TopoDS_Face& theFace,
|
||||
TopoDS_Edge& theEdgeOnF);
|
||||
|
||||
//! Make the edge from 3D-Curve <aIC> and two vertices <aV1,aV2>
|
||||
//! at parameters <aP1,aP2>
|
||||
Standard_EXPORT static void MakeSectEdge (const IntTools_Curve& aIC, const TopoDS_Vertex& aV1, const Standard_Real aP1, const TopoDS_Vertex& aV2, const Standard_Real aP2, TopoDS_Edge& aNewEdge);
|
||||
|
||||
|
||||
//! Update the tolerance value for vertex <aV>
|
||||
//! taking into account the fact that <aV> lays on
|
||||
//! the curve <aIC>
|
||||
Standard_EXPORT static void UpdateVertex (const IntTools_Curve& aIC, const Standard_Real aT, const TopoDS_Vertex& aV);
|
||||
|
||||
public: //! @name Correction of the edges range
|
||||
|
||||
//! Update the tolerance value for vertex <aV>
|
||||
//! taking into account the fact that <aV> lays on
|
||||
//! the edge <aE>
|
||||
Standard_EXPORT static void UpdateVertex (const TopoDS_Edge& aE, const Standard_Real aT, const TopoDS_Vertex& aV);
|
||||
|
||||
|
||||
//! Update the tolerance value for vertex <aVN>
|
||||
//! taking into account the fact that <aVN> should
|
||||
//! cover tolerance zone of <aVF>
|
||||
Standard_EXPORT static void UpdateVertex (const TopoDS_Vertex& aVF, const TopoDS_Vertex& aVN);
|
||||
//! Correct shrunk range <aSR> taking into account 3D-curve
|
||||
//! resolution and corresponding tolerance values of <aE1>, <aE2>
|
||||
Standard_EXPORT static void CorrectRange(const TopoDS_Edge& aE1,
|
||||
const TopoDS_Edge& aE2,
|
||||
const IntTools_Range& aSR,
|
||||
IntTools_Range& aNewSR);
|
||||
|
||||
|
||||
//! Correct shrunk range <aSR> taking into account 3D-curve
|
||||
//! resolution and corresp. tolerances' values of <aE1>, <aE2>
|
||||
Standard_EXPORT static void CorrectRange (const TopoDS_Edge& aE1, const TopoDS_Edge& aE2, const IntTools_Range& aSR, IntTools_Range& aNewSR);
|
||||
|
||||
//! resolution and corresponding tolerance values of <aE>, <aF>
|
||||
Standard_EXPORT static void CorrectRange(const TopoDS_Edge& aE,
|
||||
const TopoDS_Face& aF,
|
||||
const IntTools_Range& aSR,
|
||||
IntTools_Range& aNewSR);
|
||||
|
||||
//! Correct shrunk range <aSR> taking into account 3D-curve
|
||||
//! resolution and corresp. tolerances' values of <aE>, <aF>
|
||||
Standard_EXPORT static void CorrectRange (const TopoDS_Edge& aE, const TopoDS_Face& aF, const IntTools_Range& aSR, IntTools_Range& aNewSR);
|
||||
|
||||
|
||||
//! Returns TRUE if PaveBlock <aPB> lays on the face <aF>, i.e
|
||||
//! the <PB> is IN or ON in 2D of <aF>
|
||||
Standard_EXPORT static Standard_Boolean IsBlockInOnFace (const IntTools_Range& aShR, const TopoDS_Face& aF, const TopoDS_Edge& aE, Handle(IntTools_Context)& aContext);
|
||||
|
||||
public: //! @name Checking edge on micro status
|
||||
|
||||
//! Checks if it is possible to compute shrunk range for the edge <aE>
|
||||
//! Flag <theCheckSplittable> defines whether to take into account
|
||||
//! the possiblity to split the edge or not.
|
||||
Standard_EXPORT static Standard_Boolean IsMicroEdge (const TopoDS_Edge& theEdge,
|
||||
const Handle(IntTools_Context)& theContext,
|
||||
const Standard_Boolean theCheckSplittable = Standard_True);
|
||||
|
||||
//! the possibility to split the edge or not.
|
||||
Standard_EXPORT static Standard_Boolean IsMicroEdge(const TopoDS_Edge& theEdge,
|
||||
const Handle(IntTools_Context)& theContext,
|
||||
const Standard_Boolean theCheckSplittable = Standard_True);
|
||||
|
||||
//! Corrects tolerance values of the sub-shapes of the shape <theS> if needed.
|
||||
Standard_EXPORT static void CorrectShapeTolerances
|
||||
(const TopoDS_Shape& theS,
|
||||
const TopTools_IndexedMapOfShape& theMapToAvoid,
|
||||
const Standard_Boolean theRunParallel = Standard_False);
|
||||
public: //! @name Solid classification
|
||||
|
||||
//! Retutns dimension of the shape <theS>.
|
||||
Standard_EXPORT static Standard_Integer Dimension (const TopoDS_Shape& theS);
|
||||
|
||||
//! Returns true if the shell <theShell> is open
|
||||
Standard_EXPORT static Standard_Boolean IsOpenShell (const TopoDS_Shell& theShell);
|
||||
|
||||
//! Returns true if the solid <theSolid> is inverted
|
||||
Standard_EXPORT static Standard_Boolean IsInvertedSolid (const TopoDS_Solid& theSolid);
|
||||
|
||||
Standard_EXPORT static Standard_Boolean IsInvertedSolid(const TopoDS_Solid& theSolid);
|
||||
|
||||
public: //! @name Edge/Face Deviation computation
|
||||
|
||||
//! Computes the necessary value of the tolerance for the edge
|
||||
Standard_EXPORT static Standard_Boolean ComputeTolerance (const TopoDS_Face& theFace, const TopoDS_Edge& theEdge, Standard_Real& theMaxDist, Standard_Real& theMaxPar);
|
||||
Standard_EXPORT static Standard_Boolean ComputeTolerance(const TopoDS_Face& theFace,
|
||||
const TopoDS_Edge& theEdge,
|
||||
Standard_Real& theMaxDist,
|
||||
Standard_Real& theMaxPar);
|
||||
|
||||
public: //! @name Other methods
|
||||
|
||||
protected:
|
||||
//! Makes empty container of requested type
|
||||
Standard_EXPORT static void MakeContainer(const TopAbs_ShapeEnum theType,
|
||||
TopoDS_Shape& theShape);
|
||||
|
||||
//! Compute a 3D-point on the edge <aEdge> at parameter <aPrm>
|
||||
Standard_EXPORT static void PointOnEdge(const TopoDS_Edge& aEdge,
|
||||
const Standard_Real aPrm,
|
||||
gp_Pnt& aP);
|
||||
|
||||
private:
|
||||
//! Returns TRUE if PaveBlock <aPB> lays on the face <aF>, i.e
|
||||
//! the <PB> is IN or ON in 2D of <aF>
|
||||
Standard_EXPORT static Standard_Boolean IsBlockInOnFace(const IntTools_Range& aShR,
|
||||
const TopoDS_Face& aF,
|
||||
const TopoDS_Edge& aE,
|
||||
const Handle(IntTools_Context)& aContext);
|
||||
|
||||
//! Retutns dimension of the shape <theS>.
|
||||
Standard_EXPORT static Standard_Integer Dimension(const TopoDS_Shape& theS);
|
||||
|
||||
//! Returns true if the shell <theShell> is open
|
||||
Standard_EXPORT static Standard_Boolean IsOpenShell(const TopoDS_Shell& theShell);
|
||||
|
||||
};
|
||||
|
||||
|
@@ -42,19 +42,17 @@ public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
|
||||
//! Compute P-Curve for the edge <aE> on the face <aF>.<br>
|
||||
//! Raises exception Standard_ConstructionError if projection algorithm fails.<br>
|
||||
//! <theContext> - storage for caching the geometrical tools
|
||||
Standard_EXPORT static void BuildPCurveForEdgeOnFace (const TopoDS_Edge& aE,
|
||||
const TopoDS_Face& aF,
|
||||
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
|
||||
|
||||
Standard_EXPORT static void BuildPCurveForEdgeOnFace(const TopoDS_Edge& aE,
|
||||
const TopoDS_Face& aF,
|
||||
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
|
||||
|
||||
//! Compute tangent for the edge <aE> [in 3D] at parameter <aT>
|
||||
Standard_EXPORT static Standard_Boolean EdgeTangent (const TopoDS_Edge& anE, const Standard_Real aT, gp_Vec& Tau);
|
||||
|
||||
Standard_EXPORT static Standard_Boolean EdgeTangent(const TopoDS_Edge& anE,
|
||||
const Standard_Real aT,
|
||||
gp_Vec& Tau);
|
||||
|
||||
//! Compute surface parameters <U,V> of the face <aF>
|
||||
//! for the point from the edge <aE> at parameter <aT>.<br>
|
||||
@@ -62,24 +60,23 @@ public:
|
||||
//! projection and can
|
||||
//! raise exception Standard_ConstructionError if projection algorithm fails.<br>
|
||||
//! <theContext> - storage for caching the geometrical tools
|
||||
Standard_EXPORT static void PointOnSurface (const TopoDS_Edge& aE,
|
||||
const TopoDS_Face& aF,
|
||||
const Standard_Real aT,
|
||||
Standard_Real& U,
|
||||
Standard_Real& V,
|
||||
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
|
||||
|
||||
Standard_EXPORT static void PointOnSurface(const TopoDS_Edge& aE,
|
||||
const TopoDS_Face& aF,
|
||||
const Standard_Real aT,
|
||||
Standard_Real& U,
|
||||
Standard_Real& V,
|
||||
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
|
||||
|
||||
//! Get P-Curve <aC> for the edge <aE> on surface <aF> .<br>
|
||||
//! If the P-Curve does not exist, build it using Make2D().<br>
|
||||
//! [aToler] - reached tolerance
|
||||
//! Raises exception Standard_ConstructionError if algorithm Make2D() fails.<br>
|
||||
//! <theContext> - storage for caching the geometrical tools
|
||||
Standard_EXPORT static void CurveOnSurface (const TopoDS_Edge& aE,
|
||||
const TopoDS_Face& aF,
|
||||
Handle(Geom2d_Curve)& aC,
|
||||
Standard_Real& aToler,
|
||||
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
|
||||
Standard_EXPORT static void CurveOnSurface(const TopoDS_Edge& aE,
|
||||
const TopoDS_Face& aF,
|
||||
Handle(Geom2d_Curve)& aC,
|
||||
Standard_Real& aToler,
|
||||
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
|
||||
|
||||
//! Get P-Curve <aC> for the edge <aE> on surface <aF> .<br>
|
||||
//! If the P-Curve does not exist, build it using Make2D().<br>
|
||||
@@ -87,102 +84,108 @@ public:
|
||||
//! [aToler] - reached tolerance<br>
|
||||
//! Raises exception Standard_ConstructionError if algorithm Make2D() fails.<br>
|
||||
//! <theContext> - storage for caching the geometrical tools
|
||||
Standard_EXPORT static void CurveOnSurface (const TopoDS_Edge& aE,
|
||||
const TopoDS_Face& aF,
|
||||
Handle(Geom2d_Curve)& aC,
|
||||
Standard_Real& aFirst,
|
||||
Standard_Real& aLast,
|
||||
Standard_Real& aToler,
|
||||
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
|
||||
|
||||
Standard_EXPORT static void CurveOnSurface(const TopoDS_Edge& aE,
|
||||
const TopoDS_Face& aF,
|
||||
Handle(Geom2d_Curve)& aC,
|
||||
Standard_Real& aFirst,
|
||||
Standard_Real& aLast,
|
||||
Standard_Real& aToler,
|
||||
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
|
||||
|
||||
//! Returns TRUE if the edge <aE> has P-Curve <aC>
|
||||
//! on surface <aF> .
|
||||
//! [aFirst, aLast] - range of the P-Curve
|
||||
//! [aToler] - reached tolerance
|
||||
//! If the P-Curve does not exist, aC.IsNull()=TRUE.
|
||||
Standard_EXPORT static Standard_Boolean HasCurveOnSurface (const TopoDS_Edge& aE, const TopoDS_Face& aF, Handle(Geom2d_Curve)& aC, Standard_Real& aFirst, Standard_Real& aLast, Standard_Real& aToler);
|
||||
|
||||
Standard_EXPORT static Standard_Boolean HasCurveOnSurface(const TopoDS_Edge& aE,
|
||||
const TopoDS_Face& aF,
|
||||
Handle(Geom2d_Curve)& aC,
|
||||
Standard_Real& aFirst,
|
||||
Standard_Real& aLast,
|
||||
Standard_Real& aToler);
|
||||
|
||||
//! Returns TRUE if the edge <aE> has P-Curve <aC>
|
||||
//! on surface <aF> .
|
||||
//! If the P-Curve does not exist, aC.IsNull()=TRUE.
|
||||
Standard_EXPORT static Standard_Boolean HasCurveOnSurface (const TopoDS_Edge& aE, const TopoDS_Face& aF);
|
||||
|
||||
Standard_EXPORT static Standard_Boolean HasCurveOnSurface(const TopoDS_Edge& aE,
|
||||
const TopoDS_Face& aF);
|
||||
|
||||
//! Adjust P-Curve <theC2D> (3D-curve <theC3D>) on surface of the face <theF>.<br>
|
||||
//! <theContext> - storage for caching the geometrical tools
|
||||
Standard_EXPORT static void AdjustPCurveOnFace (const TopoDS_Face& theF,
|
||||
const Handle(Geom_Curve)& theC3D,
|
||||
const Handle(Geom2d_Curve)& theC2D,
|
||||
Handle(Geom2d_Curve)& theC2DA,
|
||||
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
|
||||
|
||||
Standard_EXPORT static void AdjustPCurveOnFace(const TopoDS_Face& theF,
|
||||
const Handle(Geom_Curve)& theC3D,
|
||||
const Handle(Geom2d_Curve)& theC2D,
|
||||
Handle(Geom2d_Curve)& theC2DA,
|
||||
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
|
||||
|
||||
//! Adjust P-Curve <aC2D> (3D-curve <C3D>) on surface <aF> .<br>
|
||||
//! [aT1, aT2] - range to adjust<br>
|
||||
//! <theContext> - storage for caching the geometrical tools
|
||||
Standard_EXPORT static void AdjustPCurveOnFace (const TopoDS_Face& theF,
|
||||
const Standard_Real theFirst,
|
||||
const Standard_Real theLast,
|
||||
const Handle(Geom2d_Curve)& theC2D,
|
||||
Handle(Geom2d_Curve)& theC2DA,
|
||||
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
|
||||
Standard_EXPORT static void AdjustPCurveOnFace(const TopoDS_Face& theF,
|
||||
const Standard_Real theFirst,
|
||||
const Standard_Real theLast,
|
||||
const Handle(Geom2d_Curve)& theC2D,
|
||||
Handle(Geom2d_Curve)& theC2DA,
|
||||
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
|
||||
|
||||
//! Adjust P-Curve <aC2D> (3D-curve <C3D>) on surface <aF> .
|
||||
//! [aT1, aT2] - range to adjust
|
||||
Standard_EXPORT static void AdjustPCurveOnSurf (const BRepAdaptor_Surface& aF, const Standard_Real aT1, const Standard_Real aT2, const Handle(Geom2d_Curve)& aC2D, Handle(Geom2d_Curve)& aC2DA);
|
||||
|
||||
Standard_EXPORT static void AdjustPCurveOnSurf(const BRepAdaptor_Surface& aF,
|
||||
const Standard_Real aT1,
|
||||
const Standard_Real aT2,
|
||||
const Handle(Geom2d_Curve)& aC2D,
|
||||
Handle(Geom2d_Curve)& aC2DA);
|
||||
|
||||
//! Compute intermediate value in between [aFirst, aLast] .
|
||||
Standard_EXPORT static Standard_Real IntermediatePoint (const Standard_Real aFirst, const Standard_Real aLast);
|
||||
|
||||
Standard_EXPORT static Standard_Real IntermediatePoint(const Standard_Real aFirst,
|
||||
const Standard_Real aLast);
|
||||
|
||||
//! Compute intermediate value of parameter for the edge <anE>.
|
||||
Standard_EXPORT static Standard_Real IntermediatePoint (const TopoDS_Edge& anE);
|
||||
Standard_EXPORT static Standard_Real IntermediatePoint(const TopoDS_Edge& anE);
|
||||
|
||||
//! Make P-Curve <aC> for the edge <aE> on surface <aF> .<br>
|
||||
//! [aFirst, aLast] - range of the P-Curve<br>
|
||||
//! [aToler] - reached tolerance<br>
|
||||
//! Raises exception Standard_ConstructionError if algorithm fails.<br>
|
||||
//! <theContext> - storage for caching the geometrical tools
|
||||
Standard_EXPORT static void Make2D (const TopoDS_Edge& aE,
|
||||
const TopoDS_Face& aF,
|
||||
Handle(Geom2d_Curve)& aC,
|
||||
Standard_Real& aFirst,
|
||||
Standard_Real& aLast,
|
||||
Standard_Real& aToler,
|
||||
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
|
||||
|
||||
Standard_EXPORT static void Make2D(const TopoDS_Edge& aE,
|
||||
const TopoDS_Face& aF,
|
||||
Handle(Geom2d_Curve)& aC,
|
||||
Standard_Real& aFirst,
|
||||
Standard_Real& aLast,
|
||||
Standard_Real& aToler,
|
||||
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
|
||||
|
||||
//! Make P-Curve <aC> for the 3D-curve <C3D> on surface <aF> .<br>
|
||||
//! [aToler] - reached tolerance<br>
|
||||
//! Raises exception Standard_ConstructionError if projection algorithm fails.<br>
|
||||
//! <theContext> - storage for caching the geometrical tools
|
||||
Standard_EXPORT static void MakePCurveOnFace (const TopoDS_Face& aF,
|
||||
const Handle(Geom_Curve)& C3D,
|
||||
Handle(Geom2d_Curve)& aC,
|
||||
Standard_Real& aToler,
|
||||
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
|
||||
|
||||
Standard_EXPORT static void MakePCurveOnFace(const TopoDS_Face& aF,
|
||||
const Handle(Geom_Curve)& C3D,
|
||||
Handle(Geom2d_Curve)& aC,
|
||||
Standard_Real& aToler,
|
||||
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
|
||||
|
||||
//! Make P-Curve <aC> for the 3D-curve <C3D> on surface <aF> .<br>
|
||||
//! [aT1, aT2] - range to build<br>
|
||||
//! [aToler] - reached tolerance<br>
|
||||
//! Raises exception Standard_ConstructionError if projection algorithm fails.<br>
|
||||
//! <theContext> - storage for caching the geometrical tools
|
||||
Standard_EXPORT static void MakePCurveOnFace (const TopoDS_Face& aF,
|
||||
const Handle(Geom_Curve)& C3D,
|
||||
const Standard_Real aT1,
|
||||
const Standard_Real aT2,
|
||||
Handle(Geom2d_Curve)& aC,
|
||||
Standard_Real& aToler,
|
||||
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
|
||||
|
||||
Standard_EXPORT static void MakePCurveOnFace(const TopoDS_Face& aF,
|
||||
const Handle(Geom_Curve)& C3D,
|
||||
const Standard_Real aT1,
|
||||
const Standard_Real aT2,
|
||||
Handle(Geom2d_Curve)& aC,
|
||||
Standard_Real& aToler,
|
||||
const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
|
||||
|
||||
//! Attach P-Curve from the edge <aEold> on surface <aF>
|
||||
//! to the edge <aEnew>
|
||||
//! Returns 0 in case of success
|
||||
Standard_EXPORT static Standard_Integer AttachExistingPCurve (const TopoDS_Edge& aEold, const TopoDS_Edge& aEnew, const TopoDS_Face& aF, const Handle(IntTools_Context)& aCtx);
|
||||
Standard_EXPORT static Standard_Integer AttachExistingPCurve(const TopoDS_Edge& aEold,
|
||||
const TopoDS_Edge& aEnew,
|
||||
const TopoDS_Face& aF,
|
||||
const Handle(IntTools_Context)& aCtx);
|
||||
|
||||
//! Checks if CurveOnSurface of theE on theF matches with isoline of theF surface.
|
||||
//! Sets corresponding values for isTheUIso and isTheVIso variables.
|
||||
@@ -199,25 +202,6 @@ public:
|
||||
Standard_Boolean& isTheUIso,
|
||||
Standard_Boolean& isTheVIso);
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _BOPTools_AlgoTools2D_HeaderFile
|
||||
|
@@ -40,7 +40,7 @@
|
||||
#include <IntTools_Context.hxx>
|
||||
#include <IntTools_Tools.hxx>
|
||||
|
||||
#include <BOPTools_AlgoTools2D.hxx>
|
||||
#include <BOPTools_AlgoTools.hxx>
|
||||
|
||||
|
||||
|
||||
@@ -49,10 +49,6 @@ static
|
||||
const TopoDS_Edge& ,
|
||||
const TopoDS_Face& ,
|
||||
const Handle(IntTools_Context)& );
|
||||
static
|
||||
Standard_Boolean IsToReverse(const TopoDS_Edge& ,
|
||||
const TopoDS_Edge& ,
|
||||
const Handle(IntTools_Context)& );
|
||||
static
|
||||
Standard_Boolean IsClosed(const TopoDS_Edge& ,
|
||||
const TopoDS_Face& );
|
||||
@@ -85,7 +81,7 @@ Standard_Integer BOPTools_AlgoTools2D::AttachExistingPCurve
|
||||
//
|
||||
aC2DoldC=Handle(Geom2d_Curve)::DownCast(aC2Dold->Copy());
|
||||
//
|
||||
bIsToReverse=IsToReverse(aE2, aE1, aCtx);
|
||||
bIsToReverse = BOPTools_AlgoTools::IsSplitToReverse(aE1, aE2, aCtx);
|
||||
if (bIsToReverse) {
|
||||
Standard_Real aT21r, aT22r;
|
||||
//
|
||||
@@ -281,49 +277,6 @@ Standard_Integer UpdateClosedPCurve(const TopoDS_Edge& aEold,
|
||||
return iRet;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : IsToReverse
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean IsToReverse(const TopoDS_Edge& aEold,
|
||||
const TopoDS_Edge& aEnew,
|
||||
const Handle(IntTools_Context)& aCtx)
|
||||
{
|
||||
Standard_Boolean bRet, bIsDegenerated;
|
||||
Standard_Real aTnew, aTold, aScPr, aTa, aTb, aT1, aT2;
|
||||
gp_Vec aVold, aVnew, aVE, aVS;
|
||||
gp_Pnt aP;
|
||||
Handle(Geom_Curve) aCold, aCnew;
|
||||
//
|
||||
bRet=Standard_False;
|
||||
//
|
||||
bIsDegenerated=(BRep_Tool::Degenerated(aEold) ||
|
||||
BRep_Tool::Degenerated(aEnew));
|
||||
if (bIsDegenerated) {
|
||||
return bRet;
|
||||
}
|
||||
//
|
||||
aCold=BRep_Tool::Curve(aEold, aT1, aT2);
|
||||
aCnew=BRep_Tool::Curve(aEnew, aTa, aTb);
|
||||
//
|
||||
if (aCold==aCnew) {
|
||||
return bRet;
|
||||
}
|
||||
//
|
||||
aTnew=BOPTools_AlgoTools2D::IntermediatePoint(aTa, aTb);
|
||||
aCnew->D1(aTnew, aP, aVnew);
|
||||
aVnew.Normalize();
|
||||
//
|
||||
if (!aCtx->ProjectPointOnEdge(aP, aEold, aTold))
|
||||
return Standard_False;
|
||||
aCold->D1(aTold, aP, aVold);
|
||||
aVold.Normalize();
|
||||
//
|
||||
aScPr=aVnew*aVold;
|
||||
bRet=(aScPr<0.);
|
||||
//
|
||||
return bRet;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : IsClosed
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
@@ -369,7 +369,7 @@ Standard_Boolean BOPTools_AlgoTools3D::GetApproxNormalToFaceOnEdge
|
||||
const Standard_Real aT,
|
||||
gp_Pnt& aPNear,
|
||||
gp_Dir& aDNF,
|
||||
Handle(IntTools_Context)& theContext)
|
||||
const Handle(IntTools_Context)& theContext)
|
||||
{
|
||||
gp_Pnt2d aPx2DNear;
|
||||
Standard_Integer iErr = BOPTools_AlgoTools3D::PointNearEdge
|
||||
@@ -398,7 +398,7 @@ Standard_Boolean BOPTools_AlgoTools3D::GetApproxNormalToFaceOnEdge
|
||||
const Standard_Real theStep,
|
||||
gp_Pnt& aPNear,
|
||||
gp_Dir& aDNF,
|
||||
Handle(IntTools_Context)& theContext)
|
||||
const Handle(IntTools_Context)& theContext)
|
||||
{
|
||||
gp_Pnt2d aPx2DNear;
|
||||
Standard_Integer iErr = BOPTools_AlgoTools3D::PointNearEdge
|
||||
@@ -510,7 +510,7 @@ Standard_Integer BOPTools_AlgoTools3D::PointNearEdge
|
||||
const Standard_Real aT,
|
||||
gp_Pnt2d& aPx2DNear,
|
||||
gp_Pnt& aPxNear,
|
||||
Handle(IntTools_Context)& theContext)
|
||||
const Handle(IntTools_Context)& theContext)
|
||||
{
|
||||
Standard_Real aTolE, aTolF, dTx, dT2D;
|
||||
Handle(Geom_Surface) aS;
|
||||
@@ -563,7 +563,7 @@ Standard_Integer BOPTools_AlgoTools3D::PointNearEdge
|
||||
const Standard_Real theStep,
|
||||
gp_Pnt2d& aPx2DNear,
|
||||
gp_Pnt& aPxNear,
|
||||
Handle(IntTools_Context)& theContext)
|
||||
const Handle(IntTools_Context)& theContext)
|
||||
{
|
||||
Standard_Integer iErr = BOPTools_AlgoTools3D::PointNearEdge
|
||||
(aE, aF, aT, theStep, aPx2DNear, aPxNear);
|
||||
@@ -593,7 +593,7 @@ Standard_Integer BOPTools_AlgoTools3D::PointNearEdge
|
||||
const TopoDS_Face& aF,
|
||||
gp_Pnt2d& aPInFace2D,
|
||||
gp_Pnt& aPInFace,
|
||||
Handle(IntTools_Context)& theContext)
|
||||
const Handle(IntTools_Context)& theContext)
|
||||
{
|
||||
Standard_Real aT, aT1, aT2;
|
||||
//
|
||||
@@ -783,7 +783,7 @@ Standard_Integer BOPTools_AlgoTools3D::PointInFace
|
||||
(const TopoDS_Face& theF,
|
||||
gp_Pnt& theP,
|
||||
gp_Pnt2d& theP2D,
|
||||
Handle(IntTools_Context)& theContext)
|
||||
const Handle(IntTools_Context)& theContext)
|
||||
{
|
||||
Standard_Integer i, iErr = 1;
|
||||
Standard_Real aUMin, aUMax, aVMin, aVMax, aUx;
|
||||
@@ -822,7 +822,7 @@ Standard_Integer BOPTools_AlgoTools3D::PointInFace
|
||||
const Standard_Real theDt2D,
|
||||
gp_Pnt& theP,
|
||||
gp_Pnt2d& theP2D,
|
||||
Handle(IntTools_Context)& theContext)
|
||||
const Handle(IntTools_Context)& theContext)
|
||||
{
|
||||
Standard_Integer iErr;
|
||||
Standard_Real f, l;
|
||||
@@ -870,7 +870,7 @@ Standard_Integer BOPTools_AlgoTools3D::PointInFace
|
||||
const Handle(Geom2d_Curve)& theL2D,
|
||||
gp_Pnt& theP,
|
||||
gp_Pnt2d& theP2D,
|
||||
Handle(IntTools_Context)& theContext,
|
||||
const Handle(IntTools_Context)& theContext,
|
||||
const Standard_Real theDt2D)
|
||||
{
|
||||
Standard_Boolean bIsDone, bHasFirstPoint, bHasSecondPoint;
|
||||
|
@@ -100,7 +100,7 @@ public:
|
||||
const Standard_Real aT,
|
||||
gp_Pnt& aPx,
|
||||
gp_Dir& aD,
|
||||
Handle(IntTools_Context)& theContext);
|
||||
const Handle(IntTools_Context)& theContext);
|
||||
|
||||
//! Computes normal to the face <aF> for the 3D-point that
|
||||
//! belongs to the edge <aE> at parameter <aT>.<br>
|
||||
@@ -142,7 +142,7 @@ public:
|
||||
const Standard_Real aDt2D,
|
||||
gp_Pnt& aP,
|
||||
gp_Dir& aDNF,
|
||||
Handle(IntTools_Context)& theContext);
|
||||
const Handle(IntTools_Context)& theContext);
|
||||
|
||||
//! Compute the point <aPx>, (<aP2D>) that is near to
|
||||
//! the edge <aE> at parameter <aT> towards to the
|
||||
@@ -160,7 +160,7 @@ public:
|
||||
const Standard_Real aDt2D,
|
||||
gp_Pnt2d& aP2D,
|
||||
gp_Pnt& aPx,
|
||||
Handle(IntTools_Context)& theContext);
|
||||
const Handle(IntTools_Context)& theContext);
|
||||
|
||||
//! Compute the point <aPx>, (<aP2D>) that is near to
|
||||
//! the edge <aE> at parameter <aT> towards to the
|
||||
@@ -191,7 +191,7 @@ public:
|
||||
const Standard_Real aT,
|
||||
gp_Pnt2d& aP2D,
|
||||
gp_Pnt& aPx,
|
||||
Handle(IntTools_Context)& theContext);
|
||||
const Handle(IntTools_Context)& theContext);
|
||||
|
||||
|
||||
//! Compute the point <aPx>, (<aP2D>) that is near to
|
||||
@@ -208,7 +208,7 @@ public:
|
||||
const TopoDS_Face& aF,
|
||||
gp_Pnt2d& aP2D,
|
||||
gp_Pnt& aPx,
|
||||
Handle(IntTools_Context)& theContext);
|
||||
const Handle(IntTools_Context)& theContext);
|
||||
|
||||
|
||||
//! Returns simple step value that is used in 2D-computations
|
||||
@@ -232,7 +232,7 @@ public:
|
||||
Standard_EXPORT static Standard_Integer PointInFace (const TopoDS_Face& theF,
|
||||
gp_Pnt& theP,
|
||||
gp_Pnt2d& theP2D,
|
||||
Handle(IntTools_Context)& theContext);
|
||||
const Handle(IntTools_Context)& theContext);
|
||||
|
||||
//! Computes a point <theP> inside the face <theF>
|
||||
//! using starting point taken by the parameter <theT>
|
||||
@@ -249,7 +249,7 @@ public:
|
||||
const Standard_Real theDt2D,
|
||||
gp_Pnt& theP,
|
||||
gp_Pnt2d& theP2D,
|
||||
Handle(IntTools_Context)& theContext);
|
||||
const Handle(IntTools_Context)& theContext);
|
||||
|
||||
//! Computes a point <theP> inside the face <theF>
|
||||
//! using the line <theL> so that 2D point
|
||||
@@ -260,7 +260,7 @@ public:
|
||||
const Handle(Geom2d_Curve)& theL,
|
||||
gp_Pnt& theP,
|
||||
gp_Pnt2d& theP2D,
|
||||
Handle(IntTools_Context)& theContext,
|
||||
const Handle(IntTools_Context)& theContext,
|
||||
const Standard_Real theDt2D = 0.0);
|
||||
|
||||
|
||||
|
@@ -52,10 +52,13 @@ class Geom_BSplineCurve;
|
||||
//! The Curve from BRepAdaptor allows to use a Wire
|
||||
//! of the BRep topology like a 3D curve.
|
||||
//! Warning: With this class of curve, C0 and C1 continuities
|
||||
//! are not assumed. So be carful with some algorithm!
|
||||
//! are not assumed. So be careful with some algorithm!
|
||||
//! Please note that BRepAdaptor_CompCurve cannot be
|
||||
//! periodic curve at all (even if it contains single
|
||||
//! periodic edge).
|
||||
//!
|
||||
//! BRepAdaptor_CompCurve can only work on valid wires where all edges are
|
||||
//! connected to each other to make a chain.
|
||||
class BRepAdaptor_CompCurve : public Adaptor3d_Curve
|
||||
{
|
||||
public:
|
||||
|
@@ -18,6 +18,8 @@
|
||||
#include <BRepAlgo_Common.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
||||
Standard_DISABLE_DEPRECATION_WARNINGS
|
||||
|
||||
//=======================================================================
|
||||
//function : BRepAlgo_Common
|
||||
//purpose :
|
||||
@@ -30,3 +32,5 @@ BRepAlgo_Common::BRepAlgo_Common(const TopoDS_Shape& S1,
|
||||
PerformDS();
|
||||
Perform(TopAbs_IN,TopAbs_IN);
|
||||
}
|
||||
|
||||
Standard_ENABLE_DEPRECATION_WARNINGS
|
||||
|
@@ -31,7 +31,8 @@ class TopoDS_Shape;
|
||||
//! - defining the construction of a common shape,
|
||||
//! - implementing the construction algorithm, and
|
||||
//! - consulting the result.
|
||||
class BRepAlgo_Common : public BRepAlgo_BooleanOperation
|
||||
class Standard_DEPRECATED("This class is deprecated - BRepAlgoAPI_Common should be used instead")
|
||||
BRepAlgo_Common : public BRepAlgo_BooleanOperation
|
||||
{
|
||||
public:
|
||||
|
||||
|
@@ -18,6 +18,8 @@
|
||||
#include <BRepAlgo_Cut.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
||||
Standard_DISABLE_DEPRECATION_WARNINGS
|
||||
|
||||
//=======================================================================
|
||||
//function : BRepAlgo_Cut
|
||||
//purpose :
|
||||
@@ -30,3 +32,5 @@ BRepAlgo_Cut::BRepAlgo_Cut(const TopoDS_Shape& S1,
|
||||
PerformDS();
|
||||
Perform(TopAbs_OUT,TopAbs_IN);
|
||||
}
|
||||
|
||||
Standard_ENABLE_DEPRECATION_WARNINGS
|
||||
|
@@ -31,7 +31,8 @@ class TopoDS_Shape;
|
||||
//! - defining the construction of a cut shape,
|
||||
//! - implementing the construction algorithm, and
|
||||
//! - consulting the result.
|
||||
class BRepAlgo_Cut : public BRepAlgo_BooleanOperation
|
||||
class Standard_DEPRECATED("This class is deprecated - BRepAlgoAPI_Cut should be used instead")
|
||||
BRepAlgo_Cut : public BRepAlgo_BooleanOperation
|
||||
{
|
||||
public:
|
||||
|
||||
|
@@ -18,6 +18,8 @@
|
||||
#include <BRepAlgo_Fuse.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
||||
Standard_DISABLE_DEPRECATION_WARNINGS
|
||||
|
||||
//=======================================================================
|
||||
//function : BRepAlgo_Fuse
|
||||
//purpose :
|
||||
@@ -30,3 +32,5 @@ BRepAlgo_Fuse::BRepAlgo_Fuse(const TopoDS_Shape& S1,
|
||||
PerformDS();
|
||||
Perform(TopAbs_OUT,TopAbs_OUT);
|
||||
}
|
||||
|
||||
Standard_ENABLE_DEPRECATION_WARNINGS
|
||||
|
@@ -31,7 +31,8 @@ class TopoDS_Shape;
|
||||
//! - defining the construction of a fused shape,
|
||||
//! - implementing the construction algorithm, and
|
||||
//! - consulting the result.
|
||||
class BRepAlgo_Fuse : public BRepAlgo_BooleanOperation
|
||||
class Standard_DEPRECATED("This class is deprecated - BRepAlgoAPI_Fuse should be used instead")
|
||||
BRepAlgo_Fuse : public BRepAlgo_BooleanOperation
|
||||
{
|
||||
public:
|
||||
|
||||
|
@@ -34,6 +34,8 @@
|
||||
|
||||
static TopoDS_Shape MakeShape(const Handle(Geom_Surface)& );
|
||||
|
||||
Standard_DISABLE_DEPRECATION_WARNINGS
|
||||
|
||||
//=======================================================================
|
||||
//function : BRepAlgo_Section
|
||||
//purpose :
|
||||
@@ -352,3 +354,5 @@ TopoDS_Shape MakeShape(const Handle(Geom_Surface)& S)
|
||||
if (c >= GeomAbs_C2) return BRepBuilderAPI_MakeFace(S, Precision::Confusion());
|
||||
else return BRepBuilderAPI_MakeShell(S);
|
||||
}
|
||||
|
||||
Standard_ENABLE_DEPRECATION_WARNINGS
|
||||
|
@@ -54,7 +54,8 @@ class Geom_Surface;
|
||||
//! S.Build();
|
||||
//! TopoDS_Shape R = S.Shape();
|
||||
//! On Null Shapes of geometries, NotDone() is called.
|
||||
class BRepAlgo_Section : public BRepAlgo_BooleanOperation
|
||||
class Standard_DEPRECATED("This class is deprecated - BRepAlgoAPI_Section should be used instead")
|
||||
BRepAlgo_Section : public BRepAlgo_BooleanOperation
|
||||
{
|
||||
public:
|
||||
|
||||
|
@@ -106,7 +106,9 @@ BRepMesh_Delaun::BRepMesh_Delaun(
|
||||
myCircles ( theVertices.Length(), theOldMesh->Allocator() )
|
||||
{
|
||||
if ( theVertices.Length() > 2 )
|
||||
{
|
||||
Init( theVertices );
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -119,16 +121,21 @@ BRepMesh_Delaun::BRepMesh_Delaun(
|
||||
: myMeshData( theOldMesh ),
|
||||
myCircles ( theVertexIndices.Length(), theOldMesh->Allocator() )
|
||||
{
|
||||
if ( theVertexIndices.Length() > 2 )
|
||||
{
|
||||
Bnd_Box2d aBox;
|
||||
Standard_Integer anIndex = theVertexIndices.Lower();
|
||||
Standard_Integer anUpper = theVertexIndices.Upper();
|
||||
for ( ; anIndex <= anUpper; ++anIndex )
|
||||
aBox.Add( gp_Pnt2d( GetVertex( theVertexIndices( anIndex) ).Coord() ) );
|
||||
perform( theVertexIndices );
|
||||
}
|
||||
|
||||
perform( aBox, theVertexIndices );
|
||||
}
|
||||
//=======================================================================
|
||||
//function : BRepMesh_Delaun
|
||||
//purpose : Creates the triangulation with and existent Mesh data structure
|
||||
//=======================================================================
|
||||
BRepMesh_Delaun::BRepMesh_Delaun (const Handle (BRepMesh_DataStructureOfDelaun)& theOldMesh,
|
||||
BRepMesh::Array1OfInteger& theVertexIndices,
|
||||
const Standard_Integer theCellsCountU,
|
||||
const Standard_Integer theCellsCountV)
|
||||
: myMeshData (theOldMesh),
|
||||
myCircles (theVertexIndices.Length (), theOldMesh->Allocator ())
|
||||
{
|
||||
perform (theVertexIndices, theCellsCountU, theCellsCountV);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -137,7 +144,6 @@ BRepMesh_Delaun::BRepMesh_Delaun(
|
||||
//=======================================================================
|
||||
void BRepMesh_Delaun::Init(BRepMesh::Array1OfVertexOfDelaun& theVertices)
|
||||
{
|
||||
Bnd_Box2d aBox;
|
||||
Standard_Integer aLowerIdx = theVertices.Lower();
|
||||
Standard_Integer anUpperIdx = theVertices.Upper();
|
||||
BRepMesh::Array1OfInteger aVertexIndexes( aLowerIdx, anUpperIdx );
|
||||
@@ -145,35 +151,62 @@ void BRepMesh_Delaun::Init(BRepMesh::Array1OfVertexOfDelaun& theVertices)
|
||||
Standard_Integer anIndex = aLowerIdx;
|
||||
for ( ; anIndex <= anUpperIdx; ++anIndex )
|
||||
{
|
||||
aBox.Add( gp_Pnt2d( theVertices( anIndex ).Coord() ) );
|
||||
aVertexIndexes( anIndex ) = myMeshData->AddNode( theVertices( anIndex ) );
|
||||
}
|
||||
|
||||
perform( aBox, aVertexIndexes );
|
||||
perform( aVertexIndexes );
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : perform
|
||||
//purpose : Create super mesh and run triangulation procedure
|
||||
//=======================================================================
|
||||
void BRepMesh_Delaun::perform(Bnd_Box2d& theBndBox,
|
||||
BRepMesh::Array1OfInteger& theVertexIndexes)
|
||||
void BRepMesh_Delaun::perform (BRepMesh::Array1OfInteger& theVertexIndices,
|
||||
const Standard_Integer theCellsCountU /* = -1 */,
|
||||
const Standard_Integer theCellsCountV /* = -1 */)
|
||||
{
|
||||
theBndBox.Enlarge( Precision );
|
||||
superMesh( theBndBox );
|
||||
if (theVertexIndices.Length () <= 2)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Bnd_Box2d aBox;
|
||||
Standard_Integer anIndex = theVertexIndices.Lower ();
|
||||
Standard_Integer anUpper = theVertexIndices.Upper ();
|
||||
for (; anIndex <= anUpper; ++anIndex)
|
||||
{
|
||||
aBox.Add (gp_Pnt2d (GetVertex (theVertexIndices (anIndex)).Coord ()));
|
||||
}
|
||||
|
||||
aBox.Enlarge (Precision);
|
||||
|
||||
Standard_Integer aScaler = 2;
|
||||
if ( myMeshData->NbNodes() > 100 )
|
||||
{
|
||||
aScaler = 5;
|
||||
}
|
||||
else if( myMeshData->NbNodes() > 1000 )
|
||||
{
|
||||
aScaler = 7;
|
||||
}
|
||||
|
||||
superMesh (aBox, Max (theCellsCountU, aScaler),
|
||||
Max (theCellsCountV, aScaler));
|
||||
|
||||
ComparatorOfIndexedVertexOfDelaun aCmp(myMeshData);
|
||||
std::make_heap(theVertexIndexes.begin(), theVertexIndexes.end(), aCmp);
|
||||
std::sort_heap(theVertexIndexes.begin(), theVertexIndexes.end(), aCmp);
|
||||
std::make_heap(theVertexIndices.begin(), theVertexIndices.end(), aCmp);
|
||||
std::sort_heap(theVertexIndices.begin(), theVertexIndices.end(), aCmp);
|
||||
|
||||
compute( theVertexIndexes );
|
||||
compute( theVertexIndices );
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : superMesh
|
||||
//purpose : Build the super mesh
|
||||
//=======================================================================
|
||||
void BRepMesh_Delaun::superMesh( const Bnd_Box2d& theBox )
|
||||
void BRepMesh_Delaun::superMesh (const Bnd_Box2d& theBox,
|
||||
const Standard_Integer theCellsCountU,
|
||||
const Standard_Integer theCellsCountV)
|
||||
{
|
||||
Standard_Real aMinX, aMinY, aMaxX, aMaxY;
|
||||
theBox.Get( aMinX, aMinY, aMaxX, aMaxY );
|
||||
@@ -185,15 +218,7 @@ void BRepMesh_Delaun::superMesh( const Bnd_Box2d& theBox )
|
||||
Standard_Real aDelta = aDeltaX + aDeltaY;
|
||||
|
||||
myCircles.SetMinMaxSize( gp_XY( aMinX, aMinY ), gp_XY( aMaxX, aMaxY ) );
|
||||
|
||||
Standard_Integer aScaler = 2;
|
||||
if ( myMeshData->NbNodes() > 100 )
|
||||
aScaler = 5;
|
||||
else if( myMeshData->NbNodes() > 1000 )
|
||||
aScaler = 7;
|
||||
|
||||
myCircles.SetCellSize( aDeltaX / aScaler,
|
||||
aDeltaY / aScaler );
|
||||
myCircles.SetCellSize( aDeltaX / theCellsCountU, aDeltaY / theCellsCountV);
|
||||
|
||||
mySupVert[0] = myMeshData->AddNode(
|
||||
BRepMesh_Vertex( ( aMinX + aMaxX ) / 2, aMaxY + aDeltaMax, BRepMesh_Free ) );
|
||||
|
@@ -52,6 +52,12 @@ public:
|
||||
Standard_EXPORT BRepMesh_Delaun (const Handle(BRepMesh_DataStructureOfDelaun)& theOldMesh,
|
||||
BRepMesh::Array1OfInteger& theVertexIndices);
|
||||
|
||||
//! Creates the triangulation with an existant Mesh data structure.
|
||||
Standard_EXPORT BRepMesh_Delaun (const Handle (BRepMesh_DataStructureOfDelaun)& theOldMesh,
|
||||
BRepMesh::Array1OfInteger& theVertexIndices,
|
||||
const Standard_Integer theCellsCountU,
|
||||
const Standard_Integer theCellsCountV);
|
||||
|
||||
//! Initializes the triangulation with an array of vertices.
|
||||
Standard_EXPORT void Init (BRepMesh::Array1OfVertexOfDelaun& theVertices);
|
||||
|
||||
@@ -144,12 +150,15 @@ private:
|
||||
//! that have number of connected elements less or equal 1.
|
||||
BRepMesh::HMapOfInteger getEdgesByType (const BRepMesh_DegreeOfFreedom theEdgeType) const;
|
||||
|
||||
//! Create super mesh and run triangulation procedure.
|
||||
void perform (Bnd_Box2d& theBndBox,
|
||||
BRepMesh::Array1OfInteger& theVertexIndices);
|
||||
//! Run triangulation procedure.
|
||||
void perform (BRepMesh::Array1OfInteger& theVertexIndices,
|
||||
const Standard_Integer theCellsCountU = -1,
|
||||
const Standard_Integer theCellsCountV = -1);
|
||||
|
||||
//! Build the super mesh.
|
||||
void superMesh (const Bnd_Box2d& theBox);
|
||||
void superMesh (const Bnd_Box2d& theBox,
|
||||
const Standard_Integer theCellsCountU,
|
||||
const Standard_Integer theCellsCountV);
|
||||
|
||||
//! Computes the triangulation and adds the vertices,
|
||||
//! edges and triangles to the Mesh data structure.
|
||||
|
@@ -23,6 +23,7 @@
|
||||
#include <BRepAdaptor_HSurface.hxx>
|
||||
#include <BRepAdaptor_Curve.hxx>
|
||||
#include <Adaptor3d_IsoCurve.hxx>
|
||||
#include <Adaptor3d_HCurve.hxx>
|
||||
|
||||
#include <BRep_ListIteratorOfListOfPointRepresentation.hxx>
|
||||
#include <BRep_PointRepresentation.hxx>
|
||||
@@ -162,6 +163,119 @@ namespace
|
||||
private:
|
||||
const TopoDS_Vertex& myVertex;
|
||||
};
|
||||
|
||||
void ComputeErrFactors (const Standard_Real theDeflection,
|
||||
const Handle(Adaptor3d_HSurface)& theFace,
|
||||
Standard_Real& theErrFactorU,
|
||||
Standard_Real& theErrFactorV)
|
||||
{
|
||||
theErrFactorU = theDeflection * 10.;
|
||||
theErrFactorV = theDeflection * 10.;
|
||||
|
||||
switch (theFace->GetType ())
|
||||
{
|
||||
case GeomAbs_Cylinder:
|
||||
case GeomAbs_Cone:
|
||||
case GeomAbs_Sphere:
|
||||
case GeomAbs_Torus:
|
||||
break;
|
||||
|
||||
case GeomAbs_SurfaceOfExtrusion:
|
||||
case GeomAbs_SurfaceOfRevolution:
|
||||
{
|
||||
Handle (Adaptor3d_HCurve) aCurve = theFace->BasisCurve ();
|
||||
if (aCurve->GetType () == GeomAbs_BSplineCurve && aCurve->Degree () > 2)
|
||||
{
|
||||
theErrFactorV /= (aCurve->Degree () * aCurve->NbKnots ());
|
||||
}
|
||||
break;
|
||||
}
|
||||
case GeomAbs_BezierSurface:
|
||||
{
|
||||
if (theFace->UDegree () > 2)
|
||||
{
|
||||
theErrFactorU /= (theFace->UDegree ());
|
||||
}
|
||||
if (theFace->VDegree () > 2)
|
||||
{
|
||||
theErrFactorV /= (theFace->VDegree ());
|
||||
}
|
||||
break;
|
||||
}
|
||||
case GeomAbs_BSplineSurface:
|
||||
{
|
||||
if (theFace->UDegree () > 2)
|
||||
{
|
||||
theErrFactorU /= (theFace->UDegree () * theFace->NbUKnots ());
|
||||
}
|
||||
if (theFace->VDegree () > 2)
|
||||
{
|
||||
theErrFactorV /= (theFace->VDegree () * theFace->NbVKnots ());
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case GeomAbs_Plane:
|
||||
default:
|
||||
theErrFactorU = theErrFactorV = 1.;
|
||||
}
|
||||
}
|
||||
|
||||
void AdjustCellsCounts (const Handle(Adaptor3d_HSurface)& theFace,
|
||||
const Standard_Integer theNbVertices,
|
||||
Standard_Integer& theCellsCountU,
|
||||
Standard_Integer& theCellsCountV)
|
||||
{
|
||||
const GeomAbs_SurfaceType aType = theFace->GetType ();
|
||||
if (aType == GeomAbs_OtherSurface)
|
||||
{
|
||||
// fallback to the default behavior
|
||||
theCellsCountU = theCellsCountV = -1;
|
||||
return;
|
||||
}
|
||||
|
||||
Standard_Real aSqNbVert = theNbVertices;
|
||||
if (aType == GeomAbs_Plane)
|
||||
{
|
||||
theCellsCountU = theCellsCountV = (Standard_Integer)Ceiling (Pow (2, Log10 (aSqNbVert)));
|
||||
}
|
||||
else if (aType == GeomAbs_Cylinder || aType == GeomAbs_Cone)
|
||||
{
|
||||
theCellsCountV = (Standard_Integer)Ceiling (Pow (2, Log10 (aSqNbVert)));
|
||||
}
|
||||
else if (aType == GeomAbs_SurfaceOfExtrusion || aType == GeomAbs_SurfaceOfRevolution)
|
||||
{
|
||||
Handle (Adaptor3d_HCurve) aCurve = theFace->BasisCurve ();
|
||||
if (aCurve->GetType () == GeomAbs_Line ||
|
||||
(aCurve->GetType () == GeomAbs_BSplineCurve && aCurve->Degree () < 2))
|
||||
{
|
||||
// planar, cylindrical, conical cases
|
||||
if (aType == GeomAbs_SurfaceOfExtrusion)
|
||||
theCellsCountU = (Standard_Integer)Ceiling (Pow (2, Log10 (aSqNbVert)));
|
||||
else
|
||||
theCellsCountV = (Standard_Integer)Ceiling (Pow (2, Log10 (aSqNbVert)));
|
||||
}
|
||||
if (aType == GeomAbs_SurfaceOfExtrusion)
|
||||
{
|
||||
// V is always a line
|
||||
theCellsCountV = (Standard_Integer)Ceiling (Pow (2, Log10 (aSqNbVert)));
|
||||
}
|
||||
}
|
||||
else if (aType == GeomAbs_BezierSurface || aType == GeomAbs_BSplineSurface)
|
||||
{
|
||||
if (theFace->UDegree () < 2)
|
||||
{
|
||||
theCellsCountU = (Standard_Integer)Ceiling (Pow (2, Log10 (aSqNbVert)));
|
||||
}
|
||||
if (theFace->VDegree () < 2)
|
||||
{
|
||||
theCellsCountV = (Standard_Integer)Ceiling (Pow (2, Log10 (aSqNbVert)));
|
||||
}
|
||||
}
|
||||
|
||||
theCellsCountU = Max (theCellsCountU, 2);
|
||||
theCellsCountV = Max (theCellsCountV, 2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -359,7 +473,56 @@ void BRepMesh_FastDiscretFace::add(const Handle(BRepMesh_FaceAttribute)& theAttr
|
||||
for ( Standard_Integer i = 1; i <= nbVertices; ++i )
|
||||
tabvert_corr(i) = i;
|
||||
|
||||
BRepMesh_Delaun trigu(myStructure, tabvert_corr);
|
||||
Handle (Adaptor3d_HSurface) aSurface (myAttribute->Surface ());
|
||||
GeomAbs_SurfaceType aType = aSurface->GetType ();
|
||||
|
||||
while (aType == GeomAbs_OffsetSurface)
|
||||
{
|
||||
aSurface = aSurface->BasisSurface ();
|
||||
aType = aSurface->GetType ();
|
||||
}
|
||||
|
||||
// For better meshing performance we try to estimate the acceleration circles grid structure sizes:
|
||||
// For each parametric direction (U, V) we estimate firstly an approximate distance between the future points -
|
||||
// this estimation takes into account the required face deflection and the complexity of the face.
|
||||
// Particularly, the complexity of the faces based on BSpline curves and surfaces requires much more points.
|
||||
// At the same time, for planar faces and linear parts of the arbitrary surfaces usually no intermediate points
|
||||
// are necessary.
|
||||
// The general idea for each parametric direction:
|
||||
// cells_count = 2 ^ log10 ( estimated_points_count )
|
||||
// For linear parametric direction we fall back to the initial vertex count:
|
||||
// cells_count = 2 ^ log10 ( initial_vertex_count )
|
||||
|
||||
Standard_Real anErrFactorU, anErrFactorV;
|
||||
ComputeErrFactors(myAttribute->GetDefFace (), aSurface, anErrFactorU, anErrFactorV);
|
||||
|
||||
Standard_Integer aCellsCountU, aCellsCountV;
|
||||
if (aType == GeomAbs_Torus)
|
||||
{
|
||||
aCellsCountU = (Standard_Integer)Ceiling(Pow(2, Log10(
|
||||
(myAttribute->GetUMax() - myAttribute->GetUMin()) / myAttribute->GetDeltaX())));
|
||||
aCellsCountV = (Standard_Integer)Ceiling(Pow(2, Log10(
|
||||
(myAttribute->GetVMax() - myAttribute->GetVMin()) / myAttribute->GetDeltaY())));
|
||||
}
|
||||
else if (aType == GeomAbs_Cylinder)
|
||||
{
|
||||
aCellsCountU = (Standard_Integer)Ceiling(Pow(2, Log10(
|
||||
(myAttribute->GetUMax() - myAttribute->GetUMin()) / myAttribute->GetDeltaX() /
|
||||
(myAttribute->GetVMax() - myAttribute->GetVMin()))));
|
||||
aCellsCountV = (Standard_Integer)Ceiling(Pow(2, Log10(
|
||||
(myAttribute->GetVMax() - myAttribute->GetVMin()) / anErrFactorV)));
|
||||
}
|
||||
else
|
||||
{
|
||||
aCellsCountU = (Standard_Integer)Ceiling(Pow(2, Log10(
|
||||
(myAttribute->GetUMax() - myAttribute->GetUMin()) / myAttribute->GetDeltaX() / anErrFactorU)));
|
||||
aCellsCountV = (Standard_Integer)Ceiling(Pow(2, Log10(
|
||||
(myAttribute->GetVMax() - myAttribute->GetVMin()) / myAttribute->GetDeltaY() / anErrFactorV)));
|
||||
}
|
||||
|
||||
AdjustCellsCounts(aSurface, nbVertices, aCellsCountU, aCellsCountV);
|
||||
|
||||
BRepMesh_Delaun trigu(myStructure, tabvert_corr, aCellsCountU, aCellsCountV);
|
||||
|
||||
//removed all free edges from triangulation
|
||||
const Standard_Integer nbLinks = myStructure->NbLinks();
|
||||
@@ -376,16 +539,13 @@ void BRepMesh_FastDiscretFace::add(const Handle(BRepMesh_FaceAttribute)& theAttr
|
||||
}
|
||||
}
|
||||
|
||||
const Handle(BRepAdaptor_HSurface)& gFace = myAttribute->Surface();
|
||||
GeomAbs_SurfaceType thetype = gFace->GetType();
|
||||
|
||||
Standard_Boolean rajout =
|
||||
(thetype == GeomAbs_Sphere || thetype == GeomAbs_Torus);
|
||||
(aType == GeomAbs_Sphere || aType == GeomAbs_Torus);
|
||||
|
||||
// Check the necessity to fill the map of parameters
|
||||
const Standard_Boolean useUVParam = (thetype == GeomAbs_Torus ||
|
||||
thetype == GeomAbs_BezierSurface ||
|
||||
thetype == GeomAbs_BSplineSurface);
|
||||
const Standard_Boolean useUVParam = (aType == GeomAbs_Torus ||
|
||||
aType == GeomAbs_BezierSurface ||
|
||||
aType == GeomAbs_BSplineSurface);
|
||||
|
||||
const Standard_Real umax = myAttribute->GetUMax();
|
||||
const Standard_Real umin = myAttribute->GetUMin();
|
||||
@@ -405,12 +565,12 @@ void BRepMesh_FastDiscretFace::add(const Handle(BRepMesh_FaceAttribute)& theAttr
|
||||
aDef = control(trigu, Standard_True);
|
||||
rajout = (aDef > myAttribute->GetDefFace() || aDef < 0.);
|
||||
}
|
||||
if (thetype != GeomAbs_Plane)
|
||||
if (aType != GeomAbs_Plane)
|
||||
{
|
||||
if (!rajout && useUVParam)
|
||||
{
|
||||
rajout = (myVParam.Extent() > 2 &&
|
||||
(gFace->IsUClosed() || gFace->IsVClosed()));
|
||||
(aSurface->IsUClosed() || aSurface->IsVClosed()));
|
||||
}
|
||||
|
||||
if (rajout)
|
||||
|
@@ -45,6 +45,8 @@
|
||||
#include <TopTools_IndexedMapOfShape.hxx>
|
||||
#include <TopExp.hxx>
|
||||
|
||||
Standard_DISABLE_DEPRECATION_WARNINGS
|
||||
|
||||
//=======================================================================
|
||||
// topop
|
||||
//=======================================================================
|
||||
@@ -154,6 +156,8 @@ static Standard_Integer psection(Draw_Interpretor& , Standard_Integer n, const c
|
||||
return 0;
|
||||
}
|
||||
|
||||
Standard_ENABLE_DEPRECATION_WARNINGS
|
||||
|
||||
static Standard_Integer halfspace(Draw_Interpretor& di,
|
||||
Standard_Integer n, const char** a)
|
||||
{
|
||||
|
@@ -19,7 +19,8 @@
|
||||
#include <BndLib_Add2dCurve.hxx>
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <BRep_CurveRepresentation.hxx>
|
||||
#include <BRep_ListIteratorOfListOfCurveRepresentation.hxx>
|
||||
#include <BRep_GCurve.hxx>
|
||||
#include <BRep_ListOfCurveRepresentation.hxx>
|
||||
#include <BRep_TEdge.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BRepTools.hxx>
|
||||
@@ -548,132 +549,45 @@ void BRepTools::Update(const TopoDS_Shape& S)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : UpdateFaceUVPoints
|
||||
//purpose : reset the UV points of a Face
|
||||
//purpose : Reset the UV points of edges on the Face
|
||||
//=======================================================================
|
||||
|
||||
void BRepTools::UpdateFaceUVPoints(const TopoDS_Face& F)
|
||||
void BRepTools::UpdateFaceUVPoints(const TopoDS_Face& theF)
|
||||
{
|
||||
// Recompute for each edge the two UV points in order to have the same
|
||||
// UV point on connected edges.
|
||||
// For each edge of the face <F> reset the UV points to the bounding
|
||||
// points of the parametric curve of the edge on the face.
|
||||
|
||||
// First edge loop, store the vertices in a Map with their 2d points
|
||||
|
||||
BRepTools_MapOfVertexPnt2d theVertices;
|
||||
TopoDS_Iterator expE,expV;
|
||||
TopoDS_Iterator EdgeIt,VertIt;
|
||||
TColStd_SequenceOfReal aFSeq, aLSeq;
|
||||
TColGeom2d_SequenceOfCurve aCSeq;
|
||||
TopTools_SequenceOfShape aShSeq;
|
||||
gp_Pnt2d P;
|
||||
Standard_Integer i;
|
||||
// a 3d tolerance for UV !!
|
||||
Standard_Real tolerance = BRep_Tool::Tolerance(F);
|
||||
TColgp_SequenceOfPnt2d emptySequence;
|
||||
|
||||
for (expE.Initialize(F); expE.More(); expE.Next()) {
|
||||
if(expE.Value().ShapeType() != TopAbs_WIRE)
|
||||
continue;
|
||||
|
||||
EdgeIt.Initialize(expE.Value());
|
||||
for( ; EdgeIt.More(); EdgeIt.Next())
|
||||
{
|
||||
const TopoDS_Edge& E = TopoDS::Edge(EdgeIt.Value());
|
||||
Standard_Real f,l;
|
||||
Handle(Geom2d_Curve) C = BRep_Tool::CurveOnSurface(E,F,f,l);
|
||||
|
||||
aFSeq.Append(f);
|
||||
aLSeq.Append(l);
|
||||
aCSeq.Append(C);
|
||||
aShSeq.Append(E);
|
||||
|
||||
if (C.IsNull()) continue;
|
||||
|
||||
for (expV.Initialize(E.Oriented(TopAbs_FORWARD));
|
||||
expV.More(); expV.Next()) {
|
||||
|
||||
const TopoDS_Vertex& V = TopoDS::Vertex(expV.Value());
|
||||
|
||||
TopAbs_Orientation Vori = V.Orientation();
|
||||
if ( Vori == TopAbs_INTERNAL ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Standard_Real p = BRep_Tool::Parameter(V,E,F);
|
||||
C->D0(p,P);
|
||||
if (!theVertices.IsBound(V))
|
||||
theVertices.Bind(V,emptySequence);
|
||||
TColgp_SequenceOfPnt2d& S = theVertices(V);
|
||||
for (i = 1; i <= S.Length(); i++) {
|
||||
if (P.Distance(S(i)) < tolerance) break;
|
||||
}
|
||||
if (i > S.Length())
|
||||
S.Append(P);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// second edge loop, update the edges 2d points
|
||||
TopoDS_Vertex Vf,Vl;
|
||||
gp_Pnt2d Pf,Pl;
|
||||
|
||||
for(Standard_Integer j = 1; j <= aShSeq.Length(); j++)
|
||||
// Get surface of the face
|
||||
TopLoc_Location aLoc;
|
||||
const Handle(Geom_Surface)& aSurf = BRep_Tool::Surface(theF, aLoc);
|
||||
// Iterate on edges and reset UV points
|
||||
TopExp_Explorer anExpE(theF, TopAbs_EDGE);
|
||||
for (; anExpE.More(); anExpE.Next())
|
||||
{
|
||||
const TopoDS_Edge& E = TopoDS::Edge(aShSeq.Value(j));
|
||||
const Handle(Geom2d_Curve)& C = aCSeq.Value(j);
|
||||
if (C.IsNull()) continue;
|
||||
|
||||
TopExp::Vertices(E,Vf,Vl);
|
||||
if (Vf.IsNull()) {
|
||||
Pf.SetCoord(RealLast(),RealLast());
|
||||
}
|
||||
else {
|
||||
if ( Vf.Orientation() == TopAbs_INTERNAL ) {
|
||||
continue;
|
||||
}
|
||||
const TColgp_SequenceOfPnt2d& seqf = theVertices(Vf);
|
||||
if (seqf.Length() == 1)
|
||||
Pf = seqf(1);
|
||||
else {
|
||||
C->D0(aFSeq.Value(j),Pf);
|
||||
for (i = 1; i <= seqf.Length(); i++) {
|
||||
if (Pf.Distance(seqf(i)) <= tolerance) {
|
||||
Pf = seqf(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Vl.IsNull()) {
|
||||
Pl.SetCoord(RealLast(),RealLast());
|
||||
}
|
||||
else {
|
||||
if ( Vl.Orientation() == TopAbs_INTERNAL ) {
|
||||
continue;
|
||||
}
|
||||
const TColgp_SequenceOfPnt2d& seql = theVertices(Vl);
|
||||
if (seql.Length() == 1)
|
||||
Pl = seql(1);
|
||||
else {
|
||||
C->D0(aLSeq.Value(j),Pl);
|
||||
for (i = 1; i <= seql.Length(); i++) {
|
||||
if (Pl.Distance(seql(i)) <= tolerance) {
|
||||
Pl = seql(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
const TopoDS_Edge& aE = TopoDS::Edge(anExpE.Current());
|
||||
|
||||
// set the correct points
|
||||
BRep_Tool::SetUVPoints(E,F,Pf,Pl);
|
||||
const Handle(BRep_TEdge)& TE = *((Handle(BRep_TEdge)*)&aE.TShape());
|
||||
if (TE->Locked())
|
||||
return;
|
||||
|
||||
const TopLoc_Location aELoc = aLoc.Predivided(aE.Location());
|
||||
// Edge representations
|
||||
BRep_ListOfCurveRepresentation& aLCR = TE->ChangeCurves();
|
||||
BRep_ListIteratorOfListOfCurveRepresentation itLCR(aLCR);
|
||||
for (; itLCR.More(); itLCR.Next())
|
||||
{
|
||||
Handle(BRep_GCurve) GC = Handle(BRep_GCurve)::DownCast(itLCR.Value());
|
||||
if (!GC.IsNull() && GC->IsCurveOnSurface(aSurf, aELoc))
|
||||
{
|
||||
// Update UV points
|
||||
GC->Update();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Compare
|
||||
//purpose :
|
||||
|
@@ -73,10 +73,8 @@ class Geom_Surface;
|
||||
//! * Update : Methods to call when a topology has
|
||||
//! been created to compute all missing data.
|
||||
//!
|
||||
//! * UpdateFaceUVPoints : Method to update the UV
|
||||
//! points stored with the edges on a face. This
|
||||
//! method ensure that connected edges have the same
|
||||
//! UV point on their common extremity.
|
||||
//! * UpdateFaceUVPoints: Method to update the UV points
|
||||
//! stored with the edges on a face.
|
||||
//!
|
||||
//! * Compare : Method to compare two vertices.
|
||||
//!
|
||||
@@ -147,10 +145,10 @@ public:
|
||||
//! Update a shape, call the corect update.
|
||||
Standard_EXPORT static void Update (const TopoDS_Shape& S);
|
||||
|
||||
//! For all the edges of the face <F> reset the UV
|
||||
//! points to ensure that connected faces have the
|
||||
//! same point at there common extremity.
|
||||
Standard_EXPORT static void UpdateFaceUVPoints (const TopoDS_Face& F);
|
||||
//! For each edge of the face <F> reset the UV points
|
||||
//! to the bounding points of the parametric curve of the
|
||||
//! edge on the face.
|
||||
Standard_EXPORT static void UpdateFaceUVPoints (const TopoDS_Face& theF);
|
||||
|
||||
//! Removes all the triangulations of the faces of <S>
|
||||
//! and removes all polygons on triangulations of the
|
||||
|
@@ -358,8 +358,24 @@ Standard_Integer BinLDrivers_DocumentRetrievalDriver::ReadSubTree
|
||||
tAtt = Handle(TDF_Attribute)::DownCast(myRelocTable.Find(anID));
|
||||
else
|
||||
tAtt = aDriver->NewEmpty();
|
||||
|
||||
if (tAtt->Label().IsNull())
|
||||
theLabel.AddAttribute (tAtt);
|
||||
{
|
||||
try
|
||||
{
|
||||
theLabel.AddAttribute (tAtt);
|
||||
}
|
||||
catch (const Standard_DomainError&)
|
||||
{
|
||||
// For attributes that can have arbitrary GUID (e.g. TDataStd_Integer), exception
|
||||
// will be raised in valid case if attribute of that type with default GUID is already
|
||||
// present on the same label; the reason is that actual GUID will be read later.
|
||||
// To avoid this, set invalid (null) GUID to the newly added attribute (see #29669)
|
||||
static const Standard_GUID fbidGuid;
|
||||
tAtt->SetID (fbidGuid);
|
||||
theLabel.AddAttribute (tAtt);
|
||||
}
|
||||
}
|
||||
else
|
||||
myMsgDriver->Send (aMethStr +
|
||||
"warning: attempt to attach attribute " +
|
||||
|
@@ -34,6 +34,9 @@ class BinMXCAFDoc_GeomToleranceDriver;
|
||||
class BinMXCAFDoc_DimensionDriver;
|
||||
class BinMXCAFDoc_DimTolDriver;
|
||||
class BinMXCAFDoc_MaterialDriver;
|
||||
class BinMXCAFDoc_NoteCommentDriver;
|
||||
class BinMXCAFDoc_NoteBinDataDriver;
|
||||
class BinMXCAFDoc_NotesToolDriver;
|
||||
class BinMXCAFDoc_ColorToolDriver;
|
||||
class BinMXCAFDoc_DocumentToolDriver;
|
||||
class BinMXCAFDoc_LayerToolDriver;
|
||||
@@ -42,6 +45,9 @@ class BinMXCAFDoc_DimTolToolDriver;
|
||||
class BinMXCAFDoc_MaterialToolDriver;
|
||||
class BinMXCAFDoc_ViewDriver;
|
||||
class BinMXCAFDoc_ViewToolDriver;
|
||||
class BinMXCAFDoc_AnimationDriver;
|
||||
class BinMXCAFDoc_AnimationToolDriver;
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -89,6 +95,9 @@ friend class BinMXCAFDoc_DimTolToolDriver;
|
||||
friend class BinMXCAFDoc_MaterialToolDriver;
|
||||
friend class BinMXCAFDoc_ViewDriver;
|
||||
friend class BinMXCAFDoc_ViewToolDriver;
|
||||
friend class BinMXCAFDoc_AnimationDriver;
|
||||
friend class BinMXCAFDoc_AnimationToolDriver;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
111
src/BinMXCAFDoc/BinMXCAFDoc_AnimationDriver.cxx
Normal file
@@ -0,0 +1,111 @@
|
||||
// Created on: 2017-10-02
|
||||
// Created by: Elena MOZOKHINA
|
||||
// Copyright (c) 2016 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
|
||||
#include <BinMXCAFDoc_AnimationDriver.hxx>
|
||||
#include <BinObjMgt_Persistent.hxx>
|
||||
#include <Message_Messenger.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TCollection_HAsciiString.hxx>
|
||||
#include <TDF_Attribute.hxx>
|
||||
#include <XCAFDoc_Animation.hxx>
|
||||
# include <TColStd_HArray1OfByte.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(BinMXCAFDoc_AnimationDriver,BinMDF_ADriver)
|
||||
|
||||
static Standard_Boolean getByteArray(const BinObjMgt_Persistent& theSource, Handle(TColStd_HArray1OfByte)& theArray)
|
||||
{
|
||||
Standard_Integer aFirstInd, aLastInd;
|
||||
if (!(theSource >> aFirstInd >> aLastInd))
|
||||
return Standard_False;
|
||||
if (aLastInd < aFirstInd)
|
||||
return Standard_False;
|
||||
|
||||
theArray.reset(new TColStd_HArray1OfByte(aFirstInd, aLastInd - aFirstInd + 1));
|
||||
theSource.GetByteArray(&theArray->ChangeFirst(), aLastInd - aFirstInd + 1);
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
static void putByteArray(BinObjMgt_Persistent& theTarget, const Handle(TColStd_HArray1OfByte)& theArray)
|
||||
{
|
||||
if (theArray.IsNull())
|
||||
return;
|
||||
const Standard_Integer aFirstInd = theArray->Lower();
|
||||
const Standard_Integer aLastInd = theArray->Upper();
|
||||
if (aLastInd < aFirstInd)
|
||||
return;
|
||||
|
||||
theTarget << aFirstInd << aLastInd;
|
||||
theTarget.PutByteArray(&theArray->ChangeFirst(), aLastInd - aFirstInd + 1);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Constructor
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
BinMXCAFDoc_AnimationDriver::BinMXCAFDoc_AnimationDriver
|
||||
(const Handle(Message_Messenger)& theMsgDriver)
|
||||
: BinMDF_ADriver(theMsgDriver, STANDARD_TYPE(XCAFDoc_Animation)->Name())
|
||||
{
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : NewEmpty
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Handle(TDF_Attribute) BinMXCAFDoc_AnimationDriver::NewEmpty() const
|
||||
{
|
||||
return new XCAFDoc_Animation();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Paste
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean BinMXCAFDoc_AnimationDriver::Paste(const BinObjMgt_Persistent& theSource,
|
||||
const Handle(TDF_Attribute)& theTarget,
|
||||
BinObjMgt_RRelocationTable& /*theRelocTable*/) const
|
||||
{
|
||||
Handle(XCAFDoc_Animation) anAtt = Handle(XCAFDoc_Animation)::DownCast(theTarget);
|
||||
TCollection_AsciiString aName;
|
||||
|
||||
if (!(theSource >> aName))
|
||||
return Standard_False;
|
||||
Handle(TColStd_HArray1OfByte) anImage, anAnimation;
|
||||
if (!getByteArray(theSource, anImage) || anImage.IsNull())
|
||||
return Standard_False;
|
||||
if (!getByteArray(theSource, anAnimation) || anAnimation.IsNull())
|
||||
return Standard_False;
|
||||
anAtt->Set(new TCollection_HAsciiString(aName), anImage, anAnimation);
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Paste
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BinMXCAFDoc_AnimationDriver::Paste(const Handle(TDF_Attribute)& theSource,
|
||||
BinObjMgt_Persistent& theTarget,
|
||||
BinObjMgt_SRelocationTable& /*theRelocTable*/) const
|
||||
{
|
||||
Handle(XCAFDoc_Animation) anAtt = Handle(XCAFDoc_Animation)::DownCast(theSource);
|
||||
Handle(TCollection_HAsciiString) aName = anAtt->GetName();
|
||||
if (!aName.IsNull())
|
||||
theTarget << aName->String();
|
||||
|
||||
putByteArray(theTarget, anAtt->GetImage());
|
||||
putByteArray(theTarget, anAtt->GetAnimation());
|
||||
}
|
72
src/BinMXCAFDoc/BinMXCAFDoc_AnimationDriver.hxx
Normal file
@@ -0,0 +1,72 @@
|
||||
// Created on: 2017-10-02
|
||||
// Created by: Elena MOZOKHINA
|
||||
// Copyright (c) 2016 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _BinMXCAFDoc_AnimationDriver_HeaderFile
|
||||
#define _BinMXCAFDoc_AnimationDriver_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <BinMDF_ADriver.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <BinObjMgt_RRelocationTable.hxx>
|
||||
#include <BinObjMgt_SRelocationTable.hxx>
|
||||
class Message_Messenger;
|
||||
class TDF_Attribute;
|
||||
class BinObjMgt_Persistent;
|
||||
|
||||
|
||||
class BinMXCAFDoc_AnimationDriver;
|
||||
DEFINE_STANDARD_HANDLE(BinMXCAFDoc_AnimationDriver, BinMDF_ADriver)
|
||||
|
||||
|
||||
class BinMXCAFDoc_AnimationDriver : public BinMDF_ADriver
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
Standard_EXPORT BinMXCAFDoc_AnimationDriver(const Handle(Message_Messenger)& theMsgDriver);
|
||||
|
||||
Standard_EXPORT virtual Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT virtual Standard_Boolean Paste (const BinObjMgt_Persistent& theSource, const Handle(TDF_Attribute)& theTarget, BinObjMgt_RRelocationTable& theRelocTable) const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT virtual void Paste (const Handle(TDF_Attribute)& theSource, BinObjMgt_Persistent& theTarget, BinObjMgt_SRelocationTable& theRelocTable) const Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(BinMXCAFDoc_AnimationDriver,BinMDF_ADriver)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _BinMXCAFDoc_AnimationDriver_HeaderFile
|
65
src/BinMXCAFDoc/BinMXCAFDoc_AnimationToolDriver.cxx
Normal file
@@ -0,0 +1,65 @@
|
||||
// Created on: 2017-10-02
|
||||
// Created by: Elena MOZOKHINA
|
||||
// Copyright (c) 2016 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
|
||||
#include <BinMXCAFDoc_AnimationToolDriver.hxx>
|
||||
#include <BinObjMgt_Persistent.hxx>
|
||||
#include <Message_Messenger.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TDF_Attribute.hxx>
|
||||
#include <XCAFDoc_AnimationTool.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(BinMXCAFDoc_AnimationToolDriver, BinMDF_ADriver)
|
||||
|
||||
//=======================================================================
|
||||
//function :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
BinMXCAFDoc_AnimationToolDriver::BinMXCAFDoc_AnimationToolDriver
|
||||
(const Handle(Message_Messenger)& theMsgDriver)
|
||||
: BinMDF_ADriver(theMsgDriver, STANDARD_TYPE(XCAFDoc_AnimationTool)->Name())
|
||||
{
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Handle(TDF_Attribute) BinMXCAFDoc_AnimationToolDriver::NewEmpty() const
|
||||
{
|
||||
return new XCAFDoc_AnimationTool();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean BinMXCAFDoc_AnimationToolDriver::Paste
|
||||
(const BinObjMgt_Persistent& /*theSource*/,
|
||||
const Handle(TDF_Attribute)& /*theTarget*/,
|
||||
BinObjMgt_RRelocationTable& /*theRelocTable*/) const
|
||||
{
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BinMXCAFDoc_AnimationToolDriver::Paste
|
||||
(const Handle(TDF_Attribute)& /*theSource*/,
|
||||
BinObjMgt_Persistent& /*theTarget*/,
|
||||
BinObjMgt_SRelocationTable& /*theRelocTable*/) const {
|
||||
}
|
50
src/BinMXCAFDoc/BinMXCAFDoc_AnimationToolDriver.hxx
Normal file
@@ -0,0 +1,50 @@
|
||||
// Created on: 2017-10-02
|
||||
// Created by: Elena MOZOKHINA
|
||||
// Copyright (c) 2016 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _BinMXCAFDoc_AnimationToolDriver_HeaderFile
|
||||
#define _BinMXCAFDoc_AnimationToolDriver_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <BinMDF_ADriver.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <BinObjMgt_RRelocationTable.hxx>
|
||||
#include <BinObjMgt_SRelocationTable.hxx>
|
||||
class Message_Messenger;
|
||||
class TDF_Attribute;
|
||||
class BinObjMgt_Persistent;
|
||||
|
||||
|
||||
class BinMXCAFDoc_AnimationToolDriver;
|
||||
DEFINE_STANDARD_HANDLE(BinMXCAFDoc_AnimationToolDriver, BinMDF_ADriver)
|
||||
|
||||
|
||||
class BinMXCAFDoc_AnimationToolDriver : public BinMDF_ADriver
|
||||
{
|
||||
public:
|
||||
|
||||
Standard_EXPORT BinMXCAFDoc_AnimationToolDriver(const Handle(Message_Messenger)& theMsgDriver);
|
||||
|
||||
Standard_EXPORT virtual Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT virtual Standard_Boolean Paste(const BinObjMgt_Persistent& theSource, const Handle(TDF_Attribute)& theTarget, BinObjMgt_RRelocationTable& theRelocTable) const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT virtual void Paste(const Handle(TDF_Attribute)& theSource, BinObjMgt_Persistent& theTarget, BinObjMgt_SRelocationTable& theRelocTable) const Standard_OVERRIDE;
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(BinMXCAFDoc_AnimationToolDriver, BinMDF_ADriver)
|
||||
|
||||
};
|
||||
#endif // _BinMXCAFDoc_AnimationToolDriver_HeaderFile
|
@@ -53,3 +53,7 @@ BinMXCAFDoc_ViewToolDriver.cxx
|
||||
BinMXCAFDoc_ViewToolDriver.hxx
|
||||
BinMXCAFDoc_VolumeDriver.cxx
|
||||
BinMXCAFDoc_VolumeDriver.hxx
|
||||
BinMXCAFDoc_AnimationDriver.cxx
|
||||
BinMXCAFDoc_AnimationDriver.hxx
|
||||
BinMXCAFDoc_AnimationToolDriver.cxx
|
||||
BinMXCAFDoc_AnimationToolDriver.hxx
|
||||
|
@@ -74,8 +74,8 @@ static Standard_OStream& operator <<(Standard_OStream& OS, const gp_Pnt P)
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
BinTools_ShapeSet::BinTools_ShapeSet(const Standard_Boolean isWithTriangles)
|
||||
:myFormatNb(3), myWithTriangles(isWithTriangles)
|
||||
BinTools_ShapeSet::BinTools_ShapeSet(const Standard_Boolean /*isWithTriangles*/)
|
||||
:myFormatNb(3), myWithTriangles(Standard_True/*isWithTriangles*/)
|
||||
{}
|
||||
|
||||
//=======================================================================
|
||||
@@ -517,6 +517,12 @@ void BinTools_ShapeSet::Read(TopoDS_Shape& S, Standard_IStream& IS,
|
||||
anOrient = (TopAbs_Orientation)aChar;
|
||||
Standard_Integer anIndx;
|
||||
BinTools::GetInteger(IS, anIndx);
|
||||
Standard_Integer anInd = nbshapes - anIndx + 1;
|
||||
if (anInd < 1 || anInd > myShapes.Extent())
|
||||
{
|
||||
S = TopoDS_Shape();
|
||||
return;
|
||||
}
|
||||
S = myShapes(nbshapes - anIndx + 1);
|
||||
S.Orientation(anOrient);
|
||||
|
||||
|
@@ -95,6 +95,8 @@ Standard_Integer BinTools_SurfaceSet::Add(const Handle(Geom_Surface)& S)
|
||||
Handle(Geom_Surface) BinTools_SurfaceSet::Surface
|
||||
(const Standard_Integer I)const
|
||||
{
|
||||
if (I < 1 || I > myMap.Extent())
|
||||
return Handle(Geom_Surface)();
|
||||
return Handle(Geom_Surface)::DownCast(myMap(I));
|
||||
}
|
||||
|
||||
|
@@ -23,8 +23,6 @@
|
||||
#include <ElCLib.hxx>
|
||||
#include <ElSLib.hxx>
|
||||
#include <Extrema_ExtCS.hxx>
|
||||
#include <Extrema_ExtPElC.hxx>
|
||||
#include <Extrema_ExtPElS.hxx>
|
||||
#include <Extrema_ExtPS.hxx>
|
||||
#include <Extrema_GenExtCS.hxx>
|
||||
#include <Extrema_POnCurv.hxx>
|
||||
@@ -147,53 +145,34 @@ void Extrema_ExtCS::Perform(const Adaptor3d_Curve& C,
|
||||
Standard_Real ufirst = myS->FirstUParameter(), ulast = myS->LastUParameter(),
|
||||
vfirst = myS->FirstVParameter(), vlast = myS->LastVParameter();
|
||||
|
||||
if(Precision::IsInfinite(Abs(cfirst)) || Precision::IsInfinite(Abs(clast))) {
|
||||
|
||||
if (!(Precision::IsInfinite(ufirst) || Precision::IsInfinite(ulast) ||
|
||||
Precision::IsInfinite(vfirst) || Precision::IsInfinite(vlast)))
|
||||
{
|
||||
Standard_Real tmin = Precision::Infinite(), tmax = -tmin;
|
||||
Standard_Real xmin, ymin, zmin, xmax, ymax, zmax;
|
||||
Bnd_Box aSurfBox;
|
||||
BndLib_AddSurface::Add(*myS, ufirst, ulast, vfirst, vlast, Precision::Confusion(), aSurfBox);
|
||||
Standard_Real xmin, ymin, zmin, xmax, ymax, zmax;
|
||||
aSurfBox.Get(xmin, ymin, zmin, xmax, ymax, zmax);
|
||||
Standard_Real tmin = Precision::Infinite(), tmax = -tmin;
|
||||
gp_Lin aLin = C.Line();
|
||||
Standard_Real aParOnLin;
|
||||
gp_Pnt aLimPntArray[8];
|
||||
|
||||
aLimPntArray[0].SetCoord(xmin, ymin, zmin);
|
||||
aLimPntArray[1].SetCoord(xmax, ymin, zmin);
|
||||
aLimPntArray[2].SetCoord(xmin, ymax, zmin);
|
||||
aLimPntArray[3].SetCoord(xmax, ymax, zmin);
|
||||
aLimPntArray[4].SetCoord(xmin, ymin, zmax);
|
||||
aLimPntArray[5].SetCoord(xmax, ymin, zmax);
|
||||
aLimPntArray[6].SetCoord(xmin, ymax, zmax);
|
||||
aLimPntArray[7].SetCoord(xmax, ymax, zmax);
|
||||
|
||||
if(!( Precision::IsInfinite(Abs(xmin)) || Precision::IsInfinite(Abs(xmax)) ||
|
||||
Precision::IsInfinite(Abs(ymin)) || Precision::IsInfinite(Abs(ymax)) ||
|
||||
Precision::IsInfinite(Abs(zmin)) || Precision::IsInfinite(Abs(zmax))) ) {
|
||||
|
||||
Extrema_ExtPElC anExt;
|
||||
Extrema_POnCurv aPntOnLin;
|
||||
Standard_Real aParOnLin;
|
||||
Standard_Real lim = Precision::Infinite();
|
||||
gp_Pnt aLimPntArray[8];
|
||||
|
||||
aLimPntArray[0].SetCoord(xmin, ymin, zmin);
|
||||
aLimPntArray[1].SetCoord(xmax, ymin, zmin);
|
||||
aLimPntArray[2].SetCoord(xmin, ymax, zmin);
|
||||
aLimPntArray[3].SetCoord(xmax, ymax, zmin);
|
||||
aLimPntArray[4].SetCoord(xmin, ymin, zmax);
|
||||
aLimPntArray[5].SetCoord(xmax, ymin, zmax);
|
||||
aLimPntArray[6].SetCoord(xmin, ymax, zmax);
|
||||
aLimPntArray[7].SetCoord(xmax, ymax, zmax);
|
||||
|
||||
for(i = 0; i <= 7; i++) {
|
||||
anExt.Perform(aLimPntArray[i], aLin, Precision::Confusion(), -lim, lim);
|
||||
aPntOnLin = anExt.Point(1);
|
||||
aParOnLin = aPntOnLin.Parameter();
|
||||
tmin = Min(aParOnLin, tmin);
|
||||
tmax = Max(aParOnLin, tmax);
|
||||
}
|
||||
|
||||
for (i = 0; i <= 7; i++) {
|
||||
aParOnLin = ElCLib::Parameter(aLin, aLimPntArray[i]);
|
||||
tmin = Min(aParOnLin, tmin);
|
||||
tmax = Max(aParOnLin, tmax);
|
||||
}
|
||||
else {
|
||||
tmin = -1.e+50;
|
||||
tmax = 1.e+50;
|
||||
}
|
||||
|
||||
|
||||
cfirst = Max(cfirst, tmin);
|
||||
clast = Min(clast, tmax);
|
||||
|
||||
clast = Min(clast, tmax);
|
||||
}
|
||||
|
||||
if (myS->IsUPeriodic())
|
||||
@@ -219,7 +198,6 @@ void Extrema_ExtCS::Perform(const Adaptor3d_Curve& C,
|
||||
}
|
||||
}
|
||||
return;
|
||||
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@@ -12,6 +12,8 @@ Graphic3d_ArrayOfTriangles.hxx
|
||||
Graphic3d_ArrayOfTriangleStrips.hxx
|
||||
Graphic3d_AspectFillArea3d.cxx
|
||||
Graphic3d_AspectFillArea3d.hxx
|
||||
Graphic3d_AspectFillCapping.cxx
|
||||
Graphic3d_AspectFillCapping.hxx
|
||||
Graphic3d_AspectLine3d.cxx
|
||||
Graphic3d_AspectLine3d.hxx
|
||||
Graphic3d_AspectMarker3d.cxx
|
||||
@@ -30,7 +32,6 @@ Graphic3d_BufferType.hxx
|
||||
Graphic3d_Camera.cxx
|
||||
Graphic3d_Camera.hxx
|
||||
Graphic3d_CameraTile.hxx
|
||||
Graphic3d_CappingFlags.hxx
|
||||
Graphic3d_CLight.cxx
|
||||
Graphic3d_CLight.hxx
|
||||
Graphic3d_ClipPlane.cxx
|
||||
|
110
src/Graphic3d/Graphic3d_AspectFillCapping.cxx
Normal file
@@ -0,0 +1,110 @@
|
||||
// Created on: 2017-04-14
|
||||
// Created by: Anton POLETAEV
|
||||
// Copyright (c) 2017 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Graphic3d_AspectFillCapping.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_AspectFillCapping, Standard_Transient)
|
||||
|
||||
// =======================================================================
|
||||
// function : Graphic3d_AspectFillCapping
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
Graphic3d_AspectFillCapping::Graphic3d_AspectFillCapping()
|
||||
: myFlags (Flags_None),
|
||||
myHatchingState (0)
|
||||
{
|
||||
Graphic3d_MaterialAspect aMaterial;
|
||||
aMaterial.SetColor (Quantity_NOC_BLACK);
|
||||
aMaterial.SetReflectionModeOff (Graphic3d_TOR_AMBIENT);
|
||||
aMaterial.SetReflectionModeOff (Graphic3d_TOR_DIFFUSE);
|
||||
aMaterial.SetReflectionModeOff (Graphic3d_TOR_SPECULAR);
|
||||
aMaterial.SetReflectionModeOff (Graphic3d_TOR_EMISSION);
|
||||
aMaterial.SetMaterialType (Graphic3d_MATERIAL_ASPECT);
|
||||
SetHatchStyle (Aspect_HS_HORIZONTAL);
|
||||
SetHatchMaterial (aMaterial);
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : SetHatchStyle
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void Graphic3d_AspectFillCapping::SetHatchStyle (const Aspect_HatchStyle theStyle)
|
||||
{
|
||||
myStippleHatch = new Graphic3d_HatchStyle (theStyle);
|
||||
myTextureHatch.Nullify();
|
||||
myHatchingState++;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : SetHatchStyle
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void Graphic3d_AspectFillCapping::SetHatchStyle (const Handle(Graphic3d_HatchStyle)& theStyle)
|
||||
{
|
||||
myStippleHatch = theStyle;
|
||||
myTextureHatch.Nullify();
|
||||
myHatchingState++;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : SetHatchStyle
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void Graphic3d_AspectFillCapping::SetHatchStyle (const Handle(Graphic3d_TextureMap)& theTexture)
|
||||
{
|
||||
myStippleHatch.Nullify();
|
||||
myTextureHatch = theTexture;
|
||||
myHatchingState++;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : SetHatchMaterial
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void Graphic3d_AspectFillCapping::SetHatchMaterial (const Graphic3d_MaterialAspect& theMaterial)
|
||||
{
|
||||
myHatchMaterial = theMaterial;
|
||||
myHatchingState++;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : SetToDrawHatch
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void Graphic3d_AspectFillCapping::SetToDrawHatch (const Standard_Boolean theToDraw)
|
||||
{
|
||||
setFlag (theToDraw, Flags_DrawHatching);
|
||||
myHatchingState++;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : SetHatchZoomPeristent
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void Graphic3d_AspectFillCapping::SetHatchZoomPeristent (const Standard_Boolean theToSet)
|
||||
{
|
||||
setFlag (theToSet, Flags_HatchZoomPersistent);
|
||||
myHatchingState++;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : SetHatchRotationPeristent
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void Graphic3d_AspectFillCapping::SetHatchRotationPeristent (const Standard_Boolean theToSet)
|
||||
{
|
||||
setFlag (theToSet, Flags_HatchRotationPersistent);
|
||||
myHatchingState++;
|
||||
}
|
163
src/Graphic3d/Graphic3d_AspectFillCapping.hxx
Normal file
@@ -0,0 +1,163 @@
|
||||
// Created on: 2017-04-14
|
||||
// Created by: Anton POLETAEV
|
||||
// Copyright (c) 2017 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Graphic3d_AspectFillCapping_HeaderFile
|
||||
#define _Graphic3d_AspectFillCapping_HeaderFile
|
||||
|
||||
#include <Aspect_HatchStyle.hxx>
|
||||
#include <Graphic3d_HatchStyle.hxx>
|
||||
#include <Graphic3d_MaterialAspect.hxx>
|
||||
#include <Graphic3d_ShaderProgram.hxx>
|
||||
#include <Graphic3d_TextureMap.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
|
||||
//! Defines graphical attributes for drawing section planes on solids resulted from clipping (cutting) planes.
|
||||
class Graphic3d_AspectFillCapping : public Standard_Transient
|
||||
{
|
||||
public:
|
||||
|
||||
//! Default constructor.
|
||||
Standard_EXPORT Graphic3d_AspectFillCapping();
|
||||
|
||||
public:
|
||||
|
||||
//! Sets material for filling section created by clipping.
|
||||
void SetMaterial (const Graphic3d_MaterialAspect& theMaterial) { myMaterial = theMaterial; }
|
||||
|
||||
//! Returns material for filling section created by clipping.
|
||||
const Graphic3d_MaterialAspect& Material() const { return myMaterial; }
|
||||
|
||||
//! Sets flag indicating whether object's material (instead of defined by this aspect) should be used for filling section.
|
||||
void SetUseObjectMaterial (const Standard_Boolean theToUse) { setFlag (theToUse, Flags_UseObjectMaterial); }
|
||||
|
||||
//! Returns flag indicating whether object's material (instead of defined by this aspect) should be used for filling section.
|
||||
Standard_Boolean ToUseObjectMaterial() const { return (myFlags & Flags_UseObjectMaterial) != 0; }
|
||||
|
||||
//! Sets texture for filling section created by clipping.
|
||||
void SetTexture (const Handle(Graphic3d_TextureMap)& theTexture) { myTexture = theTexture; }
|
||||
|
||||
//! Returns texture for filling section created by clipping.
|
||||
const Handle(Graphic3d_TextureMap)& Texture() const { return myTexture; }
|
||||
|
||||
//! Sets flag indicating whether object's texture (instead of defined by this aspect) should be used for filling section.
|
||||
void SetUseObjectTexture (const Standard_Boolean theToUse) { setFlag (theToUse, Flags_UseObjectTexture); }
|
||||
|
||||
//! Returns flag indicating whether object's texture (instead of defined by this aspect) should be used for filling section.
|
||||
Standard_Boolean ToUseObjectTexture() const { return (myFlags & Flags_UseObjectTexture) != 0; }
|
||||
|
||||
//! Sets OpenGL/GLSL shader program.
|
||||
void SetShader (const Handle(Graphic3d_ShaderProgram)& theShader) { myShader = theShader; }
|
||||
|
||||
//! Returns OpenGL/GLSL shader program.
|
||||
const Handle(Graphic3d_ShaderProgram)& Shader() const { return myShader; }
|
||||
|
||||
//! Sets flag indicating whether object's shader (instead of defined by this aspect) should be used for filling section.
|
||||
void SetUseObjectShader (const Standard_Boolean theToUse) { setFlag (theToUse, Flags_UseObjectShader); }
|
||||
|
||||
//! Returns flag indicating whether object's shader (instead of defined by this aspect) should be used for filling section.
|
||||
Standard_Boolean ToUseObjectShader() const { return (myFlags & Flags_UseObjectShader) != 0; }
|
||||
|
||||
public:
|
||||
|
||||
//! Sets style of hatch defined by predefined stipple mask.
|
||||
Standard_EXPORT void SetHatchStyle (const Aspect_HatchStyle theStyle);
|
||||
|
||||
//! Sets style of hatch defined by custom stipple mask.
|
||||
Standard_EXPORT void SetHatchStyle (const Handle(Graphic3d_HatchStyle)& theStyle);
|
||||
|
||||
//! Sets style of hatch defined by texture map (decal texture with alpha channel should be used).
|
||||
Standard_EXPORT void SetHatchStyle (const Handle(Graphic3d_TextureMap)& theTexture);
|
||||
|
||||
//! Sets material style for hatch lines (texture).
|
||||
Standard_EXPORT void SetHatchMaterial (const Graphic3d_MaterialAspect& theMaterial);
|
||||
|
||||
//! Returns material style for hatch lines (texture).
|
||||
const Graphic3d_MaterialAspect& HatchMaterial() const { return myHatchMaterial; }
|
||||
|
||||
//! Sets boolean flag indicating whether the hatch layer should be drawn or not.
|
||||
Standard_EXPORT void SetToDrawHatch (const Standard_Boolean theToDraw);
|
||||
|
||||
//! Returns boolean flag indicating whether the hatch layer should be drawn or not.
|
||||
Standard_Boolean ToDrawHatch() const { return (myFlags & Flags_DrawHatching) != 0; }
|
||||
|
||||
//! Sets flag controlling behavior of hatch texture mapping on zooming.
|
||||
//! @param theToSet [in] if passed TRUE the texture will keep constant screen-scale independent of zooming.
|
||||
Standard_EXPORT void SetHatchZoomPeristent (const Standard_Boolean theToSet);
|
||||
|
||||
//! Returns value of flag controlling behavior of hatch texture mapping on zooming.
|
||||
Standard_Boolean IsHatchZoomPersistent() { return (myFlags & Flags_HatchZoomPersistent) != 0; }
|
||||
|
||||
//! Sets flag controlling behavior of hatch texture mapping on camera rotation around heading vector.
|
||||
Standard_EXPORT void SetHatchRotationPeristent (const Standard_Boolean theToSet);
|
||||
|
||||
//! Returns value of flag controlling behavior of hatch texture mapping on camera rotation around heading vector.
|
||||
Standard_Boolean IsHatchRotationPersistent() { return (myFlags & Flags_HatchRotationPersistent) != 0; }
|
||||
|
||||
//! Returns true if hatch is defined by texture.
|
||||
Standard_Boolean IsTextureHatch() const { return !myTextureHatch.IsNull(); }
|
||||
|
||||
//! Returns texture map defining the hatch.
|
||||
const Handle(Graphic3d_TextureMap)& TextureHatch() const { return myTextureHatch; }
|
||||
|
||||
//! Returns true if hatch is defined by stipple mask.
|
||||
Standard_Boolean IsStippleHatch() const { return !myStippleHatch.IsNull(); }
|
||||
|
||||
//! Returns the stipple mask.
|
||||
const Handle(Graphic3d_HatchStyle)& StippleHatch() const { return myStippleHatch; }
|
||||
|
||||
//! Returns modification counter for hatching state.
|
||||
Standard_Size HatchingState() const { return myHatchingState; }
|
||||
|
||||
private:
|
||||
|
||||
enum Flags
|
||||
{
|
||||
Flags_None = 0x00, //!< no flags
|
||||
Flags_UseObjectMaterial = 0x01, //!< use object material
|
||||
Flags_UseObjectTexture = 0x02, //!< use object texture
|
||||
Flags_UseObjectShader = 0x04, //!< use object GLSL program
|
||||
Flags_HatchZoomPersistent = 0x08, //!< zoom-persistent texturing
|
||||
Flags_HatchRotationPersistent = 0x10, //!< rotation-persistent texturing
|
||||
Flags_DrawHatching = 0x20, //!< draw hatching
|
||||
Flags_UseObjectProperties = //!< use entire fill area aspect from object
|
||||
Flags_UseObjectMaterial
|
||||
| Flags_UseObjectTexture
|
||||
| Flags_UseObjectShader
|
||||
};
|
||||
|
||||
void setFlag (const Standard_Boolean theToUse, const unsigned int theFlag)
|
||||
{
|
||||
myFlags = theToUse ? myFlags | theFlag : myFlags & ~theFlag;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
Graphic3d_MaterialAspect myMaterial;
|
||||
Handle(Graphic3d_TextureMap) myTexture;
|
||||
Handle(Graphic3d_ShaderProgram) myShader;
|
||||
Handle(Graphic3d_HatchStyle) myStippleHatch;
|
||||
Handle(Graphic3d_TextureMap) myTextureHatch;
|
||||
Graphic3d_MaterialAspect myHatchMaterial;
|
||||
unsigned int myFlags;
|
||||
Standard_Size myHatchingState;
|
||||
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(Graphic3d_AspectFillCapping, Standard_Transient)
|
||||
};
|
||||
|
||||
DEFINE_STANDARD_HANDLE (Graphic3d_AspectFillCapping, Standard_Transient)
|
||||
|
||||
#endif // _Graphic3d_AspectFillCapping_HeaderFile
|
@@ -280,7 +280,7 @@ public:
|
||||
const Graphic3d_SortType theSortType = Graphic3d_ST_BSP_Tree) = 0;
|
||||
|
||||
//! Marks BVH tree and the set of BVH primitives of correspondent priority list with id theLayerId as outdated.
|
||||
virtual void InvalidateBVHData (const Standard_Integer theLayerId) = 0;
|
||||
virtual void InvalidateBVHData (const Graphic3d_ZLayerId theLayerId) = 0;
|
||||
|
||||
//! Add a new top-level z layer with ID <theLayerId> for
|
||||
//! the view. Z layers allow drawing structures in higher layers
|
||||
|
@@ -1,29 +0,0 @@
|
||||
// Created on: 2016-08-04
|
||||
// Copyright (c) 2016 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Graphic3d_CappingFlags_HeaderFile
|
||||
#define _Graphic3d_CappingFlags_HeaderFile
|
||||
|
||||
//! Enumeration of capping flags.
|
||||
enum Graphic3d_CappingFlags
|
||||
{
|
||||
Graphic3d_CappingFlags_None = 0x0000, //!< no flags
|
||||
Graphic3d_CappingFlags_ObjectMaterial = 0x0001, //!< use object material
|
||||
Graphic3d_CappingFlags_ObjectTexture = 0x0002, //!< use object texture
|
||||
Graphic3d_CappingFlags_ObjectShader = 0x0008, //!< use object GLSL program
|
||||
Graphic3d_CappingFlags_ObjectAspect =
|
||||
Graphic3d_CappingFlags_ObjectMaterial | Graphic3d_CappingFlags_ObjectTexture | Graphic3d_CappingFlags_ObjectShader //!< use entire fill area aspect from object
|
||||
};
|
||||
|
||||
#endif // _Graphic3d_CappingFlags_HeaderFile
|
@@ -19,24 +19,11 @@
|
||||
#include <gp_Pln.hxx>
|
||||
#include <Standard_Atomic.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_ClipPlane,Standard_Transient)
|
||||
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_ClipPlane, Standard_Transient)
|
||||
|
||||
namespace
|
||||
{
|
||||
static volatile Standard_Integer THE_CLIP_PLANE_COUNTER = 0;
|
||||
|
||||
static Handle(Graphic3d_AspectFillArea3d) defaultAspect()
|
||||
{
|
||||
const Graphic3d_MaterialAspect aMaterial (Graphic3d_NOM_DEFAULT);
|
||||
Handle(Graphic3d_AspectFillArea3d) anAspect = new Graphic3d_AspectFillArea3d();
|
||||
anAspect->SetDistinguishOff();
|
||||
anAspect->SetFrontMaterial (aMaterial);
|
||||
anAspect->SetHatchStyle (Aspect_HS_HORIZONTAL);
|
||||
anAspect->SetInteriorStyle (Aspect_IS_SOLID);
|
||||
anAspect->SetInteriorColor (aMaterial.Color());
|
||||
anAspect->SetSuppressBackFaces (false);
|
||||
return anAspect;
|
||||
}
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
@@ -44,69 +31,40 @@ namespace
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
Graphic3d_ClipPlane::Graphic3d_ClipPlane()
|
||||
: myAspect (defaultAspect()),
|
||||
myPlane (0.0, 0.0, 1.0, 0.0),
|
||||
myEquation (0.0, 0.0, 1.0, 0.0),
|
||||
myFlags (Graphic3d_CappingFlags_None),
|
||||
myEquationMod(0),
|
||||
myAspectMod (0),
|
||||
myIsOn (Standard_True),
|
||||
myIsCapping (Standard_False)
|
||||
{
|
||||
makeId();
|
||||
init();
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : Graphic3d_ClipPlane
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
Graphic3d_ClipPlane::Graphic3d_ClipPlane(const Equation& theEquation)
|
||||
: myAspect (defaultAspect()),
|
||||
myPlane (theEquation.x(), theEquation.y(), theEquation.z(), theEquation.w()),
|
||||
myEquation (theEquation),
|
||||
myFlags (Graphic3d_CappingFlags_None),
|
||||
myEquationMod(0),
|
||||
myAspectMod (0),
|
||||
myIsOn (Standard_True),
|
||||
myIsCapping (Standard_False)
|
||||
Graphic3d_ClipPlane::Graphic3d_ClipPlane (const Equation& theEquation)
|
||||
{
|
||||
makeId();
|
||||
init (gp_Pln (theEquation.x(), theEquation.y(), theEquation.z(), theEquation.a()));
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : Graphic3d_ClipPlane
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
Graphic3d_ClipPlane::Graphic3d_ClipPlane(const Graphic3d_ClipPlane& theOther)
|
||||
: Standard_Transient(theOther),
|
||||
myAspect (defaultAspect()),
|
||||
myPlane (theOther.myPlane),
|
||||
myEquation (theOther.myEquation),
|
||||
myFlags (theOther.myFlags),
|
||||
myEquationMod(0),
|
||||
myAspectMod (0),
|
||||
myIsOn (theOther.myIsOn),
|
||||
myIsCapping (theOther.myIsCapping)
|
||||
Graphic3d_ClipPlane::Graphic3d_ClipPlane (const Graphic3d_ClipPlane& theOther)
|
||||
: Standard_Transient (theOther)
|
||||
{
|
||||
makeId();
|
||||
*myAspect = *theOther.CappingAspect();
|
||||
init (theOther.myPlane,
|
||||
theOther.myIsOn,
|
||||
theOther.myIsCapping,
|
||||
theOther.ToOverrideCappingAspect(),
|
||||
theOther.CappingSectionStyle());
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : Graphic3d_ClipPlane
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
Graphic3d_ClipPlane::Graphic3d_ClipPlane(const gp_Pln& thePlane)
|
||||
: myAspect (defaultAspect()),
|
||||
myPlane (thePlane),
|
||||
myFlags (Graphic3d_CappingFlags_None),
|
||||
myEquationMod(0),
|
||||
myAspectMod (0),
|
||||
myIsOn (Standard_True),
|
||||
myIsCapping (Standard_False)
|
||||
Graphic3d_ClipPlane::Graphic3d_ClipPlane (const gp_Pln& thePlane)
|
||||
{
|
||||
thePlane.Coefficients (myEquation[0], myEquation[1], myEquation[2], myEquation[3]);
|
||||
makeId();
|
||||
init (thePlane);
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
@@ -115,23 +73,20 @@ Graphic3d_ClipPlane::Graphic3d_ClipPlane(const gp_Pln& thePlane)
|
||||
// =======================================================================
|
||||
void Graphic3d_ClipPlane::SetEquation (const Equation& theEquation)
|
||||
{
|
||||
myPlane = gp_Pln (theEquation.x(), theEquation.y(), theEquation.z(), theEquation.w());
|
||||
myEquation = theEquation;
|
||||
myEquationMod++;
|
||||
myPlane = gp_Pln (theEquation.x(), theEquation.y(), theEquation.z(), theEquation.w());
|
||||
myEquation = theEquation;
|
||||
myOrientationDirty = Standard_True;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : SetPlane
|
||||
// function : SetEquation
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void Graphic3d_ClipPlane::SetEquation (const gp_Pln& thePlane)
|
||||
{
|
||||
myPlane = thePlane;
|
||||
thePlane.Coefficients (myEquation[0],
|
||||
myEquation[1],
|
||||
myEquation[2],
|
||||
myEquation[3]);
|
||||
myEquationMod++;
|
||||
thePlane.Coefficients (myEquation[0], myEquation[1], myEquation[2], myEquation[3]);
|
||||
myOrientationDirty = Standard_True;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
@@ -162,117 +117,100 @@ Handle(Graphic3d_ClipPlane) Graphic3d_ClipPlane::Clone() const
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : SetCappingMaterial
|
||||
// function : SetCappingSectionStyle
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void Graphic3d_ClipPlane::SetCappingMaterial (const Graphic3d_MaterialAspect& theMat)
|
||||
void Graphic3d_ClipPlane::SetCappingSectionStyle (const Handle(Graphic3d_AspectFillCapping)& theStyle)
|
||||
{
|
||||
myAspect->SetFrontMaterial (theMat);
|
||||
myAspect->SetInteriorColor (theMat.Color());
|
||||
++myAspectMod;
|
||||
mySectionStyle = theStyle;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : SetCappingTexture
|
||||
// function : OrientationMatrix
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void Graphic3d_ClipPlane::SetCappingTexture (const Handle(Graphic3d_TextureMap)& theTexture)
|
||||
const Graphic3d_Mat4& Graphic3d_ClipPlane::OrientationMatrix() const
|
||||
{
|
||||
if (!theTexture.IsNull())
|
||||
if (myOrientationDirty)
|
||||
{
|
||||
myAspect->SetTextureMapOn();
|
||||
Handle(Graphic3d_TextureSet) aTextureSet = myAspect->TextureSet();
|
||||
if (aTextureSet.IsNull() || aTextureSet->Size() != 1)
|
||||
const Standard_ShortReal aDirection[] = {
|
||||
static_cast<Standard_ShortReal> (myEquation[0]),
|
||||
static_cast<Standard_ShortReal> (myEquation[1]),
|
||||
static_cast<Standard_ShortReal> (myEquation[2])
|
||||
};
|
||||
|
||||
const Standard_ShortReal aTranslate[] = {
|
||||
static_cast<Standard_ShortReal> (myEquation[0] * -myEquation[3]),
|
||||
static_cast<Standard_ShortReal> (myEquation[1] * -myEquation[3]),
|
||||
static_cast<Standard_ShortReal> (myEquation[2] * -myEquation[3])
|
||||
};
|
||||
|
||||
Standard_ShortReal aSide1[] = { 0.0f, 0.0f, 0.0f };
|
||||
Standard_ShortReal aSide2[] = { 0.0f, 0.0f, 0.0f };
|
||||
|
||||
const Standard_ShortReal aMagintude = static_cast<Standard_ShortReal> (Sqrt (myEquation[0] * myEquation[0] + myEquation[2] * myEquation[2]));
|
||||
|
||||
if (aMagintude < ShortRealSmall())
|
||||
{
|
||||
aTextureSet = new Graphic3d_TextureSet (theTexture);
|
||||
aSide1[0] = 1.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
aTextureSet->SetFirst (theTexture);
|
||||
aSide1[0] = aDirection[2] / aMagintude;
|
||||
aSide1[2] = -aDirection[0] / aMagintude;
|
||||
}
|
||||
myAspect->SetTextureSet (aTextureSet);
|
||||
|
||||
aSide2[0] = (-aSide1[1] * aDirection[2]) - (-aSide1[2] * aDirection[1]);
|
||||
aSide2[1] = (-aSide1[2] * aDirection[0]) - (-aSide1[0] * aDirection[2]);
|
||||
aSide2[2] = (-aSide1[0] * aDirection[1]) - (-aSide1[1] * aDirection[0]);
|
||||
|
||||
myOrientationMat.SetValue (0, 0, aSide1[0]);
|
||||
myOrientationMat.SetValue (1, 0, aSide1[1]);
|
||||
myOrientationMat.SetValue (2, 0, aSide1[2]);
|
||||
myOrientationMat.SetValue (3, 0, 0.0F);
|
||||
|
||||
myOrientationMat.SetValue (0, 1, aDirection[0]);
|
||||
myOrientationMat.SetValue (1, 1, aDirection[1]);
|
||||
myOrientationMat.SetValue (2, 1, aDirection[2]);
|
||||
myOrientationMat.SetValue (3, 1, 0.0F);
|
||||
|
||||
myOrientationMat.SetValue (0, 2, aSide2[0]);
|
||||
myOrientationMat.SetValue (1, 2, aSide2[1]);
|
||||
myOrientationMat.SetValue (2, 2, aSide2[2]);
|
||||
myOrientationMat.SetValue (3, 2, 0.0F);
|
||||
|
||||
myOrientationMat.SetValue (0, 3, aTranslate[0]);
|
||||
myOrientationMat.SetValue (1, 3, aTranslate[1]);
|
||||
myOrientationMat.SetValue (2, 3, aTranslate[2]);
|
||||
myOrientationMat.SetValue (3, 3, 1.0F);
|
||||
|
||||
myOrientationDirty = Standard_False;
|
||||
}
|
||||
else
|
||||
|
||||
return myOrientationMat;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : init
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void Graphic3d_ClipPlane::init (const gp_Pln& thePlane,
|
||||
const Standard_Boolean theIsOn,
|
||||
const Standard_Boolean theIsCapping,
|
||||
const Standard_Boolean theOverrideStyle,
|
||||
const Handle(Graphic3d_AspectFillCapping)& theStyle)
|
||||
{
|
||||
if (myEntityUID.IsEmpty())
|
||||
{
|
||||
myAspect->SetTextureMapOff();
|
||||
myAspect->SetTextureSet (Handle(Graphic3d_TextureSet)());
|
||||
myEntityUID = TCollection_AsciiString ("Graphic3d_ClipPlane_") //DynamicType()->Name()
|
||||
+ TCollection_AsciiString (Standard_Atomic_Increment (&THE_CLIP_PLANE_COUNTER));
|
||||
}
|
||||
++myAspectMod;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : SetCappingHatch
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void Graphic3d_ClipPlane::SetCappingHatch (const Aspect_HatchStyle theStyle)
|
||||
{
|
||||
myAspect->SetHatchStyle (theStyle);
|
||||
++myAspectMod;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : SetCappingCustomHatch
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void Graphic3d_ClipPlane::SetCappingCustomHatch (const Handle(Graphic3d_HatchStyle)& theStyle)
|
||||
{
|
||||
myAspect->SetHatchStyle (theStyle);
|
||||
++myAspectMod;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : SetCappingHatchOn
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void Graphic3d_ClipPlane::SetCappingHatchOn()
|
||||
{
|
||||
myAspect->SetInteriorStyle (Aspect_IS_HATCH);
|
||||
++myAspectMod;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : SetCappingHatchOff
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void Graphic3d_ClipPlane::SetCappingHatchOff()
|
||||
{
|
||||
myAspect->SetInteriorStyle (Aspect_IS_SOLID);
|
||||
++myAspectMod;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : SetCappingAspect
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void Graphic3d_ClipPlane::SetCappingAspect (const Handle(Graphic3d_AspectFillArea3d)& theAspect)
|
||||
{
|
||||
myAspect = theAspect;
|
||||
++myAspectMod;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : setCappingFlag
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void Graphic3d_ClipPlane::setCappingFlag (bool theToUse, int theFlag)
|
||||
{
|
||||
if (theToUse)
|
||||
{
|
||||
myFlags |= theFlag;
|
||||
}
|
||||
else
|
||||
{
|
||||
myFlags &= ~(theFlag);
|
||||
}
|
||||
++myAspectMod;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : makeId
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void Graphic3d_ClipPlane::makeId()
|
||||
{
|
||||
myId = TCollection_AsciiString ("Graphic3d_ClipPlane_") //DynamicType()->Name()
|
||||
+ TCollection_AsciiString (Standard_Atomic_Increment (&THE_CLIP_PLANE_COUNTER));
|
||||
myPlane = thePlane;
|
||||
myPlane.Coefficients (myEquation[0], myEquation[1], myEquation[2], myEquation[3]);
|
||||
myIsOn = theIsOn;
|
||||
myIsCapping = theIsCapping;
|
||||
myOverrideObjectStyle = theOverrideStyle;
|
||||
mySectionStyle = theStyle.IsNull() ? new Graphic3d_AspectFillCapping() : theStyle;
|
||||
myOrientationDirty = Standard_True;
|
||||
}
|
||||
|
@@ -17,14 +17,16 @@
|
||||
#define _Graphic3d_ClipPlane_HeaderFile
|
||||
|
||||
#include <Aspect_HatchStyle.hxx>
|
||||
#include <gp_Pln.hxx>
|
||||
#include <Graphic3d_AspectFillArea3d.hxx>
|
||||
#include <Graphic3d_CappingFlags.hxx>
|
||||
#include <Graphic3d_AspectFillCapping.hxx>
|
||||
#include <Graphic3d_Mat4.hxx>
|
||||
#include <Graphic3d_TextureMap.hxx>
|
||||
#include <NCollection_Handle.hxx>
|
||||
#include <NCollection_Vec4.hxx>
|
||||
#include <Standard_Macro.hxx>
|
||||
#include <Standard_TypeDef.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <Standard_TypeDef.hxx>
|
||||
#include <gp_Pln.hxx>
|
||||
|
||||
//! Container for properties describing graphic driver clipping planes.
|
||||
//! It is up to application to create instances of this class and specify its
|
||||
@@ -45,6 +47,8 @@ public:
|
||||
|
||||
typedef NCollection_Vec4<Standard_Real> Equation;
|
||||
|
||||
public:
|
||||
|
||||
//! Default constructor.
|
||||
//! Initializes clip plane container with the following properties:
|
||||
//! - Equation (0.0, 0.0, 1.0, 0)
|
||||
@@ -58,7 +62,7 @@ public:
|
||||
|
||||
//! Copy constructor.
|
||||
//! @param theOther [in] the copied plane.
|
||||
Standard_EXPORT Graphic3d_ClipPlane(const Graphic3d_ClipPlane& theOther);
|
||||
Standard_EXPORT Graphic3d_ClipPlane (const Graphic3d_ClipPlane& theOther);
|
||||
|
||||
//! Construct clip plane for the passed equation.
|
||||
//! By default the plane is on, capping is turned off.
|
||||
@@ -82,37 +86,17 @@ public:
|
||||
|
||||
//! Get 4-component equation vector for clipping plane.
|
||||
//! @return clipping plane equation vector.
|
||||
const Equation& GetEquation() const
|
||||
{
|
||||
return myEquation;
|
||||
}
|
||||
const Equation& GetEquation() const { return myEquation; }
|
||||
|
||||
//! Check that the clipping plane is turned on.
|
||||
//! @return boolean flag indicating whether the plane is in on or off state.
|
||||
Standard_Boolean IsOn() const
|
||||
{
|
||||
return myIsOn;
|
||||
}
|
||||
Standard_Boolean IsOn() const { return myIsOn; }
|
||||
|
||||
//! Change state of the clipping plane.
|
||||
//! @param theIsOn [in] the flag specifying whether the graphic driver
|
||||
//! clipping by this plane should be turned on or off.
|
||||
Standard_EXPORT void SetOn(const Standard_Boolean theIsOn);
|
||||
|
||||
//! Change state of capping surface rendering.
|
||||
//! @param theIsOn [in] the flag specifying whether the graphic driver should
|
||||
//! perform rendering of capping surface produced by this plane. The graphic
|
||||
//! driver produces this surface for convex graphics by means of stencil-test
|
||||
//! and multi-pass rendering.
|
||||
Standard_EXPORT void SetCapping(const Standard_Boolean theIsOn);
|
||||
|
||||
//! Check state of capping surface rendering.
|
||||
//! @return true (turned on) or false depending on the state.
|
||||
Standard_Boolean IsCapping() const
|
||||
{
|
||||
return myIsCapping;
|
||||
}
|
||||
|
||||
//! Get geometrical definition.
|
||||
//! @return geometrical definition of clipping plane
|
||||
const gp_Pln& ToPlane() const { return myPlane; }
|
||||
@@ -123,47 +107,6 @@ public:
|
||||
//! @return new instance of clipping plane with same properties and attributes.
|
||||
Standard_EXPORT virtual Handle(Graphic3d_ClipPlane) Clone() const;
|
||||
|
||||
public: // @name user-defined graphical attributes
|
||||
|
||||
//! Set material for rendering capping surface.
|
||||
//! @param theMat [in] the material.
|
||||
Standard_EXPORT void SetCappingMaterial (const Graphic3d_MaterialAspect& theMat);
|
||||
|
||||
//! @return capping material.
|
||||
const Graphic3d_MaterialAspect& CappingMaterial() const { return myAspect->FrontMaterial(); }
|
||||
|
||||
//! Set texture to be applied on capping surface.
|
||||
//! @param theTexture [in] the texture.
|
||||
Standard_EXPORT void SetCappingTexture (const Handle(Graphic3d_TextureMap)& theTexture);
|
||||
|
||||
//! @return capping texture map.
|
||||
Handle(Graphic3d_TextureMap) CappingTexture() const { return !myAspect->TextureSet().IsNull() && !myAspect->TextureSet()->IsEmpty()
|
||||
? myAspect->TextureSet()->First()
|
||||
: Handle(Graphic3d_TextureMap)(); }
|
||||
|
||||
//! Set hatch style (stipple) and turn hatching on.
|
||||
//! @param theStyle [in] the hatch style.
|
||||
Standard_EXPORT void SetCappingHatch (const Aspect_HatchStyle theStyle);
|
||||
|
||||
//! @return hatching style.
|
||||
Aspect_HatchStyle CappingHatch() const { return (Aspect_HatchStyle)myAspect->HatchStyle()->HatchType(); }
|
||||
|
||||
//! Set custom hatch style (stipple) and turn hatching on.
|
||||
//! @param theStyle [in] the hatch pattern.
|
||||
Standard_EXPORT void SetCappingCustomHatch (const Handle(Graphic3d_HatchStyle)& theStyle);
|
||||
|
||||
//! @return hatching style.
|
||||
const Handle(Graphic3d_HatchStyle)& CappingCustomHatch() const { return myAspect->HatchStyle(); }
|
||||
|
||||
//! Turn on hatching.
|
||||
Standard_EXPORT void SetCappingHatchOn();
|
||||
|
||||
//! Turn off hatching.
|
||||
Standard_EXPORT void SetCappingHatchOff();
|
||||
|
||||
//! @return True if hatching mask is turned on.
|
||||
Standard_Boolean IsHatchOn() const { return myAspect->InteriorStyle() == Aspect_IS_HATCH; }
|
||||
|
||||
//! This ID is used for managing associated resources in graphical driver.
|
||||
//! The clip plane can be assigned within a range of IO which can be
|
||||
//! displayed in separate OpenGl contexts. For each of the context an associated
|
||||
@@ -171,81 +114,61 @@ public: // @name user-defined graphical attributes
|
||||
//! The resources are stored in graphical driver for each of individual groups
|
||||
//! of shared context under the clip plane identifier.
|
||||
//! @return clip plane resource identifier string.
|
||||
const TCollection_AsciiString& GetId() const
|
||||
{
|
||||
return myId;
|
||||
}
|
||||
const TCollection_AsciiString& GetId() const { return myEntityUID; }
|
||||
|
||||
public:
|
||||
|
||||
//! Return capping aspect.
|
||||
//! @return capping surface rendering aspect.
|
||||
const Handle(Graphic3d_AspectFillArea3d)& CappingAspect() const { return myAspect; }
|
||||
//! Change state of capping surface rendering.
|
||||
//! @param theIsOn [in] the flag specifying whether the graphic driver should
|
||||
//! perform rendering of capping surface produced by this plane. The graphic
|
||||
//! driver produces this surface for convex graphics by means of stencil-test
|
||||
//! and multi-pass rendering.
|
||||
Standard_EXPORT void SetCapping(const Standard_Boolean theIsOn);
|
||||
|
||||
//! Assign capping aspect.
|
||||
Standard_EXPORT void SetCappingAspect (const Handle(Graphic3d_AspectFillArea3d)& theAspect);
|
||||
//! Check state of capping surface rendering.
|
||||
//! @return true (turned on) or false depending on the state.
|
||||
Standard_Boolean IsCapping() const { return myIsCapping; }
|
||||
|
||||
//! Flag indicating whether material for capping plane should be taken from object.
|
||||
//! Default value: FALSE (use dedicated capping plane material).
|
||||
bool ToUseObjectMaterial() const { return (myFlags & Graphic3d_CappingFlags_ObjectMaterial) != 0; }
|
||||
//! Sets clipping section filling aspect.
|
||||
Standard_EXPORT void SetCappingSectionStyle (const Handle(Graphic3d_AspectFillCapping)& theStyle);
|
||||
|
||||
//! Set flag for controlling the source of capping plane material.
|
||||
void SetUseObjectMaterial (bool theToUse) { setCappingFlag (theToUse, Graphic3d_CappingFlags_ObjectMaterial); }
|
||||
//! Returns style used for drawing capping section.
|
||||
const Handle(Graphic3d_AspectFillCapping)& CappingSectionStyle() const { return mySectionStyle; }
|
||||
|
||||
//! Flag indicating whether texture for capping plane should be taken from object.
|
||||
//! Default value: FALSE.
|
||||
bool ToUseObjectTexture() const { return (myFlags & Graphic3d_CappingFlags_ObjectTexture) != 0; }
|
||||
//! Flag indicating whether section style of the plane should overrides similar property of object presentation.
|
||||
//! Default value: FALSE (use dedicated presentation aspect style).
|
||||
bool ToOverrideCappingAspect() const { return myOverrideObjectStyle; }
|
||||
|
||||
//! Set flag for controlling the source of capping plane texture.
|
||||
void SetUseObjectTexture (bool theToUse) { setCappingFlag (theToUse, Graphic3d_CappingFlags_ObjectTexture); }
|
||||
//! Sets flag for controlling the preference of using section style between clip plane and object.
|
||||
void SetToOverrideCappingAspect (const bool theToOverride) { myOverrideObjectStyle = theToOverride; }
|
||||
|
||||
//! Flag indicating whether shader program for capping plane should be taken from object.
|
||||
//! Default value: FALSE.
|
||||
bool ToUseObjectShader() const { return (myFlags & Graphic3d_CappingFlags_ObjectShader) != 0; }
|
||||
|
||||
//! Set flag for controlling the source of capping plane shader program.
|
||||
void SetUseObjectShader(bool theToUse) { setCappingFlag (theToUse, Graphic3d_CappingFlags_ObjectShader); }
|
||||
|
||||
//! Return true if some fill area aspect properties should be taken from object.
|
||||
bool ToUseObjectProperties() const { return myFlags != Graphic3d_CappingFlags_None; }
|
||||
|
||||
public: // @name modification counters
|
||||
|
||||
//! @return modification counter for equation.
|
||||
unsigned int MCountEquation() const
|
||||
{
|
||||
return myEquationMod;
|
||||
}
|
||||
|
||||
//! @return modification counter for aspect.
|
||||
unsigned int MCountAspect() const
|
||||
{
|
||||
return myAspectMod;
|
||||
}
|
||||
//! Returns plane's orientation matrix.
|
||||
Standard_EXPORT const Graphic3d_Mat4& OrientationMatrix() const;
|
||||
|
||||
private:
|
||||
|
||||
//! Generate unique object id for OpenGL graphic resource manager.
|
||||
void makeId();
|
||||
|
||||
//! Set capping flag.
|
||||
Standard_EXPORT void setCappingFlag (bool theToUse, int theFlag);
|
||||
//! Initializes plane and makes unique identifier (UID) to differentiate clipping plane entities.
|
||||
void init (const gp_Pln& thePlane = gp_Pln(),
|
||||
const Standard_Boolean theIsOn = Standard_True,
|
||||
const Standard_Boolean theIsCapping = Standard_False,
|
||||
const Standard_Boolean theOverrideStyle = Standard_False,
|
||||
const Handle(Graphic3d_AspectFillCapping)& theStyle = Handle(Graphic3d_AspectFillCapping)());
|
||||
|
||||
private:
|
||||
|
||||
Handle(Graphic3d_AspectFillArea3d) myAspect; //!< fill area aspect
|
||||
TCollection_AsciiString myId; //!< resource id
|
||||
gp_Pln myPlane; //!< plane definition
|
||||
Equation myEquation; //!< plane equation vector
|
||||
unsigned int myFlags; //!< capping flags
|
||||
unsigned int myEquationMod; //!< modification counter for equation
|
||||
unsigned int myAspectMod; //!< modification counter of aspect
|
||||
Standard_Boolean myIsOn; //!< state of the clipping plane
|
||||
Standard_Boolean myIsCapping; //!< state of graphic driver capping
|
||||
TCollection_AsciiString myEntityUID; //!< Unique identifier for the plane
|
||||
gp_Pln myPlane; //!< Plane definition
|
||||
Equation myEquation; //!< Plane equation vector
|
||||
Standard_Boolean myIsOn; //!< State of the clipping plane
|
||||
Standard_Boolean myIsCapping; //!< State of graphic driver capping
|
||||
Standard_Boolean myOverrideObjectStyle; //!< Flag forcing to use plane's section style rather than section style defined for object
|
||||
Handle(Graphic3d_AspectFillCapping) mySectionStyle; //!< Style set for drawing capped solid section.
|
||||
mutable Standard_Boolean myOrientationDirty; //!< Boolean flag indicating whether orientation matrix is dirty or not.
|
||||
mutable Graphic3d_Mat4 myOrientationMat; //!< Plane orientation matrix (for visualization purposes).
|
||||
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(Graphic3d_ClipPlane,Standard_Transient)
|
||||
DEFINE_STANDARD_RTTIEXT (Graphic3d_ClipPlane, Standard_Transient)
|
||||
};
|
||||
|
||||
DEFINE_STANDARD_HANDLE (Graphic3d_ClipPlane, Standard_Transient)
|
||||
|
@@ -231,10 +231,11 @@ Standard_Boolean Graphic3d_Group::IsGroupPrimitivesAspectSet (const Graphic3d_Gr
|
||||
// function : GroupPrimitivesAspect
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void Graphic3d_Group::GroupPrimitivesAspect (const Handle(Graphic3d_AspectLine3d)& theAspLine,
|
||||
const Handle(Graphic3d_AspectText3d)& theAspText,
|
||||
const Handle(Graphic3d_AspectMarker3d)& theAspMarker,
|
||||
const Handle(Graphic3d_AspectFillArea3d)& theAspFill) const
|
||||
void Graphic3d_Group::GroupPrimitivesAspect (const Handle(Graphic3d_AspectLine3d)& theAspLine,
|
||||
const Handle(Graphic3d_AspectText3d)& theAspText,
|
||||
const Handle(Graphic3d_AspectMarker3d)& theAspMarker,
|
||||
const Handle(Graphic3d_AspectFillArea3d)& theAspFill,
|
||||
const Handle(Graphic3d_AspectFillCapping)& theAspCapping) const
|
||||
{
|
||||
if (!theAspLine.IsNull())
|
||||
{
|
||||
@@ -271,6 +272,15 @@ void Graphic3d_Group::GroupPrimitivesAspect (const Handle(Graphic3d_AspectLine3d
|
||||
*theAspFill.operator->() = *aFillAspect;
|
||||
}
|
||||
}
|
||||
|
||||
if (!theAspCapping.IsNull())
|
||||
{
|
||||
Handle(Graphic3d_AspectFillCapping) aCappingAspect = FillCappingAspect();
|
||||
if (!aCappingAspect.IsNull())
|
||||
{
|
||||
*theAspCapping.operator->() = *aCappingAspect;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
|
@@ -17,30 +17,30 @@
|
||||
#ifndef _Graphic3d_Group_HeaderFile
|
||||
#define _Graphic3d_Group_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Graphic3d_BndBox4f.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Graphic3d_AspectLine3d.hxx>
|
||||
#include <Graphic3d_AspectFillArea3d.hxx>
|
||||
#include <Graphic3d_AspectText3d.hxx>
|
||||
#include <Graphic3d_AspectFillCapping.hxx>
|
||||
#include <Graphic3d_AspectLine3d.hxx>
|
||||
#include <Graphic3d_AspectMarker3d.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Standard_CString.hxx>
|
||||
#include <Graphic3d_Vertex.hxx>
|
||||
#include <Graphic3d_TextPath.hxx>
|
||||
#include <Graphic3d_HorizontalTextAlignment.hxx>
|
||||
#include <Graphic3d_VerticalTextAlignment.hxx>
|
||||
#include <Graphic3d_TypeOfPrimitiveArray.hxx>
|
||||
#include <Graphic3d_IndexBuffer.hxx>
|
||||
#include <Graphic3d_Buffer.hxx>
|
||||
#include <Graphic3d_AspectText3d.hxx>
|
||||
#include <Graphic3d_BndBox4f.hxx>
|
||||
#include <Graphic3d_BoundBuffer.hxx>
|
||||
#include <Standard_Address.hxx>
|
||||
#include <Graphic3d_Buffer.hxx>
|
||||
#include <Graphic3d_GroupAspect.hxx>
|
||||
#include <gp_Ax2.hxx>
|
||||
#include <Graphic3d_HorizontalTextAlignment.hxx>
|
||||
#include <Graphic3d_IndexBuffer.hxx>
|
||||
#include <Graphic3d_TextPath.hxx>
|
||||
#include <Graphic3d_TypeOfPrimitiveArray.hxx>
|
||||
#include <Graphic3d_Vertex.hxx>
|
||||
#include <Graphic3d_VerticalTextAlignment.hxx>
|
||||
#include <MMgt_TShared.hxx>
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Address.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_CString.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TCollection_ExtendedString.hxx>
|
||||
#include <gp_Ax2.hxx>
|
||||
|
||||
class Graphic3d_Structure;
|
||||
class Graphic3d_ArrayOfPrimitives;
|
||||
@@ -56,7 +56,7 @@ class Graphic3d_ArrayOfPrimitives;
|
||||
//! 1) Non-modifiable, or unbounded, group ('black box').
|
||||
//! Developers can repeat a sequence of
|
||||
//! SetPrimitivesAspect() with AddPrimitiveArray() methods arbitrary number of times
|
||||
//! to define arbitrary number of primitive "blocks" each having individual apect values.
|
||||
//! to define arbitrary number of primitive "blocks" each having individual aspect values.
|
||||
//! Any modification of such a group is forbidden, as aspects and primitives are mixed
|
||||
//! in memory without any high-level logical structure, and any modification is very likely to result
|
||||
//! in corruption of the group internal data.
|
||||
@@ -78,11 +78,11 @@ class Graphic3d_ArrayOfPrimitives;
|
||||
class Graphic3d_Group : public Standard_Transient
|
||||
{
|
||||
friend class Graphic3d_Structure;
|
||||
DEFINE_STANDARD_RTTIEXT(Graphic3d_Group,Standard_Transient)
|
||||
DEFINE_STANDARD_RTTIEXT(Graphic3d_Group, Standard_Transient)
|
||||
|
||||
public:
|
||||
|
||||
//! Supress all primitives and attributes of <me>.
|
||||
//! Suppress all primitives and attributes of <me>.
|
||||
//! To clear group without update in Graphic3d_StructureManager
|
||||
//! pass Standard_False as <theUpdateStructureMgr>. This
|
||||
//! used on context and viewer destruction, when the pointer
|
||||
@@ -91,13 +91,13 @@ public:
|
||||
//! cross-reference);
|
||||
Standard_EXPORT virtual void Clear (const Standard_Boolean theUpdateStructureMgr = Standard_True);
|
||||
|
||||
//! Supress the group <me> in the structure.
|
||||
//! Suppress the group <me> in the structure.
|
||||
Standard_EXPORT virtual ~Graphic3d_Group();
|
||||
|
||||
//! Supress the group <me> in the structure.
|
||||
//! Suppress the group <me> in the structure.
|
||||
//! Warning: No more graphic operations in <me> after this call.
|
||||
//! Modifies the current modelling transform persistence (pan, zoom or rotate)
|
||||
//! Get the current modelling transform persistence (pan, zoom or rotate)
|
||||
//! Modifies the current modeling transform persistence (pan, zoom or rotate)
|
||||
//! Get the current modeling transform persistence (pan, zoom or rotate)
|
||||
Standard_EXPORT void Remove();
|
||||
|
||||
public:
|
||||
@@ -126,6 +126,12 @@ public:
|
||||
//! Modifies the context for all the marker primitives of the group.
|
||||
virtual void SetGroupPrimitivesAspect (const Handle(Graphic3d_AspectMarker3d)& theAspect) = 0;
|
||||
|
||||
//! Returns style of filling clipping sections on closed shell primitives.
|
||||
virtual Handle(Graphic3d_AspectFillCapping) FillCappingAspect() const = 0;
|
||||
|
||||
//! Modifies the context for filling clipping section for all closed shell primitives of the group.
|
||||
virtual void SetGroupPrimitivesAspect (const Handle(Graphic3d_AspectFillCapping)& theAspect) = 0;
|
||||
|
||||
//! Modifies the current context of the group to give
|
||||
//! another aspect for all the line primitives created
|
||||
//! after this call in the group.
|
||||
@@ -153,15 +159,17 @@ public:
|
||||
Standard_EXPORT void GroupPrimitivesAspect (const Handle(Graphic3d_AspectLine3d)& theAspLine,
|
||||
const Handle(Graphic3d_AspectText3d)& theAspText,
|
||||
const Handle(Graphic3d_AspectMarker3d)& theAspMarker,
|
||||
const Handle(Graphic3d_AspectFillArea3d)& theAspFill) const;
|
||||
const Handle(Graphic3d_AspectFillArea3d)& theAspFill,
|
||||
const Handle(Graphic3d_AspectFillCapping)& theAspFillCapping) const;
|
||||
|
||||
//! Returns the last inserted context in the group for each kind of primitives.
|
||||
void PrimitivesAspect (const Handle(Graphic3d_AspectLine3d)& theAspLine,
|
||||
const Handle(Graphic3d_AspectText3d)& theAspText,
|
||||
const Handle(Graphic3d_AspectMarker3d)& theAspMarker,
|
||||
const Handle(Graphic3d_AspectFillArea3d)& theAspFill) const
|
||||
void PrimitivesAspect (const Handle(Graphic3d_AspectLine3d)& theAspLine,
|
||||
const Handle(Graphic3d_AspectText3d)& theAspText,
|
||||
const Handle(Graphic3d_AspectMarker3d)& theAspMarker,
|
||||
const Handle(Graphic3d_AspectFillArea3d)& theAspFill,
|
||||
const Handle(Graphic3d_AspectFillCapping)& theAspFillCapping) const
|
||||
{
|
||||
GroupPrimitivesAspect (theAspLine, theAspText, theAspMarker, theAspFill);
|
||||
GroupPrimitivesAspect (theAspLine, theAspText, theAspMarker, theAspFill, theAspFillCapping);
|
||||
}
|
||||
|
||||
public:
|
||||
@@ -312,6 +320,6 @@ protected:
|
||||
|
||||
};
|
||||
|
||||
DEFINE_STANDARD_HANDLE(Graphic3d_Group, Standard_Transient)
|
||||
DEFINE_STANDARD_HANDLE(Graphic3d_Group, MMgt_TShared)
|
||||
|
||||
#endif // _Graphic3d_Group_HeaderFile
|
||||
|
@@ -21,13 +21,15 @@
|
||||
//! - ASPECT_LINE: aspect for line primitives;
|
||||
//! - ASPECT_TEXT: aspect for text primitives;
|
||||
//! - ASPECT_MARKER: aspect for marker primitives;
|
||||
//! - ASPECT_FILL_AREA: aspect for face primitives.
|
||||
//! - ASPECT_FILL_AREA: aspect for face primitives;
|
||||
//! - Graphic3d_ASPECT_FILL_CAPPING: aspect for filling clipping sections.
|
||||
enum Graphic3d_GroupAspect
|
||||
{
|
||||
Graphic3d_ASPECT_LINE,
|
||||
Graphic3d_ASPECT_TEXT,
|
||||
Graphic3d_ASPECT_MARKER,
|
||||
Graphic3d_ASPECT_FILL_AREA
|
||||
Graphic3d_ASPECT_LINE,
|
||||
Graphic3d_ASPECT_TEXT,
|
||||
Graphic3d_ASPECT_MARKER,
|
||||
Graphic3d_ASPECT_FILL_AREA,
|
||||
Graphic3d_ASPECT_FILL_CAPPING
|
||||
};
|
||||
|
||||
#endif // _Graphic3d_GroupAspect_HeaderFile
|
||||
|
@@ -291,7 +291,7 @@ public:
|
||||
|
||||
//! Compute per-element multiplication.
|
||||
//! @param theFactor [in] the scale factor.
|
||||
//! @return the result of multiplicaton.
|
||||
//! @return the result of multiplication.
|
||||
NCollection_Mat4 operator* (const Element_t theFactor) const
|
||||
{
|
||||
return Multiplied (theFactor);
|
||||
@@ -299,7 +299,7 @@ public:
|
||||
|
||||
//! Compute per-element multiplication.
|
||||
//! @param theFactor [in] the scale factor.
|
||||
//! @return the result of multiplicaton.
|
||||
//! @return the result of multiplication.
|
||||
NCollection_Mat4 Multiplied (const Element_t theFactor) const
|
||||
{
|
||||
NCollection_Mat4 aTempMat (*this);
|
||||
|