-#include < BRepAlgoAPI_Section.hxx>
+#include
{…
bool bRunParallel;
double aFuzzyValue;
@@ -3538,7 +3538,7 @@ The following example illustrates how to use Section operation:
#### Tcl Level
-~~~~{.php}
+~~~~{.tcl}
# prepare the arguments
box b1 10 10 10
box b2 3 4 5 10 10 10
diff --git a/dox/specification/brep_format.md b/dox/specification/brep_format.md
index 4565bb21ac..be7be27627 100644
--- a/dox/specification/brep_format.md
+++ b/dox/specification/brep_format.md
@@ -9,6 +9,8 @@ BRep Format {#specification__brep_format}
of vertices, edges, wires, faces, shells, solids, compsolids, compounds, edge triangulations,
face triangulations, polylines on triangulations, space location and orientation.
Any set of such models may be stored as a single model which is a compound of the models.
+
+ @note This document describes the **ASCII** BREP format produced by `BRepTools` (`Write` / `Read`), whose header line is `CASCADE Topology V1/V2/V3`. OCCT also ships a **binary** BREP format, produced by the `BinTools` package (`BinTools::Write` / `BinTools::Read`), with its own independent header sequence (`Open CASCADE Topology V1`..`V4`). The two formats share most of the geometric content but differ in framing and tokenization, and are not interchangeable.
The format is described in an order which is convenient for understanding
rather than in the order the format parts follow each other.
@@ -1124,7 +1126,7 @@ The example record is interpreted as a circle which has a center *P*=(1,2). Th
**Description**
-\<2D curve record 3\> describes an ellipse. The ellipse data are 2D point *P*, orthogonal 2D directions *Dmaj* and *Dmin* and non-negative reals *rmaj* and *rmin* that *rmaj* @f$ \leq @f$ *rmin*. The ellipse has a center *P*, major and minor axis directions *Dmaj* and *Dmin*, major and minor radii *rmaj* and *rmin* and is defined by the following parametric equation:
+\<2D curve record 3\> describes an ellipse. The ellipse data are 2D point *P*, orthogonal 2D directions *Dmaj* and *Dmin* and non-negative reals *rmaj* and *rmin* that *rmaj* @f$ \geq @f$ *rmin*. The ellipse has a center *P*, major and minor axis directions *Dmaj* and *Dmin*, major and minor radii *rmaj* and *rmin* and is defined by the following parametric equation:
@f[ C(u)=P+r_{maj} \cdot cos(u) \cdot D_{maj}+r_{min} \cdot sin(u) \cdot D_{min},\; u \in [0,\; 2 \cdot \pi) . @f]
@@ -1193,7 +1195,7 @@ The example record is interpreted as a parabola in plane which passes through a
@f[ C(u)=P+k_{x} \cdot cosh(u) D_{x}+k_{y} \cdot sinh(u) \cdot D_{y},\; u \in (-\infty,\; \infty). @f]
-The example record is interpreted as a hyperbola with coordinate system which has origin *P*=(1,2) and axis directions *Dx*=(1,0) and *Dy*=(0,1). Other data for the hyperbola are *kx*=5 and *ky*=4. The hyperbola is defined by the following parametric equation: @f$ C(u)=(1,2)+3 \cdot cosh(u) \cdot (1,0)+4 \cdot sinh(u) \cdot (0,1) @f$.
+The example record is interpreted as a hyperbola with coordinate system which has origin *P*=(1,2) and axis directions *Dx*=(1,0) and *Dy*=(0,1). Other data for the hyperbola are *kx*=3 and *ky*=4. The hyperbola is defined by the following parametric equation: @f$ C(u)=(1,2)+3 \cdot cosh(u) \cdot (1,0)+4 \cdot sinh(u) \cdot (0,1) @f$.
@subsubsection specification__brep_format_5_3_6 Bezier Curve - \<2D curve record 6\>
diff --git a/dox/specification/pbr_math.md b/dox/specification/pbr_math.md
index 52f68b26df..5007e938e5 100644
--- a/dox/specification/pbr_math.md
+++ b/dox/specification/pbr_math.md
@@ -627,7 +627,7 @@ Lets go back to diffuse indirect illumination component represented by following
Of course, Monte-Carlo algorithm can be applied directly and hemisphere integral can be precalculated for every normal direction
but dependence from \f$v\f$ in Fresnel's factor does not allow to do it efficiently (every \f$v\f$ direction is needed to be considered again).
-In order to resolve it modified version of Schlick's approximation has been created [[?](TODO)]:
+In order to resolve it, a modified version of Schlick's approximation has been created:
\f[F \approx F_{ss}=F_0+(\max(1-r, F_0))(1-\cos\theta_v)^5\f]
@@ -770,11 +770,11 @@ As practice shows this is very good approximation of diffuse indirect illuminati
@section pbr_transparency Transparent materials
-TODO
+Content to be provided.
@section pbr_low_discrepancy Low discrepancy sequence
-TODO
+Content to be provided.
@section pbr_references References
@@ -868,7 +868,7 @@ Romain Guy, Mathias Agopian, "Physically Based Rendering in Filament", *Part of
@anchor Aguilar17 **[Aguilar17]**
|
Orlando Aguilar, "Spherical Harmonics", *Blog post*:
-[http://orlandoaguilar.github.io/sh/spherical/harmonics/irradiance/map/2017/02/12/SphericalHarmonics.html](http://orlandoaguilar.github.io/sh/spherical/harmonics/irradiance/map/2017/02/12/SphericalHarmonics.html)
+[https://orlandoaguilar.github.io/sh/spherical/harmonics/irradiance/map/2017/02/12/SphericalHarmonics.html](https://orlandoaguilar.github.io/sh/spherical/harmonics/irradiance/map/2017/02/12/SphericalHarmonics.html)
|
diff --git a/dox/tutorial/tutorial.md b/dox/tutorial/tutorial.md
index e1d3d52bb8..fd2a41be7f 100644
--- a/dox/tutorial/tutorial.md
+++ b/dox/tutorial/tutorial.md
@@ -20,7 +20,7 @@ To illustrate the use of classes provided in the 3D geometric modeling toolkits,
@figure{/tutorial/images/tutorial_image001.png,"",240} height=350px
-In the tutorial we will create, step-by-step, a function that will model a bottle as shown above. You will find the complete source code of this tutorial, including the very function *MakeBottle* in the distribution of Open CASCADE Technology. The function body is provided in the file samples/qt/Tutorial/src/MakeBottle.cxx.
+In the tutorial we will create, step-by-step, a function that will model a bottle as shown above. You will find the complete source code of this tutorial in the appendix below.
@subsection OCCT_TUTORIAL_SUB1_3 Model Specifications
@@ -50,7 +50,7 @@ This modeling requires four steps:
To create the bottle's profile, you first create characteristic points with their coordinates as shown below in the (XOY) plane. These points will be the supports that define the geometry of the profile.
-@figure{tutorial/images/tutorial_image003.svg,"",466}
+@figure{/tutorial/images/tutorial_image003.svg,"",466}
There are two classes to describe a 3D Cartesian point from its X, Y and Z coordinates in Open CASCADE Technology:
@@ -96,6 +96,7 @@ This is because the *GC* provides two algorithm classes which are exactly what i
Both of these classes return a *Geom_TrimmedCurve* manipulated by handle. This entity represents a base curve (line or circle, in our case), limited between two of its parameter values. For example, circle C is parameterized between 0 and 2PI. If you need to create a quarter of a circle, you create a *Geom_TrimmedCurve* on C limited between 0 and M_PI/2.
~~~~{.cpp}
+ // For production code, prefer the explicit IsDone()/Value() pattern shown below.
occ::handle aArcOfCircle = GC_MakeArcOfCircle(aPnt2,aPnt3,aPnt4);
occ::handle aSegment1 = GC_MakeSegment(aPnt1, aPnt2);
occ::handle aSegment2 = GC_MakeSegment(aPnt4, aPnt5);
@@ -106,7 +107,7 @@ All *GC* classes provide a casting method to obtain a result automatically with
~~~~{.cpp}
GC_MakeSegment mkSeg (aPnt1, aPnt2);
occ::handle aSegment1;
- if(mkSegment.IsDone()){
+ if(mkSeg.IsDone()){
aSegment1 = mkSeg.Value();
}
else {
@@ -144,6 +145,8 @@ Referring to the previous table, to build the profile, you will create:
However, the *TopoDS* package provides only the data structure of the topological entities. Algorithm classes available to compute standard topological objects can be found in the *BRepBuilderAPI* package.
To create an edge, you use the BRepBuilderAPI_MakeEdge class with the previously computed curves:
+**Note:** In production code, `IsDone()` should be checked on all builder operations before accessing their results. The tutorial omits these checks for brevity.
+
~~~~{.cpp}
TopoDS_Edge anEdge1 = BRepBuilderAPI_MakeEdge(aSegment1);
TopoDS_Edge anEdge2 = BRepBuilderAPI_MakeEdge(aArcOfCircle);
@@ -153,8 +156,8 @@ To create an edge, you use the BRepBuilderAPI_MakeEdge class with the previously
In Open CASCADE Technology, you can create edges in several ways. One possibility is to create an edge directly from two points, in which case the underlying geometry of this edge is a line, bounded by two vertices being automatically computed from the two input points. For example, anEdge1 and anEdge3 could have been computed in a simpler way:
~~~~{.cpp}
- TopoDS_Edge anEdge1 = BRepBuilderAPI_MakeEdge(aPnt1, aPnt3);
- TopoDS_Edge anEdge2 = BRepBuilderAPI_MakeEdge(aPnt4, aPnt5);
+ TopoDS_Edge anEdge1 = BRepBuilderAPI_MakeEdge(aPnt1, aPnt2);
+ TopoDS_Edge anEdge3 = BRepBuilderAPI_MakeEdge(aPnt4, aPnt5);
~~~~
To connect the edges, you need to create a wire with the *BRepBuilderAPI_MakeWire* class. There are two ways of building a wire with this class:
@@ -437,7 +440,7 @@ DynamicType returns the real type of the object, but you need to compare it with
To compare a given type with the type you seek, use the *STANDARD_TYPE* macro, which returns the type of a class:
~~~~{.cpp}
- if(aSurface->DynamicType() == STANDARD_TYPE(Geom_Plane)){
+ if(!aSurface.IsNull() && aSurface->DynamicType() == STANDARD_TYPE(Geom_Plane)){
}
~~~~
@@ -457,11 +460,14 @@ Remember that the goal of all these conversions is to find the highest face of t
You can easily find the plane whose origin is the biggest in Z knowing that the location of the plane is given with the *Geom_Plane::Location* method. For example:
~~~~{.cpp}
- gp_Pnt aPnt = aPlane->Location();
- double aZ = aPnt.Z();
- if(aZ > zMax){
- zMax = aZ;
- faceToRemove = aFace;
+ if (!aPlane.IsNull())
+ {
+ gp_Pnt aPnt = aPlane->Location();
+ double aZ = aPnt.Z();
+ if(aZ > zMax){
+ zMax = aZ;
+ faceToRemove = aFace;
+ }
}
~~~~
@@ -469,6 +475,8 @@ You have now found the top face of the neck. Your final step before creating the
Open CASCADE Technology provides many collections for different kinds of objects: see *TColGeom* package for collections of objects from *Geom* package, *TColgp* package for collections of objects from gp package, etc.
The collection for shapes can be found in the *TopTools* package. As *BRepOffsetAPI_MakeThickSolid* requires a list, use the *TopTools_ListOfShape* class.
+@note In OCCT 8.0.0 the package-level `TCol*` typedefs are deprecated. Prefer `NCollection_*` directly -- see the @ref upgrade_occt800 "Upgrade to OCCT 8.0.0".
+
~~~~{.cpp}
NCollection_List facesToRemove;
facesToRemove.Append(faceToRemove);
@@ -700,13 +708,13 @@ Congratulations! Your bottle is complete. Here is the result snapshot of the Tut
@figure{/tutorial/images/tutorial_image019.png,"",320} height=450px
We hope that this tutorial has provided you with a feel for the industrial strength power of Open CASCADE Technology.
-If you want to know more and develop major projects using Open CASCADE Technology, we invite you to study our training, support, and consulting services on our site at https://www.opencascade.com/content/technology-support. Our professional services can maximize the power of your Open CASCADE Technology applications.
+If you want to know more and develop major projects using Open CASCADE Technology, we invite you to study our training, support, and consulting services on our site at https://www.opencascade.com/content/technology-support (commercial product page, URL may change). Our professional services can maximize the power of your Open CASCADE Technology applications.
@section sec6 Appendix
-Complete definition of MakeBottle function (defined in the file src/MakeBottle.cxx of the Tutorial):
+Complete definition of MakeBottle function:
~~~~{.cpp}
TopoDS_Shape MakeBottle(const double myWidth, const double myHeight,
@@ -772,7 +780,16 @@ Complete definition of MakeBottle function (defined in the file src/MakeBottle.c
BRepPrimAPI_MakeCylinder MKCylinder(neckAx2, myNeckRadius, myNeckHeight);
TopoDS_Shape myNeck = MKCylinder.Shape();
- myBody = BRepAlgoAPI_Fuse(myBody, myNeck);
+ BRepAlgoAPI_Fuse aFuser(myBody, myNeck);
+ if (aFuser.IsDone())
+ {
+ myBody = aFuser.Shape();
+ }
+ else
+ {
+ // Fuse failed; proceed with unmodified myBody.
+ // In production code, report the error and handle the failure appropriately.
+ }
// Body : Create a Hollowed Solid
TopoDS_Face faceToRemove;
@@ -782,13 +799,16 @@ Complete definition of MakeBottle function (defined in the file src/MakeBottle.c
TopoDS_Face aFace = TopoDS::Face(aFaceExplorer.Current());
// Check if is the top face of the bottle's neck
occ::handle aSurface = BRep_Tool::Surface(aFace);
- if(aSurface->DynamicType() == STANDARD_TYPE(Geom_Plane)){
+ if(!aSurface.IsNull() && aSurface->DynamicType() == STANDARD_TYPE(Geom_Plane)){
occ::handle aPlane = occ::down_cast(aSurface);
- gp_Pnt aPnt = aPlane->Location();
- double aZ = aPnt.Z();
- if(aZ > zMax){
- zMax = aZ;
- faceToRemove = aFace;
+ if (!aPlane.IsNull())
+ {
+ gp_Pnt aPnt = aPlane->Location();
+ double aZ = aPnt.Z();
+ if(aZ > zMax){
+ zMax = aZ;
+ faceToRemove = aFace;
+ }
}
}
}
@@ -846,4 +866,3 @@ Complete definition of MakeBottle function (defined in the file src/MakeBottle.c
return aRes;
}
~~~~
-
diff --git a/dox/upgrade/upgrade.md b/dox/upgrade/upgrade.md
index 1616d381de..790839dc09 100644
--- a/dox/upgrade/upgrade.md
+++ b/dox/upgrade/upgrade.md
@@ -7,7 +7,7 @@ Upgrade from older OCCT versions {#occt__upgrade}
This document provides technical details on changes made in particular versions of OCCT. It can help to upgrade user applications based on previous versions of OCCT to newer ones.
-@ref upgrade_occt790 "SEEK TO THE LAST CHAPTER (UPGRADE TO 7.9.0)"
+@ref upgrade_occt800 "SEEK TO THE LAST CHAPTER (UPGRADE TO 8.0.0)"
@subsection upgrade_intro_precautions Precautions
@@ -26,987 +26,10 @@ The automatic upgrade tool is provided as is, without warranty of any kind, and
It is your responsibility to ensure that the changes you made in your code are correct.
When you upgrade the code by an automatic script, make sure to carefully review the introduced changes at each step before committing them.
-@section upgrade_65 Upgrade to OCCT 6.5.0
+@section upgrade_pre_7_1 Upgrades pre-7.1.0
-Porting of user applications from an earlier OCCT version to version 6.5 requires taking into account the following major changes:
-* If you are not comfortable with dependence on Intel TBB, FreeImage, or Gl2Ps libraries, you will need to (re)build OCCT with these dependencies disabled.
-* The low-level format version of OCAF binary and XML persistence has been incremented. Hence, the files saved by OCCT 6.5 to OCAF binary or XML format will not be readable by previous versions of OCCT.
-* The *BRepMesh* triangulation algorithm has been seriously revised and now tries hard to fulfill the requested deflection and angular tolerance parameters. If you experience any problems with performance or triangulation quality (in particular, display of shapes in shading mode), consider revising the values of these parameters used in your application.
-* If you were using method *ToPixMap()* of class *V3d_View* to get a buffer for passing to Windows API functions (e.g. *BitBlt*), this will not work anymore. You will need to use method *Image_PixMap::AccessBuffer()* to get the raw buffer data that can be further passed to WinAPI functions.
-* As the processing of message gravity parameter in *Message* package has been improved, some application messages (especially the ones generated by IGES or STEP translators) can be suppressed or new messages appear in the application. Use relevant message level parameter to tune this behavior.
+Detailed upgrade notes for OCCT versions 6.5.0 through 7.0.0 are available in the versioned documentation archives at https://dev.opencascade.org/doc (e.g. https://dev.opencascade.org/doc/occt-7.0.0/overview/html/index.html). Refer to the [OCCT GitHub releases](https://github.com/Open-Cascade-SAS/OCCT/releases) for per-version change logs.
-@section upgrade_651 Upgrade to OCCT 6.5.1
-
-Porting of user applications from an earlier OCCT version to version 6.5.1 requires taking into account the following major changes:
-
-* Method *Graphic3d_Structure::Groups()* now returns *Graphic3d_SequenceOfGroup*. If this method has been used, the application code should be updated to iterate another collection type or, if *Graphic3d_HSetOfGroup* is required, to fill its own collection:
-~~~~{.cpp}
-const NCollection_Sequence>& aGroupsSeq = theStructure.Groups();
-occ::handle aGroupSet = new Graphic3d_HSetOfGroup();
-int aLen = aGroupsSeq.Length();
-for (int aGr = 1; aGr <= aLen; ++aGr)
-{
- aGroupSet->Add (aGroupsSeq.Value (aGr));
-}
-~~~~
-
-* All occurrences of *Select3D_Projector* in the application code (if any) should be replaced with *Handle(Select3D_Projector)*.
-* The code of inheritors of *Select3D_SensitiveEntity* should be updated if they override Matches() (this is probable, if clipping planes are used).
-* Constructor for *V3d_Plane* has been changed, so the extra argument should be removed if used in the application. It is necessary to add a new plane using method *V3d_Viewer::AddPlane()* if *V3d_Viewer* has been used to manage clipping planes list (this does not affect clipping planes representation). Have a look at the source code for new DRAWEXE *vclipplane* command in *ViewerTest_ObjectsCommands.cxx, VClipPlane* to see how clipping planes can be managed in the application.
-
-@section upgrade_652 Upgrade to OCCT 6.5.2
-
-Porting of user applications from an earlier OCCT version to version 6.5.2 requires taking into account the following major changes:
-* Any code that has been generated by WOK from CDL generic classes *Tcollection_DataMap* and *Tcollection_IndexedDataMap* needs to be regenerated by WOK to take into account the change in the interface of these classes.
-* The enumerations *CDF_StoreStatus* and *CDF_RetrievableStatus* have been replaced by the enumerations *PCDM_StoreStatus* and *PCDM_ReaderStatus*. Correspondingly, the methods *Open, Save* and *SaveAs* of the class *TDocStd_Application* have changed their return value. Any code, which uses these enumerations, needs to be updated.
-* *BRepLib_MakeFace* has been modified to receive tolerance value for resolution of degenerated edges. This tolerance parameter has no default value to ensure that the client code takes care of passing a meaningful value, not just *Precision::Confusion*, so some porting overheads are expected.
-* If the callback mechanism in call_togl_redraw function was used in the application code, it is necessary to revise it to take into account the new callback execution and provide a check of reason value of Aspect_GraphicCallbackStruct in callback methods to confirm that the callback code is executed at the right moment. Now the callbacks are executed before redrawing the underlayer, before redrawing the overlayer and at the end of redrawing. The information about the moment when the callback is invoked is provided with the reason value in form of an additional bit flag (OCC_PRE_REDRAW, OCC_PRE_OVERLAY). The state of OpenGl changed in callback methods will not be restored automatically, which might lead to unwanted behavior in redrawing procedure.
-* The print method used in the application code might need to be revised to take into account the ability to choose between print algorithms: tile and stretch. The stretch algorithm will be selected by default during porting.
-* It is recommended to *BRepMesh_DiscretFactory* users, to check *BRepMesh_DiscretFactory::SetDefault()* return value to determine plugin availability / validity. *BRepMesh_DiscretFactory::Discret()* method now returns handle instead of pointer. The code should be updated in the following manner:
-~~~~{.cpp}
-occ::handle aMeshAlgo = BRepMesh_DiscretFactory::Get().Discret (theShape, theDeflection, theAngularToler);
- if (!aMeshAlgo.IsNull()) {}
-~~~~
-
-* The default state of *BRepMesh* parallelization has been turned off. The user should switch this flag explicitly:
- * by using methods *BRepMesh_IncrementalMesh::SetParallel(Standard_True)* for each *BRepMesh_IncrementalMesh* instance before Perform();
- * by calling *BRepMesh_IncrementalMesh::SetParallelDefault(Standard_True)* when *BRepMesh_DiscretFactory* is used to retrieve the meshing tool (this also affects auto-triangulation in *AIS*).
-
-@section upgrade_653 Upgrade to OCCT 6.5.3
-
-Porting of user applications from an earlier OCCT version to version 6.5.3 requires taking into account the following major changes:
-* As a result of code clean-up and redesign of *TKOpenGl* driver, some obsolete functions and rendering primitives (TriangleMesh, TriangleSet, Bezier, Polyline, Polygon, PolygonHoles, QuadrangleMesh and *QuadrangleSet*) have been removed. Instead, the application developers should use primitive arrays that provide the same functionality but are hardware-accelerated. The details can be found in OCCT Visualization User's Guide, “Primitive Arrays” chapter.
-* Applications should not call *AIS_InteractiveObject::SetPolygonOffsets()* method for an instance of *AIS_TexturedShape* class after it has been added to *AIS_InteractiveContext*. More generally, modification of *Graphic3d_AspectFillArea3d* parameters for the computed groups of any *AIS_InteractiveObject* subclass that uses texture mapping should be avoided, because this results in broken texture mapping (see issue 23118). It is still possible to apply non-default polygon offsets to *AIS_TexturedShape* by calling *SetPolygonOffsets()* before displaying the shape.
-* The applications that might have used internal functions provided by *TKOpenGl* or removed primitives will need to be updated.
-* In connection with the implementation of Z-layers it might be necessary to revise the application code or revise the custom direct descendant classes of *Graphic3d_GraphicDriver* and *Graphic3d_StructureManager* to use the Z-layer feature.
-* Global variables *Standard_PI* and *PI* have been eliminated (use macro *M_PI* instead).
-* Method *HashCode()* has been removed from class *Standard_Transient*. It is advisable to use global function HashCode() for Handle objects instead.
-* Declaration of operators new/delete for classes has become consistent and is encapsulated in macros.
-* Memory management has been changed to use standard heap (MMGT_OPT=0) and reentrant mode (MMGT_REENTRANT=1) by default.
-* Map classes in *NCollection* package now receive one more argument defining a hash tool.
-
-@section upgrade_654 Upgrade to OCCT 6.5.4
-
-Porting of user applications from an earlier OCCT version to version 6.5.4 requires taking into account the following major changes:
-* The code using obsolete classes *Aspect_PixMap, Xw_PixMap* and *WNT_PixMap* should be rewritten implementing class *Image_PixMap*, which is now retrieved by *ToPixMap* methods as argument. A sample code using *ToPixMap* is given below:
-~~~~{.cpp}
-#include
-void dump (occ::handle& theView3D)
-{
- int aWndSizeX = 0;
- int aWndSizeY = 0;
- theView3D->Window()->Size (aWndSizeX, aWndSizeY);
- Image_AlienPixMap aPixMap;
- theView3D->ToPixMap (aPixMap, aWndSizeX, aWndSizeY);
- aPixMap.Save ("c:\\image.png");
-}
-~~~~
-* Now OpenGL resources related to Interactive Objects are automatically freed when the last view (window) is removed from graphical driver.
-To avoid presentation data loss, the application should replace an old view with a new one in the proper order: first the new view is created and activated and only then the old one is detached and removed.
-* It is recommended to use *NCollection* containers with hasher parameter (introduced in 6.5.3) instead of global definition IsEqual()/HashCode() as well as to use explicit namespaces to avoid name collision.
-
-
-@section upgrade_660 Upgrade to OCCT 6.6.0
-
-Porting of user applications from an earlier OCCT version to version 6.6.0 requires taking into account the following major changes:
-* Due to the changes in the implementation of Boolean Operations, the order of sub-shapes resulting from the same operation performed with OCCT 6.5.x and OCCT 6.6.0 can be different.
-It is necessary to introduce the corresponding changes in the applications for which the order of sub-shapes resulting from a Boolean operation is important. It is strongly recommended to use identification methods not relying on the order of sub-shapes (e.g. OCAF naming).
-* If you need to use OCCT on Mac OS X with X11 (without Cocoa), build OCCT with defined pre-processor macro *CSF_MAC_USE_GLX11*. XLib front-end (previously the only way for unofficial OCCT builds on Mac OS X) is now disabled by default on this platform. If your application has no support for Cocoa framework you may build OCCT with XLib front-end adding *MACOSX_USE_GLX* macro to compiler options (you may check the appropriate option in WOK configuration GUI and in CMake configuration). Notice that XQuartz (XLib implementation for Mac OS X) now is an optional component and does not provide a sufficient level of integrity with native (Cocoa-based) applications in the system. It is not possible to build OCCT with both XLib and Cocoa at the same time due to symbols conflict in OpenGL functions.
-* Animation mode and degeneration presentation mode (simplified presentation for animation) and associated methods have been removed from 3D viewer functionality.
-Correspondingly, the code using methods *SetAnimationModeOn(), SetAnimationModeOff(), AnimationModeIsOn(), AnimationMode(), Tumble(), SetDegenerateModeOn(), SetDegenerateModeOff()* and *DegenerateModeIsOn()* of classes *V3d_View* and *Visual3d_View* will need to be removed or redesigned. Hidden Line Removal presentation was not affected; however, the old code that used methods *V3d_View::SetDegenerateModeOn* or *V3d_View::SetDegenerateModeOff* to control HLR presentation should be updated to use *V3d_View::SetComputedMode* method instead.
-* Calls of *Graphic3d_Group::BeginPrimitives()* and *Graphic3d_Group::EndPrimitives()* should be removed from the application code.
-* Application functionality for drawing 2D graphics that was formerly based on *TKV2d* API should be migrated to *TKV3d* API. The following changes are recommended for this migration:
- * A 2D view can be implemented as a *V3d_View* instance belonging to *V3d_Viewer* managed by *AIS_InteractiveContext* instance. To turn *V3d_View* into a 2D view, the necessary view orientation should be set up at the view initialization stage using *V3d_View::SetProj()* method, and view rotation methods simply should not be called.
- * Any 2D graphic entity (formerly represented with *AIS2D_InteractiveObject*) should become a class derived from *AIS_InteractiveObject* base. These entities should be manipulated in a view using *AIS_InteractiveContext* class API.
- * All drawing code should be put into *Compute()* virtual method of a custom interactive object class and use API of *Graphic3d* package. In particular, all geometry should be drawn using class hierarchy derived from *Graphic3d_ArrayOfPrimitives*. Normally, the Z coordinate for 2D geometry should be constant, unless the application implements some advanced 2D drawing techniques like e.g. multiple "Z layers" of drawings.
- * Interactive selection of 2D presentations should be set up inside *ComputeSelection()* virtual method of a custom interactive object class, using standard sensitive entities from *Select3D* package and standard or custom entity owners derived from *SelectMgr_EntityOwner* base.
-Refer to the Visualization User's Guide for further details concerning OCCT 3D visualization and selection classes. See also *Viewer2D* OCCT sample application, which shows how 2D drawing can be implemented using TKV3d API.
-* Run-time graphic driver library loading mechanism based on *CSF_GraphicShr* environment variable usage has been replaced by explicit linking against *TKOpenGl* library. The code sample below shows how the graphic driver should be created and initialized in the application code:
-~~~~{.cpp}
-// initialize a new viewer with OpenGl graphic driver
-occ::handle aGraphicDriver =
-new OpenGl_GraphicDriver ("TKOpenGl");
- aGraphicDriver->Begin (new Aspect_DisplayConnection());
- TCollection_ExtendedString aNameOfViewer ("Visu3D");
- occ::handle aViewer
-= new V3d_Viewer (aGraphicDriver, aNameOfViewer.ToExtString());
- aViewer->Init();
-
-// create a new window or a wrapper over the existing window,
-// provided by a 3rd-party framework (Qt, MFC, C# or Cocoa)
-#if defined(_WIN32) || defined(__WIN32__)
- Aspect_Handle aWindowHandle = (Aspect_Handle )winId();
- occ::handle aWindow = new WNT_Window (winId());
-#elif defined(__APPLE__) && !defined(MACOSX_USE_GLX)
- NSView* aViewHandle = (NSView* )winId();
- occ::handle aWindow = new Cocoa_Window (aViewHandle);
-#else
- Aspect_Handle aWindowHandle = (Aspect_Handle )winId();
- occ::handle aWindow =
- new Xw_Window (aGraphicDriver->GetDisplayConnection(), aWindowHandle);
-#endif // WNT
-
-// setup the window for a new view
- occ::handle aView = aViewer->CreateView();
- aView->SetWindow (aWindow);
-~~~~
-
-* The following changes should be made in the application-specific implementations of texture aspect:
- * *Graphic3d_TextureRoot* inheritors now should return texture image by overloading of *Graphic3d_TextureRoot::GetImage()* method instead of the old logic.
- * Now you can decide if the application should store the image copy as a field of property or reload it dynamically each time (to optimize the memory usage). The default implementation (which loads the image content from the provided file path) does not hold an extra copy since it will be uploaded to the graphic memory when first used.
- * Notice that the image itself should be created within *Image_PixMap* class from *AlienImage* package, while *Image_Image* class is no more supported and will be removed in the next OCCT release.
-
-@section upgrade_670 Upgrade to OCCT 6.7.0
-
-Porting of user applications from an earlier OCCT version to version 6.7.0 requires taking into account the following major changes.
-
-@subsection upgrade_670_clipping Object-level clipping and capping algorithm.
-
-* It might be necessary to revise and port code related to management of view-level clipping to use *Graphic3d_ClipPlane* instead of *V3d_Plane* instances. Note that *V3d_Plane* class has been preserved -- as previously, it can be used as plane representation. Another approach to represent *Graphic3d_ClipPlane* in a view is to use custom presentable object.
-* The list of arguments of *Select3D_SensitiveEntity::Matches()* method for picking detection has changed. Since now, for correct selection clipping, the implementations should perform a depth clipping check and return (as output argument) minimum depth value found at the detected part of sensitive. Refer to CDL / Doxygen documentation to find descriptive hints and snippets.
-* *Select3D_SensitiveEntity::ComputeDepth()* abstract method has been removed. Custom implementations should provide depth checks by method *Matches()* instead -- all data required for it is available within a scope of single method.
-* It might be necessary to revise the code of custom sensitive entities and port *Matches()* and *ComputeDepth()* methods to ensure proper selection clipping. Note that obsolete signature of *Matches* is not used anymore by the selector. If your class inheriting *Select3D_SensitiveEntity* redefines the method with old signature the code should not compile as the return type has been changed. This is done to prevent override of removed methods.
-
-@subsection upgrade_670_markers Redesign of markers presentation
-
-* Due to the redesign of *Graphic3d_AspectMarker3d* class the code of custom markers initialization should be updated. Notice that you can reuse old markers definition code as *TColStd_HArray1OfByte*; however, *Image_PixMap* is now the preferred way (and supports full-color images on modern hardware).
-* Logics and arguments of methods *AIS_InteractiveContext::Erase()* and *AIS_InteractiveContext::EraseAll()* have been changed. Now these methods do not remove resources from *Graphic3d_Structure*; they simply change the visibility flag in it. Therefore, the code that deletes and reсomputes resources should be revised.
-* *Graphic3d_Group::MarkerSet()* has been removed. *Graphic3d_Group::AddPrimitiveArray()* should be used instead to specify marker(s) array.
-
-@subsection upgrade_670_views Default views are not created automatically
-
-As the obsolete methods *Init(), DefaultOrthographicView()* and *DefaultPerspectiveView()* have been removed from *V3d_Viewer* class, the two default views are no longer created automatically. It is obligatory to create *V3d_View* instances explicitly, either directly by operator new or by calling *V3d_Viewer::CreateView()*.
-
-The call *V3d_Viewer::SetDefaultLights()* should also be done explicitly at the application level, if the application prefers to use the default light source configuration. Otherwise, the application itself should set up the light sources to obtain a correct 3D scene.
-
-@subsection upgrade_670_dimensions Improved dimensions implementation
-
-* It might be necessary to revise and port code related to management of *AIS_LengthDimension, AIS_AngleDimension* and *AIS_DiameterDimension* presentations. There is no more need to compute value of dimension and pass it as string to constructor argument. The value is computed internally. The custom value can be set with *SetCustomValue()* method.
-* The definition of units and general aspect properties is now provided by *Prs3d_DimensionUnits* and *Prs3d_DimensionApsect* classes.
-* It might be also necessary to revise code of your application related to usage of *AIS_DimensionDisplayMode enumeration*. If it used for specifying the selection mode, then it should be replaced by a more appropriate enumeration *AIS_DimensionSelectionMode*.
-
-@subsection upgrade_670_list_collection NCollection_Set replaced by List collection
-
-It might be necessary to revise your application code, which uses non-ordered *Graphic3d_SetOfHClipPlane* collection type and replace its occurrences by ordered *Graphic3d_SequenceOfHClipPlane* collection type.
-
-
-@section upgrade_680 Upgrade to OCCT 6.8.0
-
-Porting of user applications from an earlier OCCT version to version 6.8.0 requires taking into account the following major changes.
-
-@subsection upgrade_680_ncollection Changes in NCollection classes
-
-Method *Assign()* in *NCollection* classes does not allow any more copying between different collection types. Such copying should be done manually.
-
-List and map classes in *NCollection* package now require that their items be copy-constructible, but do not require items to have default constructor. Thus the code using *NCollection* classes for non-copy-constructible objects needs be updated. One option is to provide copy constructor; another possibility is to use Handle or other smart pointer.
-
-@subsection upgrade_680_view_camera 3D View Camera
-
-If *ViewMapping* and *ViewOrientation* were used directly, this functionality has to be ported to the new camera model. The following methods should be considered as an alternative to the obsolete *Visual3d* services (all points and directions are supposed to be in world coordinates):
-* *Graphic3d_Camera::ViewDimensions()* or *V3d_View::Size()/ZSize()* -- returns view width, height and depth (or "Z size"). Since the view is symmetric now, you can easily compute top, bottom, left and right limits. *Graphic3d_Camera::ZNear()/ZFar()* can be used to obtain the near and far clipping distances with respect to the eye.
-* *Graphic3d_Camera::Up()* or *V3d_View::Up()* -- returns Y direction of the view.
-* *Graphic3d_Camera::Direction()* returns the reverse view normal directed from the eye, *V3d_View::Proj()* returns the old-style view normal.
-* *Graphic3d_Camera::Eye()* or *V3d_View::Eye()* -- returns the camera position (same as projection reference point in old implementation).
-* *Graphic3d_Camera::Center()* or *V3d_View::At()* -- returns the point the camera looks at (or view reference point according to old terminology).
-
-The current perspective model is not fully backward compatible, so the old perspective-related functionality needs to be reviewed.
-
-Revise application-specific custom presentations to provide a proper bounding box, otherwise the object might become erroneously clipped by automatic *ZFit* or frustum culling algorithms enabled by default.
-
-@subsection upgrade_680_connected_objects Redesign of Connected Interactive Objects
-
-The new implementation of connected Interactive Objects makes it necessary to take the following steps if you use connected Interactive Objects in your application.
-* Use new *PrsMgr_PresentableObject* transformation API.
-* Call *RemoveChild()* from the original object after connect if you need the original object and *AIS_ConnectedInteractive* to move independently.
-* Access instances of objects connected to *AIS_MultiplyConnectedInteractive* with *Children()* method.
-* For *PrsMgr_PresentableObject* transformation:
- * *SetLocation (TopLoc_Location) -> SetLocalTransformation (gp_Trsf)*
- * *Location -> LocalTransformation*
- * *HasLocation -> HasTransformation*
- * *ResetLocation -> ResetTransformation*
-
-@subsection upgrade_680_unicode Support of UNICODE Characters
-
-Support of UNICODE characters introduced in OCCT breaks backward compatibility with applications, which currently use filenames in extended ASCII encoding bound to the current locale. Such applications should be updated to convert such strings to UTF-8 format.
-
-The conversion from UTF-8 to wchar_t is made using little-endian approach. Thus, this code will not work correctly on big-endian platforms. It is needed to complete this in the way similar as it is done for binary persistence (see the macro *DO_INVERSE* in *FSD_FileHeader.hxx).*
-
-@subsection upgrade_680_projection_shift Elimination of Projection Shift Concept
-
-It might be necessary to revise the application code, which deals with *Center()* method of *V3d_View*.
-
-This method was used to pan a *V3d* view by virtually moving the screen center with respect to the projection ray passed through Eye and At points. There is no more need to derive the panning from the Center parameter to get a camera-like eye position and look at the coordinates. *Eye()* and *At()* now return these coordinates directly. When porting code dealing with *Center()*, the parameters *Eye()* and *At()* can be adjusted instead. Also *V3d_View::SetCenter(Xpix, Ypix)* method can be used instead of *V3d_View::Center(X, Y)* to center the view at the given point. However, if the center coordinates X and Y come from older OCCT releases, calling *V3d_View::Panning(-X, -Y)* can be recommended to compensate missing projection shift effect.
-
-There are several changes introduced to *Graphic3d_Camera*. The internal data structure of the camera is based on *Standard_Real* data types to avoid redundant application-level conversions and precision errors. The transformation matrices now can be evaluated both for *Standard_Real* and *Standard_ShortReal* value types. *ZNear* and *ZFar* planes can be either negative or positive for orthographic camera projection, providing a trade-off between the camera distance and the range of *ZNear* or *ZFar* to reduce difference of exponents of values composing the orientation matrix - to avoid calculation errors. The negative values can be specified to avoid Z-clipping if the reference system of camera goes inside of the model when decreasing camera distance.
-
-The auto z fit mode, since now, has a parameter defining Z-range margin (the one which is usually passed as argument to *ZFitAll()* method). The methods *SetAutoZFitMode(), AutoZFitScaleFactor()* and *ZFitAll()* from class *V3d_View* deal with the new parameter.
-
-The class *Select3D_Projector* now supports both orientation and projection transformation matrices, which can be naturally set for the projector. The definition of projector was revised in *StdSelect_ViewerSelector3d*: perspective and orthographic projection parameters are handled properly. Orthographic projector is based only on direction of projection - no more *Center* property. This makes it possible to avoid unnecessary re-projection of sensitive while panning, zooming or moving along the projection ray of the view. These operations do not affect the orthographic projection.
-
-
-@section upgrade_690 Upgrade to OCCT 6.9.0
-
-Porting of user applications from an earlier OCCT version to version 6.9.0 requires taking into account the following major changes.
-
-@subsection upgrade_690_shaders 3D Viewer initialization
-
-3D Viewer now uses GLSL programs for managing frame buffer and stereoscopic output.
-For proper initialization, application should configure **CSF_ShadersDirectory** environment variable pointing to a folder with GLSL resources - files from folder **CASROOT**/src/Shaders.
-*Note that **CSF_ShadersDirectory** become optional since OCCT 7.1.0 release*.
-
-@subsection upgrade_690_selection Changes in Selection
-
-Selection mechanism of 3D Viewer has been redesigned to use 3-level BVH tree traverse directly in 3D space instead of projection onto 2D screen space (updated on each rotation). This architectural redesign may require appropriate changes at application level in case if custom Interactive Objects are used.
-
-#### Standard selection
-Usage of standard OCCT selection entities would require only minor updates.
-
-Custom Interactive Objects should implement new virtual method *SelectMgr_SelectableObject::BoundingBox().*
-
-Now the method *SelectMgr_Selection::Sensitive()* does not return *SelectBasics_SensitiveEntity*. It returns an instance of *SelectMgr_SensitiveEntity*, which belongs to a different class hierarchy (thus *DownCast()* will fail). To access base sensitive it is necessary to use method *SelectMgr_SensitiveEntity::BaseSensitive()*. For example:
-
-~~~~{.cpp}
-occ::handle aSelection = anInteractiveObject->Selection (aMode);
-for (aSelection->Init(); aSelection->More(); aSelection->Next())
-{
- occ::handle anEntity = aSelection->Sensitive()->BaseSensitive();
-}
-~~~~
-
-#### Custom sensitive entities
-
-Custom sensitive entities require more complex changes, since the selection algorithm has been redesigned and requires different output from the entities.
-
-The method *SelectBasics_SensitiveEntity::Matches()* of the base class should be overridden following the new signature:
-
-*Standard_Boolean Matches (SelectBasics_SelectingVolumeManager& theMgr, SelectBasics_PickResult& thePickResult)*, where *theMgr* contains information about the currently selected frustum or set of frustums (see *SelectMgr_RectangularFrustum, SelectMgr_TrangularFrustum, SelectMgr_TriangularFrustumSet)* and *SelectBasics_PickResult* is an output parameter, containing information about the depth of the detected entity and distance to its center of geometry.
-
-In the overridden method it is necessary to implement an algorithm of overlap and inclusion detection (the active mode is returned by *theMgr.IsOverlapAllowed()*) with triangular and rectangular frustums.
-
-The depth and distance to the center of geometry must be calculated for the 3D projection of user-picked screen point in the world space. You may use already implemented overlap and inclusion detection methods for different primitives from *SelectMgr_RectangularFrustum* and *SelectMgr_TriangularFrustum*, including triangle, point, axis-aligned box, line segment and planar polygon.
-
-Here is an example of overlap/inclusion test for a box:
-
-~~~~{.cpp}
-if (!theMgr.IsOverlapAllowed()) // check for inclusion
-{
- bool isInside = true;
- return theMgr.Overlaps (myBox.CornerMin(), myBox.CornerMax(), &isInside) && isInside;
-}
-
-double aDepth;
-if (!theMgr.Overlaps (myBox, aDepth)) // check for overlap
-{
- return false;
-}
-
-thePickResult =
-SelectBasics_PickResult (aDepth, theMgr.DistToGeometryCenter (myCenter3d));
-~~~~
-
-The interface of *SelectBasics_SensitiveEntity* now contains four new pure virtual functions that should be implemented by each custom sensitive:
-* BoundingBox() – returns a bounding box of the entity;
-* Clear() – clears up all the resources and memory allocated for complex sensitive entities;
-* BVH() – builds a BVH tree for complex sensitive entities, if it is needed;
-* NbSubElements() – returns atomic sub-entities of a complex sensitive entity, which will be used as primitives for BVH building. If the entity is simple and no BVH is required, this method returns 1.
-
-Each sensitive entity now has its own tolerance, which can be overridden by method *SelectBasics_SensitiveEntity::SetSensitivityFactor()* called from constructor.
-
-
-@subsection upgrade_690_adaptor3d-curve Changes in Adaptor3d_Curve class
-
-All classes inheriting *Adaptor3d_Curve* (directly or indirectly) must be updated in application code to use new signature of methods *Intervals()* and *NbIntervals()*. Note that no compiler warning will be generated if this is not done.
-
-@subsection upgrade_690_v3d_view Changes in V3d_View class
-
-The methods *V3d_View::Convert* and *V3d_View::ConvertWithProj()* have ceased to return point on the active grid. It might be necessary to revise the code of your application so that *V3d_View::ConvertToGrid()* was called explicitly for the values returned by *V3d_View::Convert* to get analogous coordinates on the grid. The methods *V3d_View::Convert* and *V3d_View::ConvertWithProj* convert point into reference plane of the view corresponding to the intersection with the projection plane of the eye/view point vector.
-
-@section upgrade_700 Upgrade to OCCT 7.0.0
-
-Porting of user applications from an earlier OCCT version to version 7.0.0 requires taking into account the following major changes.
-
-Building OCCT now requires compiler supporting some C++11 features.
-The supported compilers are:
-- MSVC: version 10 (Visual Studio 2010) or later
-- GCC: version 4.3 or later
-- CLang: version 3.6 or later
-- ICC: version XE 2013 SP 1 or later
-
-When compiling code that uses OCCT with GCC and CLang compilers, it is necessary to use compiler option -std=c++0x (or its siblings) to enable C++11 features.
-
-@subsection upgrade_700_persist Removal of legacy persistence
-
-Legacy persistence for shapes and OCAF data based on *Storage_Schema* (toolkits *TKPShape*, *TKPLCAF*, *TKPCAF*, *TKShapeShcema, TLStdLSchema, TKStdSchema*, and *TKXCAFSchema*) has been removed in OCCT 7.0.0.
-The applications that used these data persistence tools need to be updated to use other persistence mechanisms.
-
-@note For compatibility with previous versions, the possibility to read standard OCAF data (*TKLCAF* and *TKCAF*) from files stored in the old format is preserved (toolkits *TKStdL* and *TKStd*).
-
-The existing data files in standard formats can be converted using OCCT 6.9.1 or a previous version, as follows.
-
-@note Reading / writing custom files capability from OCCT 6.9.1 is restored in OCCT 7.2.0. See details in @ref upgrade_720_persistence section.
-
-#### CSFDB files
-
-Files in *CSFDB* format (usually with extension .csfdb) contain OCCT shape data that can be converted to BRep format.
-The easiest way to do that is to use ImportExport sample provided with OCCT 6.9.0 (or earlier):
-
-- Start ImportExport sample;
-- Select File / New;
-- Select File / Import / CSFDB... and specify the file to be converted;
-- Drag the mouse with the right button pressed across the view to select all shapes by the rectangle;
-- Select File / Export / BREP... and specify the location and name for the resulting file
-
-#### OCAF and XCAF documents
-
-Files containing OCAF data saved in the old format usually have extensions .std, .sgd or .dxc (XDE documents).
-These files can be converted to XML or binary OCAF formats using DRAW Test Harness commands.
-Note that if the file contains only attributes defined in *TKLCAF* and *TKCAF*, this action can be performed in OCCT 7.0; otherwise OCCT 6.9.1 or earlier should be used.
-
-For that, start *DRAWEXE* and perform the following commands:
-
- * To convert *.std and *.sgd file formats to binary format *.cbf (The created document should be in *BinOcaf* format instead of *MDTV-Standard*):
-
- @code
- Draw[]> pload ALL
- Draw[]> Open [path to *.std or *.sgd file] Doc
- Draw[]> Format Doc BinOcaf
- Draw[]> SaveAs Doc [path to the new file]
- @endcode
-
- * To convert *.dxc file format to binary format *.xbf (The created document should be in *BinXCAF* format instead of *MDTV-XCAF*):
-
- @code
- Draw[]> pload ALL
- Draw[]> XOpen [path to *.dxc file] Doc
- Draw[]> Format Doc BinXCAF
- Draw[]> XSave Doc [path to the new file]
- @endcode
-
-On Windows, it is necessary to replace back slashes in the file path by direct slashes or pairs of back slashes.
-
-Use *XmlOcaf* or *XmlXCAF* instead of *BinOcaf* and *BinXCAF*, respectively, to save in XML format instead of binary one.
-
-@subsection upgrade_occt700_cdl Removal of CDL and WOK
-
-OCCT code has been completely refactored in version 7.0 to get rid of obsolete technologies used since its inception: CDL (Cas.Cade Definition Language) and WOK (Workshop Organization Kit).
-
-C++ code previously generated by WOK from CDL declarations is now included directly in OCCT sources.
-
-This modification did not change names, API, and behavior of existing OCCT classes, thus in general the code based on OCCT 6.x should compile and work fine with OCCT 7.0.
-However, due to redesign of basic mechanisms (CDL generic classes, Handles and RTTI) using C++ templates, some changes may be necessary in the code when porting to OCCT 7.0, as described below.
-
-WOK is not necessary anymore for building OCCT from sources, though it still can be used in a traditional way -- auxiliary files required for that are preserved.
-The recommended method for building OCCT 7.x is CMake, see @ref build_occt_win_cmake.
-The alternative solution is to use project files generated by OCCT legacy tool **genproj**, see @ref build_occt_genproj.
-
-@subsubsection upgrade_occt700_cdl_auto Automatic upgrade
-
-Most of typical changes required for upgrading code for OCCT 7.0 can be done automatically using the *upgrade* tool included in OCCT 7.0.
-This tool is a Tcl script, thus Tcl should be available on your workstation to run it.
-
-Example:
-~~~~{.php}
- $ tclsh
- % source /adm/upgrade.tcl
- % upgrade -recurse -all -src=
-~~~~
-
-On Windows, the helper batch script *upgrade.bat* can be used, provided that Tcl is either available in *PATH*, or configured via *custom.bat* script (for instance, if you use OCCT installed from Windows installer package). Start it from the command prompt:
-
-~~~~
-cmd> \upgrade.bat -recurse -all -inc=\inc -src= [options]
-~~~~
-
-Run the upgrade tool without arguments to see the list of available options.
-
-The upgrade tool performs the following changes in the code.
-
-1. Replaces macro *DEFINE_STANDARD_RTTI* by *DEFINE_STANDARD_RTTIEXT*, with second argument indicating base class for the main argument class (if inheritance is recognized by the script):
-~~~~{.cpp}
-DEFINE_STANDARD_RTTI(Class) -> DEFINE_STANDARD_RTTIEXT(Class, Base)
-~~~~
-
- @note If macro *DEFINE_STANDARD_RTTI* with two arguments (used in intermediate development versions of OCCT 7.0) is found, the script will convert it to either *DEFINE_STANDARD_RTTIEXT* or *DEFINE_STANDARD_RTTI_INLINE*.
- The former case is used if current file is header and source file with the same name is found in the same folder.
- In this case, macro *IMPLEMENT_STANDARD_RTTI* is injected in the corresponding source file.
- The latter variant defines all methods for RTTI as inline, and does not require *IMPLEMENT_STANDARD_RTTIEXT* macro.
-
-2. Replaces forward declarations of collection classes previously generated from CDL generics (defined in *TCollection* package) by inclusion of the corresponding header:
-~~~~{.cpp}
-class NCollection_Array1; -> #include .hxx>
-~~~~
-
-3. Replaces underscored names of *Handle* classes by usage of a macro:
-~~~~{.cpp}
-Handle_Class -> occ::handle
-~~~~
- This change is not applied if the source or header file is recognized as containing the definition of Qt class with signals or slots, to avoid possible compilation errors of MOC files caused by inability of MOC to recognize macros (see https://doc.qt.io/qt-4.8/signalsandslots.html).
- The file is considered as defining a Qt object if it contains strings *Q_OBJECT* and either *slots:* or *signals:*.
-
-4. Removes forward declarations of classes with names Handle(C) or *Handle_C*, replacing them either by forward declaration of its argument class, or (for files defining Qt objects) \#include statement for a header with the name of the argument class and extension .hxx:
-~~~~{.cpp}
-class occ::handle>; -> #include .hxx>
-~~~~
-
-5. Removes \#includes of files Handle_...hxx that have disappeared in OCCT 7.0:
-~~~~{.cpp}
-#include ->
-~~~~
-
-6. Removes *typedef* statements that use *Handle* macro to generate the name:
-~~~~{.cpp}
-typedef NCollection_Handle occ::handle; ->
-~~~~
-
-7. Converts C-style casts applied to Handles into calls to DownCast() method:
-~~~~{.cpp}
- ((occ::handle&)b) -> occ::down_cast(b)
- (occ::handle&)b -> occ::down_cast(b)
- (*((occ::handle*)&b)) -> occ::down_cast(b)
- *((occ::handle*)&b) -> occ::down_cast(b)
- (*(occ::handle*)&b) -> occ::down_cast(b)
-~~~~
-
-8. Moves Handle() macro out of namespace scope:
-~~~~{.cpp}
-Namespace::occ::handle -> Handle(Namespace::Class)
-~~~~
-
-9. Converts local variables of reference type, which are initialized by a temporary object returned by call to DownCast(), to the variables of non-reference type (to avoid using references to destroyed memory):
-~~~~{.cpp}
- const occ::handle& a = Handle(B)::DownCast (b); -> occ::handle a (Handle(B)::DownCast (b));
-~~~~
-
-10. Adds \#include for all classes used as argument to macro STANDARD_TYPE(), except for already included ones;
-
-11. Removes uses of obsolete macros *IMPLEMENT_DOWNCAST* and *IMPLEMENT_STANDARD_*..., except *IMPLEMENT_STANDARD_RTTIEXT*.
-
- @note If you plan to keep compatibility of your code with older versions of OCCT, add option -compat to avoid this change. See also @ref upgrade_occt700_cdl_compat.
-
-.
-
-As long as the upgrade routine runs, some information messages are sent to the standard output.
-In some cases the warnings or errors like the following may appear:
-
-~~~~
- Error in {HEADER_FILE}: Macro DEFINE_STANDARD_RTTI used for class {CLASS_NAME} whose declaration is not found in this file, cannot fix
-~~~~
-
-Be sure to check carefully all reported errors and warnings, as the corresponding code will likely require manual corrections.
-In some cases these messages may help you to detect errors in your code, for instance, cases where *DEFINE_STANDARD_RTTI* macro is used with incorrect class name as an argument.
-
-@subsubsection upgrade_occt700_cdl_compiler Possible compiler errors
-
-Some situations requiring upgrade cannot be detected and / or handled by the automatic procedure.
-If you get compiler errors or warnings when trying to build the upgraded code, you will need to fix them manually.
-The following paragraphs list known situations of this kind.
-
-#### Missing header files
-
-The use of handle objects (construction, comparison using operators == or !=, use of function STANDRAD_TYPE() and method DownCast()) now requires the type of the object pointed by Handle to be completely known at compile time. Thus it may be necessary to include header of the corresponding class to make the code compilable.
-
-For example, the following lines will fail to compile if *Geom_Line.hxx* is not included:
-
-~~~~{.cpp}
-occ::handle aLine = 0;
-if (aLine != aCurve) {...}
-if (aCurve->IsKind(STANDARD_TYPE(Geom_Line)) {...}
-aLine = Handle(Geom_Line)::DownCast (aCurve);
-~~~~
-
-Note that it is not necessary to include header of the class to declare Handle to it.
-However, if you define a class *B* that uses Handle(*A*) in its fields, or contains a method returning Handle(*A*), it is advisable to have header defining *A* included in the header of *B*.
-This will eliminate the need to include the header *A* in each source file where class *B* is used.
-
-#### Ambiguity of calls to overloaded functions
-
-This issue appears in the compilers that do not support default arguments in template functions (known cases are Visual C++ 10 and 11): the compiler reports an ambiguity error if a handle is used in the argument of a call to the function that has two or more overloaded versions, receiving handles to different types.
-The problem is that operator const handle& is defined for any type *T2*, thus the compiler cannot make the right choice.
-
-Example:
-~~~~{.cpp}
-void func (const occ::handle&);
-void func (const occ::handle&);
-
-occ::handle aCurve = new Geom_TrimmedCurve (...);
-func (aCurve); // ambiguity error in VC++ 10
-~~~~
-
-Note that this problem can be avoided in many cases if macro *OCCT_HANDLE_NOCAST* is used, see @ref upgrade_occt700_cdl_nocast "below".
-
-To resolve this ambiguity, change your code so that argument type should correspond exactly to the function signature.
-In some cases this can be done by using the relevant type for the corresponding variable, like in the example above:
-
-~~~~{.cpp}
-occ::handle aCurve = new Geom_TrimmedCurve (...);
-~~~~
-
-Other variants consist in assigning the argument to a local variable of the correct type and using the direct cast or constructor:
-
-~~~~{.cpp}
-const occ::handle& aGCurve (aTrimmedCurve);
-func (aGCurve); // OK - argument has exact type
-func (static_cast(aCurve)); // OK - direct cast
-func (occ::handle(aCurve)); // OK - temporary handle is constructed
-~~~~
-
-Another possibility consists in defining additional template variant of the overloaded function causing ambiguity, and using *SFINAE* to resolve the ambiguity.
-This technique can be illustrated by the definition of the template variant of method IGESData_IGESWriter::Send().
-
-#### Lack of implicit cast to base type
-
-As the cast of a handle to the reference to another handle to the base type has become a user-defined operation, the conversions that require this cast together with another user-defined cast will not be resolved automatically by the compiler.
-
-For example:
-
-~~~~{.cpp}
-occ::handle aC = GC_MakeLine (p, v); // compiler error
-~~~~
-
-The problem is that the class *GC_MakeLine* has a user-defined conversion to const Handle(Geom_TrimmedCurve)&, which is not the same as the type of the local variable *aC*.
-
-To resolve this, use method Value():
-
-~~~~{.cpp}
-occ::handle aC = GC_MakeLine (p, v).Value(); // ok
-~~~~
-
-or use variable of the appropriate type:
-
-~~~~{.cpp}
-occ::handle aC = GC_MakeLine (p, v); // ok
-~~~~
-
-A similar problem appears with GCC compiler, when *const* handle to derived type is used to construct handle to base type via assignment (and in some cases in return statement), for instance:
-
-~~~~{.cpp}
- const occ::handle aLine;
- occ::handle c1 = aLine; // GCC error
- occ::handle c2 (aLine); // ok
-~~~~
-
-This problem is specific to GCC and it does not appear if macro *OCCT_HANDLE_NOCAST* is used, see @ref upgrade_occt700_cdl_nocast "below".
-
-#### Incorrect use of STANDARD_TYPE and Handle macros
-
-You might need to clean your code from incorrect use of macros *STANDARD_TYPE*() and *Handle*().
-
-1. Explicit definitions of static functions with names generated by macro *STANDARD_TYPE()*, which are artifacts of old implementation of RTTI, should be removed.
-
- Example:
-~~~~{.cpp}
-const occ::handle& STANDARD_TYPE(math_GlobOptMin)
-{
- static occ::handle _atype = new Standard_Type ("math_GlobOptMin", sizeof (math_GlobOptMin));
- return _atype;
-}
-~~~~
-
-2. Incorrect location of closing parenthesis of *Handle()* macro that was not detectable in OCCT 6.x will cause a compiler error and must be corrected.
-
- Example (note misplaced closing parenthesis):
-~~~~{.cpp}
-aBSpline = Handle( Geom2d_BSplineCurve::DownCast(BS->Copy()) );
-~~~~
-
-#### Use of class Standard_AncestorIterator
-
-Class *Standard_AncestorIterator* has been removed; use method *Parent()* of *Standard_Type* class to parse the inheritance chain.
-
-#### Absence of cast to Standard_Transient*
-
-Handles in OCCT 7.0 do not have the operator of conversion to Standard_Transient*, which was present in earlier versions.
-This is done to prevent possible unintended errors like this:
-
-~~~~{.cpp}
-occ::handle aLine = ...;
-occ::handle aSurf = ...;
-...
-if (aLine == aSurf) {...} // will cause a compiler error in OCCT 7.0, but not OCCT 6.x
-~~~~
-
-The places where this implicit cast has been used should be corrected manually.
-The typical situation is when Handle is passed to stream:
-
-~~~~{.cpp}
-occ::handle aLine = ...;
-os << aLine; // in OCCT 6.9.0, resolves to operator << (void*)
-~~~~
-
-Call method get() explicitly to output the address of the Handle.
-
-#### Method DownCast for non-base types
-
-Method *DownCast()* in OCCT 7.0 is made templated; if its argument is not a base class, "deprecated" compiler warning is generated.
-This is done to prevent possible unintended errors like this:
-
-~~~~{.cpp}
-occ::handle aSurf = ;
-occ::handle aLine =
- Handle(Geom_Line)::DownCast (aSurf); // will cause a compiler warning in OCCT 7.0, but not OCCT 6.x
-~~~~
-
-The places where this cast has been used should be corrected manually.
-
-If down casting is used in a template context where the argument can have the same or unrelated type so that *DownCast()* may be not available in all cases, use C++ *dynamic_cast<>* instead, e.g.:
-
-~~~~{.cpp}
-template
-bool CheckLine (const occ::handle theArg)
-{
- occ::handle aLine = dynamic_cast (theArg.get());
- ...
-}
-~~~~
-
-@subsubsection upgrade_occt700_cdl_runtime Possible runtime problems
-
-Here is the list of known possible problems at run time after the upgrade to OCCT 7.0.
-
-#### References to temporary objects
-
-In previous versions, the compiler was able to detect the situation when a local variable of a "reference to a Handle" type is initialized by temporary object, and ensured that lifetime of that object is longer than that of the variable.
-In OCCT 7.0 with default options, it will not work if types of the temporary object and variable are different (due to involvement of user-defined type cast), thus such temporary object will be destroyed immediately.
-
-This problem does not appear if macro *OCCT_HANDLE_NOCAST* is used during compilation, see below.
-
-Example:
-
-~~~~{.cpp}
-// note that DownCast() returns new temporary object!
-const occ::handle& aBC =
-occ::down_cast(aCurve);
-aBC->Transform (T); // access violation in OCCT 7.0
-~~~~
-
-@subsubsection upgrade_occt700_cdl_nocast Option to avoid cast of handle to reference to base type
-
-In OCCT 6.x and earlier versions the handle classes formed a hierarchy echoing the hierarchy of the corresponding object classes .
-This automatically enabled the possibility to use the handle to a derived class in all contexts where the handle to a base class was needed, e.g. to pass it in a function by reference without copying:
-
-~~~~{.cpp}
-bool GetCurve (occ::handle& theCurve);
-....
-occ::handle aLine;
-if (GetCurve (aLine)) {
- // use aLine, unsafe
-}
-~~~~
-
-This feature was used in multiple places in OCCT and dependent projects.
-However it is potentially unsafe: in the above example no checks are done at compile time or at run time to ensure that the type assigned to the argument handle is compatible with the type of the handle passed as argument.
-If an object of incompatible type (e.g. Geom_Circle) is assigned to *theCurve*, the behavior will be unpredictable.
-
-For compatibility with the existing code, OCCT 7.0 keeps this possibility by default, providing operators of type cast to the handle to a base type. However, this feature is unsafe and in specific situations it may cause compile-time or run-time errors as described above.
-
-To provide a safer behavior, this feature can be disabled by a compile-time macro *OCCT_HANDLE_NOCAST*.
-When it is used, constructors and assignment operators are defined (instead of type cast operators) to convert handles to a derived type into handles to a base type.
-This implies creation of temporary objects and hence may be more expensive at run time in some circumstances, however this way is more standard, safer, and in general recommended.
-
-The code that relies on the possibility of casting to base should be amended to always use the handle of argument type in function call and to use *DownCast()* to safely convert the result to the desired type.
-For instance, the code from the example below can be changed as follows:
-
-~~~~{.cpp}
-occ::handle aLine;
-occ::handle aCurve;
-if (GetCurve (aCure) && !(aLine = Handle(Geom_Line)::DownCast (aCurve)).IsNull()) {
- // use aLine safely
-}
-~~~~
-
-@subsubsection upgrade_occt700_cdl_compat Preserving compatibility with OCCT 6.x
-
-If you like to preserve the compatibility of your application code with OCCT versions 6.x even after the upgrade to 7.0, consider the following suggestions:
-
-1. If your code used sequences of macros *IMPLEMENT_STANDARD_*... generated by WOK, replace them by single macro *IMPLEMENT_STANDARD_RTTIEXT*
-
-2. When running automatic upgrade tool, add option -compat.
-
-3. Define macros *DEFINE_STANDARD_RTTIEXT* and *DEFINE_STANDARD_RTTI_INLINE* when building with previous versions of OCCT, resolving to *DEFINE_STANDARD_RTTI* with single argument
-
- Example:
-~~~~{.cpp}
-#if OCC_VERSION_HEX < 0x070000
- #define DEFINE_STANDARD_RTTIEXT(C1,C2) DEFINE_STANDARD_RTTI(C1)
- #define DEFINE_STANDARD_RTTI_INLINE(C1,C2) DEFINE_STANDARD_RTTI(C1)
-#endif
-~~~~
-
-@subsubsection upgrade_occt700_cdl_wok Applications based on CDL and WOK
-
-If your application is essentially based on CDL, and you need to upgrade it to OCCT 7.0, you will very likely need to convert your application code to non-CDL form.
-This is a non-trivial effort; the required actions would depend strongly on the structure of the code and used CDL features.
-
-The upgrade script and sources of a specialized WOK version used for OCCT code upgrade can be found in WOK Git repository in branch [CR0_700_2](https://git.dev.opencascade.org/gitweb/?p=occt-wok.git;a=log;h=refs/heads/CR0_700_2).
-
-[Contact us](https://www.opencascade.com/contact/) if you need more help.
-
-@subsection upgrade_occt700_bspline Separation of BSpline cache
-
-Implementation of NURBS curves and surfaces has been revised: the cache of polynomial coefficients, which is used to accelerate the calculation of values of a B-spline, has been separated from data objects *Geom2d_BSplineCurve, Geom_BSplineCurve* and *Geom_BSplineSurface* into the dedicated classes *BSplCLib_Cache* and *BSplSLib_Cache*.
-
-The benefits of this change are:
-* Reduced memory footprint of OCCT shapes (up to 20% on some cases)
-* Possibility to evaluate the same B-Spline concurrently in parallel threads without data races and mutex locks
-
-The drawback is that direct evaluation of B-Splines using methods of curves and surfaces becomes slower due to the absence of cache. The slow-down can be avoided by using adaptor classes *Geom2dAdaptor_Curve, GeomAdaptor_Curve* and *GeomAdaptor_Surface*, which now use cache when the curve or surface is a B-spline.
-
-OCCT algorithms have been changed to use adaptors for B-spline calculations instead of direct methods for curves and surfaces.
-The same changes (use of adaptors instead of direct call to curve and surface methods) should be implemented in relevant places in the applications based on OCCT to get the maximum performance.
-
-@subsection upgrade_occt700_booleanresult Structural result of Boolean operations
-
-The result of Boolean operations became structured according to the structure of the input shapes. Therefore it may impact old applications that always iterate on direct children of the result compound assuming to obtain solids as iteration items, regardless of the structure of the input shapes. In order to get always solids as iteration items it is recommended to use TopExp_Explorer instead of TopoDS_Iterator.
-
-@subsection upgrade_occt700_brepextrema BRepExtrema_ExtCC finds one solution only
-
-Extrema computation between non-analytical curves in shape-shape distance calculation algorithm has been changed in order to return only one solution. So, if e.g. two edges are created on parallel b-spline curves the algorithm BRepExtrema_DistShapeShape will return only one solution instead of enormous number of solutions. There is no way to get algorithm working in old manner.
-
-@subsection upgrade_occt700_sorttools Removal of SortTools package
-
-Package *SortTools* has been removed.
-The code that used the tools provided by that package should be corrected manually.
-The recommended approach is to use sorting algorithms provided by STL.
-
-For instance:
-~~~~{.cpp}
-#include
-#include
-#include
-...
-TCollection_Array1OfReal aValues = ...;
-...
-TCollection_CompareOfReal aCompReal;
-SortTools_StraightInsertionSortOfReal::Sort(aValues, aCompReal);
-~~~~
-can be replaced by:
-~~~~{.cpp}
-#include
-...
-TCollection_Array1OfReal aValues = ...;
-...
-std::stable_sort (aValues.begin(), aValues.end());
-~~~~
-
-@subsection upgrade_occt700_2dlayers On-screen objects and ColorScale
-
-The old mechanism for rendering Underlay and Overlay on-screen 2D objects based on *Visual3d_Layer* and immediate drawing model (uncached and thus slow) has been removed.
-Classes *Aspect_Clayer2d, OpenGl_GraphicDriver_Layer, Visual3d_Layer, Visual3d_LayerItem, V3d_LayerMgr* and *V3d_LayerMgrPointer* have been deleted.
-The following auxiliary definition have been removed as well: Aspect_TypeOfPrimitive, Aspect_TypeOfLayer, Aspect_TypeOfEdge, Aspect_TypeOfDrawMode, Aspect_TypeOfConstraint, Aspect_DriverDefinitionError, Aspect_BadAccess.
-
-General AIS interactive objects with transformation persistence flag *Graphic3d_TMF_2d* can be used as a replacement of *Visual3d_LayerItem*.
-The anchor point specified for transformation persistence defines the window corner of (or center in case of (0, 0) point).
-To keep on-screen 2D objects on top of the main screen, they can be assigned to the appropriate Z-layer.
-Predefined Z-layers *Graphic3d_ZLayerId_TopOSD* and *Graphic3d_ZLayerId_BotOSD* are intended to replace Underlay and Overlay layers within the old API.
-
-*ColorScale* object previously implemented using *Visual3d_LayerItem* has been moved to a new class *AIS_ColorScale*, with width and height specified explicitly.
-The property of *V3d_View* storing the global *ColorScale* object has been removed with associated methods *V3d_View::ColorScaleDisplay(), V3d_View::ColorScaleErase(), V3d_View::ColorScaleIsDisplayed()* and *V3d_View::ColorScale()* as well as the classes *V3d_ColorScale, V3d_ColorScaleLayerItem* and *Aspect_ColorScale*.
-Here is an example of creating *ColorScale* using the updated API:
-
-~~~~{.cpp}
-occ::handle aCS = new AIS_ColorScale();
-// configuring
-int aWidth, aHeight;
-aView->Window()->Size (aWidth, aHeight);
-aCS->SetSize (aWidth, aHeight);
-aCS->SetRange (0.0, 10.0);
-aCS->SetNumberOfIntervals (10);
-// displaying
-aCS->SetZLayer (Graphic3d_ZLayerId_TopOSD);
-aCS->SetTransformPersistence (Graphic3d_TMF_2d, gp_Pnt (-1,-1,0));
-aCS->SetToUpdate();
-theContextAIS->Display (aCS);
-~~~~
-
-To see how 2d objects are implemented in OCCT you can call Draw commands *vcolorscale, vlayerline* or *vdrawtext* (with -2d option).
-Draw command *vcolorscale* now requires the name of *ColorScale* object as argument.
-To display this object use command *vdisplay*. For example:
-
-~~~~{.php}
-pload VISUALIZATION
-vinit
-vcolorscale cs -demo
-pload MODELING
-box b 100 100 100
-vdisplay b
-vsetdispmode 1
-vfit
-vlayerline 0 300 300 300 10
-vdrawtext t "2D-TEXT" -2d -pos 0 150 0 -color red
-~~~~
-
-Here is a small example in C++ illustrating how to display a custom AIS object in 2d:
-~~~~{.cpp}
-occ::handle aContext = ...;
-occ::handle anObj =...; // create an AIS object
-anObj->SetZLayer(Graphic3d_ZLayerId_TopOSD); // display object in overlay
-anObj->SetTransformPersistence (Graphic3d_TMF_2d, gp_Pnt (-1,-1,0)); // set 2d flag, coordinate origin is set to down-left corner
-aContext->Display (anObj); // display the object
-~~~~
-
-@subsection upgrade_occt700_userdraw UserDraw and Visual3d
-
-#### Visual3d package
-
-Package *Visual3d* implementing the intermediate layer between high-level *V3d* classes
-and low-level OpenGl classes for views and graphic structures management has been dropped.
-
-The *OpenGl_View* inherits from the new class *Graphic3d_CView*.
-*Graphic3d_CView* is an interface class that declares abstract methods for managing displayed structures,
-display properties and a base layer code that implements computation
-and management of HLR (or more broadly speaking view-depended) structures.
-
-In the new implementation it takes place of the eliminated *Visual3d_View*.
-As before the instance of *Graphic3d_CView* is still completely managed by *V3d_View* classes.
-It can be accessed through *V3d_View* interface but normally it should not be required as all its methods are completely wrapped.
-
-In more details, a concrete specialization of *Graphic3d_CView* is created and returned by the graphical driver on request.
-Right after the creation the views are directly used for setting rendering properties and adding graphical structures to be displayed.
-
-The rendering of graphics is possible after mapping a window and activating the view.
-The direct setting of properties obsoletes the use of intermediate structures with display parameter
-like *Visual3d_ContextView*, etc. This means that the whole package *Visual3d* becomes redundant.
-
-The functionality previously provided by *Visual3d* package has been redesigned in the following way :
-- The management of display of structures has been moved from *Visual3d_ViewManager* into *Graphic3d_StructureManager*.
-- The class *Visual3d_View* has been removed. The management of computed structures has been moved into the base layer of *Graphi3d_CView*.
-- All intermediate structures for storing view parameters, e.g. *Visual3d_ContextView*, have been removed.
- The settings are now kept by instances of *Graphic3d_CView*.
-- The intermediate class *Visual3d_Light* has been removed. All light properties are stored in *Graphic3d_CLight* structure, which is directly accessed by instances of *V3d_Light* classes.
-- All necessary enumerations have been moved into *Graphic3d* package.
-
-#### Custom OpenGL rendering and UserDraw
-
-Old APIs based on global callback functions for creating *UserDraw* objects and for performing custom OpenGL rendering within the view have been dropped.
-*UserDraw* callbacks are no more required since *OpenGl_Group* now inherits *Graphic3d_Group* and thus can be accessed directly from *AIS_InteractiveObject*:
-
-~~~~{.cpp}
-//! Class implementing custom OpenGL element.
-class UserDrawElement : public OpenGl_Element {};
-
-//! Implementation of virtual method AIS_InteractiveObject::Compute().
-void UserDrawObject::Compute (const occ::handle& thePrsMgr,
- const occ::handle& thePrs,
- const int theMode)
-{
- NCollection_Vec4 aBndMin (myCoords[0], myCoords[1], myCoords[2], 1.0f);
- NCollection_Vec4 aBndMax (myCoords[3], myCoords[4], myCoords[5], 1.0f);
-
- // casting to OpenGl_Group should be always true as far as application uses OpenGl_GraphicDriver for rendering
- occ::handle aGroup = Handle(OpenGl_Group)::DownCast (thePrs->NewGroup());
- aGroup->SetMinMaxValues (aBndMin.x(), aBndMin.y(), aBndMin.z(),
- aBndMax.x(), aBndMax.y(), aBndMax.z());
- UserDrawElement* anElem = new UserDrawElement (this);
- aGroup->AddElement(anElem);
-
- // invalidate bounding box of the scene
- thePrsMgr->StructureManager()->Update();
-}
-~~~~
-
-To perform a custom OpenGL code within the view, it is necessary to inherit from class *OpenGl_View*.
-See the following code sample:
-
-~~~~{.cpp}
-//! Custom view.
-class UserView : public OpenGl_View
-{
-public:
- //! Override rendering into the view.
- virtual void render (Graphic3d_Camera::Projection theProjection,
- OpenGl_FrameBuffer* theReadDrawFbo,
- const bool theToDrawImmediate)
- {
- OpenGl_View::render (theProjection, theReadDrawFbo, theToDrawImmediate);
- if (theToDrawImmediate)
- {
- return;
- }
-
- // perform custom drawing
- const occ::handle& aCtx = myWorkspace->GetGlContext();
- GLfloat aVerts[3] = { 0.0f, 0,0f, 0,0f };
- aCtx->core20->glEnableClientState(GL_VERTEX_ARRAY);
- aCtx->core20->glVertexPointer(3, GL_FLOAT, 0, aVerts);
- aCtx->core20->glDrawArrays(GL_POINTS, 0, 1);
- aCtx->core20->glDisableClientState(GL_VERTEX_ARRAY);
- }
-
-};
-
-//! Custom driver for creating UserView.
-class UserDriver : public OpenGl_GraphicDriver
-{
-public:
- //! Create instance of own view.
- virtual occ::handle CreateView (const occ::handle& theMgr) override
- {
- occ::handle aView = new UserView (theMgr, this, myCaps, myDeviceLostFlag, &myStateCounter);
- myMapOfView.Add (aView);
- for (NCollection_Sequence::Iterator aLayerIt (myLayerSeq); aLayerIt.More(); aLayerIt.Next())
- {
- const Graphic3d_ZLayerId aLayerID = aLayerIt.Value();
- const Graphic3d_ZLayerSettings& aSettings = myMapOfZLayerSettings.Find (aLayerID);
- aView->AddZLayer (aLayerID);
- aView->SetZLayerSettings (aLayerID, aSettings);
- }
- return aView;
- }
-};
-
-~~~~
-
-@subsection upgrade_occt700_localcontext Deprecation of Local Context
-
-The conception of Local Context has been deprecated.
-The related classes, e.g. *AIS_LocalContext*, and methods ( AIS_InteractiveContext::OpenLocalContext() and others) will be removed in a future OCCT release.
-
-The main functionality provided by Local Context - selection of object subparts - can be now used within Neutral Point without opening any Local Context.
-
-The property *SelectionMode()* has been removed from the class *AIS_InteractiveObject*.
-This property contradicts to selection logic, since it is allowed to activate several Selection modes at once.
-Therefore keeping one selection mode as object field makes no sense.
-Applications that used this method should implement selection mode caching at application level, if it is necessary for some reason.
-
-@subsection upgrade_occt700_separate_caf_visualisation Separation of visualization part from TKCAF
-
-Visualization CAF attributes have been moved into a new toolkit *TKVCAF*.
-If your application uses the classes from *TPrsStd* package then add link to *TKVCAF* library.
-
-Version numbers of *BinOCAF* and *XmlOCAF* formats are incremented; new files cannot be read by earlier versions of OCCT.
-
-Before loading the OCAF files saved by previous versions and containing *TPrsStd_AISPresentation* attribute it is necessary to define the environment variable *CSF_MIGRATION_TYPES*, pointing to file *src/StdResources/MigrationSheet.txt*.
-When using documents loaded from a file, make sure to call method *TPrsStd_AISViewer::New()* prior to accessing *TPrsStd_AISPresentation* attributes in this document as that method creates them.
-
-@subsection upgrade_euler_angles Correction of interpretation of Euler angles in gp_Quaternion
-
-Conversion of *gp_Quaternion* to and from intrinsic Tait-Bryan angles (including *gp_YawPitchRoll*) is fixed.
-
-Before that fix the sequence of rotation axes was opposite to the intended; e.g. *gp_YawPitchRoll* (equivalent to *gp_Intrinsic_ZYX*) actually defined intrinsic rotations around X, then Y, then Z. Now the rotations are made in the correct order.
-
-The applications that use *gp_Quaternion* to convert Yaw-Pitch-Roll angles (or other intrinsic Tait-Bryan sequences) may need to be updated to take this change into account.
-
-@subsection upgrade_zoom_persistent_selection Zoom Persistent Selection
-
-Zoom persistent selection introduces a new structure *Graphic3d_TransformPers* to transform persistence methods and parameters and a new class *Graphic3d_WorldViewProjState* to refer to the camera transformation state. You might need to update your code to deal with the new classes if you were using the related features. Keep in mind the following:
-* *Graphic3d_Camera::ModelViewState* has been renamed to *Graphic3d_Camera::WorldViewState*.
-* Transformation matrix utilities from *OpenGl_Utils* namespace have been moved to *Graphic3d_TransformUtils* and *Graphic3d_TransformUtils.hxx* header respectively.
-* Matrix stack utilities from *OpenGl_Utils* namespace have been moved to *OpenGl_MatrixStack* class and *OpenGl_MatrixStack.hxx* header respectively.
-* *OpenGl_View* methods *Begin/EndTransformPersistence* have been removed. Use *Graphic3d_TransformPers::Apply()* instead to apply persistence to perspective and world-view projection matrices.
-
-@subsection upgrade_occt700_correction_of_texture Texture mapping of objects
-
-Textured objects now have the priority over the environment mapping.
-
-Redundant enumerations *V3d_TypeOfSurface* and *Graphic3d_TypeOfSurface*, class *OpenGl_SurfaceDetailState*, the corresponding methods from *Graphic3d_CView, OpenGl_ShaderManager, OpenGl_View, V3d_View* and *V3d_Viewer* have been deleted.
-Draw command *VSetTextureMode* has been deleted.
-
-@subsection upgrade_occt700_wfshape Shape presentation builders
-
-Presentation tools for building Wireframe presentation have been refactored to eliminate duplicated code and interfaces.
-Therefore, the following classes have been modified:
-* *StdPrs_WFDeflectionShape* and *Prs3d_WFShape* have been removed. *StdPrs_WFShape* should be used instead.
-* *StdPrs_ToolShadedShape* has been renamed to *StdPrs_ToolTriangulatedShape*.
@section upgrade_occt710 Upgrade to OCCT 7.1.0
@@ -1110,7 +133,7 @@ The following obsolete features have been removed:
* The 3D viewer printing API *V3d_View::Print()* has been removed. This functionality was available on Windows platforms only. The applications should use the general image dump API *V3d_View::ToPixMap()* and manage printing using a platform-specific API at the application level.
Text resolution can be managed by rendering parameter *Graphic3d_RenderingParams::Resolution*, returned by *V3d_View::ChangeRenderingParams()*.
* Methods *PrsMgr_PresentationManager::BoundBox*, *PrsMgr_PresentationManager::Hilight* and *SelectMgr_EntityOwner::Hilight* have been removed as not used. The corresponding method in custom implementations of *SelectMgr_EntityOwner* can be removed safely. *PrsMgr_PresentationManager::Color* with the corresponding style must be used instead.
-* Class *NCollection_QuickSort* has been removed. The code that used the tools provided by that class should be corrected manually. The recommended approach is to use sorting algorithms provided by STL (std::sort). See also @ref upgrade_occt700_sorttools above.
+* Package *SortTools* has been removed. The code that used the tools provided by that package should be corrected manually. The recommended approach is to use sorting algorithms provided by STL (std::sort).
* Package *Dico*. The code that used the tools provided by that package should be corrected manually. The recommended approach is to use *NCollection_DataMap* and *NCollection_IndexedDataMap* classes.
@@ -2128,13 +1151,13 @@ Redundant class Prs3d_Root has been marked as deprecated - Prs3d_Presentation::N
@subsection upgrade_750_cdf_session Support of multiple OCAF application instances
Class *CDF_Session* has been removed.
-That class was used to store global instance of OCAF application (object of class *CDM_Application* or descendant, typically *TDataStd_Application*).
+That class was used to store global instance of OCAF application (object of class *CDM_Application* or descendant, typically *TDocStd_Application*).
Global directory of all opened OCAF documents has been removed as well; such directory is maintained now by each instance of the *CDM_Application* class.
This allows creating programs that work with different OCAF documents concurrently in parallel threads,
-provided that each thread deals with its own instance of *TDataStd_Application* and documents managed by this instance.
+provided that each thread deals with its own instance of *TDocStd_Application* and documents managed by this instance.
-Note that neither *TDataStd_Application* nor *TDocStd_Document* is protected from concurrent access from several threads.
+Note that neither *TDocStd_Application* nor *TDocStd_Document* is protected from concurrent access from several threads.
Such protection, if necessary, shall be implemented on the application level.
For an example, access to labels and attributes could be protected by mutex if there is a probability that different threads access the same labels / attributes:
~~~~{.cpp}
@@ -2297,8 +1320,8 @@ void Perform(const occ::handle& theCurveOnSurface,
@section upgrade_occt770 Upgrade to OCCT 7.7.0
-Building OCCT now requires C++11-compliant compiler, so that some legacy compilers (Visual Studio 2010 and 2012) are no more supported.
-It is recommended using Visual Studio 2015 or newer for building OCCT on Windows platform.
+Building OCCT now requires C++17-compliant compiler (see [Building OCCT](@ref build_upgrade__building_occt) for details).
+It is recommended using Visual Studio 2019 or later (2022 preferred) for building OCCT on Windows platform.
@subsection upgrade_770_removed_features Removed features
@@ -2402,7 +1425,7 @@ New profiles to allocate memory (defined at configuration time):
* `JeMalloc` - allocates with `jemalloc` functions.
* `Flexible` - old-way allocation which defines allocation method in real-time by environment variables.
-The most recommended manager is `JeMalloc`. To use it with a plugin system, like `DRAW`, please ensure that JeMalloc was built with the `--disable-initial-exec-tls` flag. For more details, visit [JeMalloc](http://jemalloc.net/).
+The most recommended manager is `JeMalloc`. To use it with a plugin system, like `DRAW`, please ensure that JeMalloc was built with the `--disable-initial-exec-tls` flag. For more details, visit [JeMalloc](https://jemalloc.net/).
@subsection upgrade_780_optimization_profiles New CMake Variable for Optimization Profiles
@@ -2475,11 +1498,445 @@ The `Handle_*` type names are still available, but it is recommended to use the
Example:
~~~~{.cpp}
- occ::handle anApp = new TDataStd_Application(); // recommended
- Handle_TDataStd_Application anApp = new TDataStd_Application(); // deprecated
+ occ::handle anApp = new TDocStd_Application(); // recommended
+ Handle_TDocStd_Application anApp = new TDocStd_Application(); // deprecated
~~~~
@subsection upgrade_790_general_map NCollection_Map algorithm method migration
The `NCollection_Map` class has been reorganized to migrate extra methods to the `NCollection_MapAlgo` class.
Boolean operations on maps are now available in the `NCollection_MapAlgo` class.
+
+@section upgrade_occt800 Upgrade to OCCT 8.0.0
+
+OCCT 8.0.0 is a major release with broad, source-incompatible changes across the foundation, modeling-data, and modeling-algorithm layers. The bulk of the per-line changes (handle macro, `Standard_*` typedefs, `Standard_OVERRIDE` etc., `TColStd_*`/`TopTools_*` typedefs, `DEFINE_HARRAY*`, `Standard_Failure::Raise`) can be migrated automatically. A smaller set of changes — exception handling, removed/renamed APIs, reworked evaluation hierarchies, and packages that have been removed outright — require manual review.
+
+@subsection upgrade_800_minimums Minimum requirements and project layout
+
+OCCT 8.0.0 raises the supported toolchain baseline and reorganizes the source tree.
+
+- **C++17 is now required**. Application code and CMake `CXX_STANDARD` must be raised to 17 or higher. Compiler minimums: VS 2019 (2022 preferred), GCC 8.0, Clang 7.0, Apple Clang 11.0, MinGW-w64 7.3.
+- **CMake 3.10 or later** is enforced (3.16+ recommended; required when `BUILD_USE_PCH=ON` for precompiled headers).
+- **Source-tree layout** has been reorganized from a flat `src//` layout to `src////`. Build scripts that hard-coded the old layout, copied OCCT into a vendored tree, or referenced specific source paths must be updated.
+- **Resource files** are now installed under `share//resources/` (vcpkg-compliant layout). The CSF_* environment variables (`CSF_OCCTResourcePath`, `CSF_IGESDefaults`, `CSF_STEPDefaults`, `CSF_PluginDefaults`, `CSF_XCAFDefaults`, etc.) are the supported way to point OCCT at the resources at runtime; `CASROOT` remains supported for compatibility.
+- **`BUILD_PATCH` CMake option is removed**. There is no replacement; apply patches at the source level or via your build system.
+- **`OCCT_PROJECT_NAME`** is a new CMake cache variable that controls the install layout's project name (defaults to `opencascade`); it is the supported customization hook for vcpkg and embedded builds.
+- **Inspector** and **ExpToCas** have been moved out of the main repository to their own GitHub repositories. If your build relied on them being shipped in-tree, switch to the upstream repositories.
+- The `-symbolic` Unix linker flag is no longer applied. RTTI behavior with `dlopen`-style plugins should be re-validated.
+
+@subsection upgrade_800_migration_toolkit Automated migration toolkit
+
+A 12-phase Python migration suite is shipped with OCCT under `adm/scripts/migration_800/`. It requires Python 3.6+ with no external dependencies. Each phase supports `--dry-run` to preview changes.
+
+For external projects, the recommended entry point is the wrapper script:
+
+~~~~{.bash}
+# Linux/macOS
+./adm/scripts/migration_800/run_migration.sh /path/to/your/src --dry-run
+./adm/scripts/migration_800/run_migration.sh /path/to/your/src
+
+# Windows
+adm\scripts\migration_800\run_migration.bat /path/to/your/src --dry-run
+~~~~
+
+The phases run in order and cover, in summary:
+
+1. `migrate_handles.py`- `Handle(T)` to `occ::handle`, `Handle(T)::DownCast()` to `occ::down_cast()`.
+2. `migrate_standard_types.py`- `Standard_Boolean/Integer/Real/...` to `bool/int/double/...`, `Standard_True/False` to `true/false`.
+3. `migrate_macros.py`- `Standard_OVERRIDE` to `override`, `Standard_NODISCARD` to `[[nodiscard]]`, `Standard_FALLTHROUGH` to `[[fallthrough]];`, etc.
+4. `cleanup_define_handle.py`- removes redundant `DEFINE_STANDARD_HANDLE` macros.
+5. `cleanup_deprecated_typedefs.py`- removes deprecated typedef/using declarations and replaces usages.
+6. `collect_typedefs.py`- collects `NCollection` typedef mappings (analysis phase).
+7. `replace_typedefs.py`- replaces `TColStd_*`/`TopTools_*` etc. with `NCollection_*`.
+8. `remove_typedef_headers.py`- removes typedef-only headers and updates `FILES.cmake`.
+9. `cleanup_forwarding_headers.py`- cleans up forwarding/include-only headers.
+10. `cleanup_unused_typedefs.py`- removes unused typedef declarations.
+11. `cleanup_access_specifiers.py`- removes redundant access specifiers.
+12. `migrate_raise_to_throw.py`- converts `Standard_Failure::Raise(...)` to `throw Standard_Failure(...)`.
+
+The accompanying `migrate_hcollections.py` script converts `DEFINE_HARRAY1`/`DEFINE_HARRAY2`/`DEFINE_HSEQUENCE` macros to the `NCollection_HArray1`/`HArray2`/`HSequence` template classes.
+
+After all phases, `verify_migration.py` reports any remaining legacy patterns:
+
+~~~~{.bash}
+python3 adm/scripts/migration_800/verify_migration.py --verbose /path/to/your/src
+~~~~
+
+Pre-generated mapping files (`collected_typedefs.json`, `collected_deprecated_typedefs.json`) are bundled in `adm/scripts/migration_800/`; external projects do not need to re-scan the OCCT source. The migration scripts also support `.h`/`.c`/`.hpp`/`.cpp` files and can automatically add or replace `#include` directives when replacing typedefs.
+
+`Standard_UNUSED` is an exception and requires manual migration to `[[maybe_unused]]` due to stricter placement rules of the C++ attribute.
+
+@subsection upgrade_800_handle Handle macro and Standard_* primitive types
+
+The `Handle()` macro and `::DownCast` are replaced with explicit `occ::handle<>` / `occ::down_cast<>` templates:
+
+~~~~{.cpp}
+// Before // After
+Handle(Geom_Circle) aCircle; occ::handle aCircle;
+Handle(Geom_Circle)::DownCast(aCurve); occ::down_cast(aCurve);
+~~~~
+
+OCCT's primitive typedefs are migrated to standard C++ types:
+
+| Deprecated typedef | Replacement |
+| ------------------------ | ----------------- |
+| `Standard_Boolean` | `bool` |
+| `Standard_True/False` | `true/false` |
+| `Standard_Integer` | `int` |
+| `Standard_Real` | `double` |
+| `Standard_ShortReal` | `float` |
+| `Standard_Byte` | `uint8_t` |
+| `Standard_Size` | `size_t` |
+| `Standard_Address` | `void*` |
+| `Standard_CString` | `const char*` |
+| `Standard_Character` | `char` |
+| `Standard_ExtCharacter` | `char16_t` |
+| `Standard_Time` | `std::time_t` |
+
+The `Standard_*` typedefs are still defined for source-level compatibility, but their use is discouraged in new code and the migration scripts rewrite them to the native C++ types.
+
+@subsection upgrade_800_macros Standard_* macros
+
+Legacy attribute macros are replaced with the standard C++ attributes and keywords:
+
+| Deprecated macro | Replacement |
+| ---------------------- | ------------------ |
+| `Standard_OVERRIDE` | `override` |
+| `Standard_NODISCARD` | `[[nodiscard]]` |
+| `Standard_FALLTHROUGH` | `[[fallthrough]];` |
+| `Standard_Noexcept` | `noexcept` |
+| `Standard_DELETE` | `= delete` |
+| `Standard_THREADLOCAL` | `thread_local` |
+| `Standard_ATOMIC(T)` | `std::atomic` |
+
+@subsection upgrade_800_exceptions Exception handling
+
+`Standard_Failure` now inherits from `std::exception`. OCCT exceptions can be caught by standard `catch (const std::exception&)` blocks, the message is exposed through `what()`, and `ExceptionType()` returns the exception class name.
+
+Static `Raise()`, `Instance()`, and `Throw()` methods on `Standard_Failure` and its subclasses are removed. Use the C++ `throw` statement directly:
+
+~~~~{.cpp}
+// Before (removed) // After
+Standard_Failure::Raise("error"); throw Standard_Failure("error");
+Standard_OutOfRange::Raise("index"); throw Standard_OutOfRange("index");
+~~~~
+
+`GetMessageString()` is deprecated- use `what()`. The error-handler stack used by `OCC_CATCH_SIGNALS` is now `thread_local` instead of being protected by a global mutex; threads no longer contend on error-handler state. `Catches()` and `LastCaughtError()` static methods on `Standard_ErrorHandler` have been removed; `OCC_CATCH_SIGNALS` exposes a new `Raise()` re-throw method.
+
+If you previously combined OCCT exceptions with custom catch logic that relied on `Catches()` / `LastCaughtError()`, restructure the handler around the standard `try`/`catch` flow.
+
+@subsection upgrade_800_ncollection NCollection API changes
+
+`Seek()` and `ChangeSeek()` are removed from `NCollection_Map`. Use the unified `Contained()` API, which returns `std::optional>`:
+
+~~~~{.cpp}
+// Before (removed)
+const KeyType* pKey = aMap.Seek(aKey);
+
+// After
+auto anOpt = aMap.Contained(aKey);
+if (anOpt.has_value()) { const KeyType& aFoundKey = anOpt->get(); }
+~~~~
+
+The non-throwing `TryEmplace`/`TryBind` methods are now available on all map types and avoid the throwing two-step "find then add" pattern:
+
+~~~~{.cpp}
+if (auto* pValue = aMap.TryBind(key, defaultValue)) { /* use pValue */ }
+aMap.Emplace(key, constructorArgs...); // in-place construction, no copy/move
+~~~~
+
+C++17 structured bindings are supported via `Items()` / `IndexedItems()` views:
+
+~~~~{.cpp}
+for (auto [aKey, aValue] : aMap.Items()) { ... }
+~~~~
+
+New collection types are available in 8.0.0 and may be preferred over their predecessors in new code:
+
+- `NCollection_FlatMap` / `NCollection_FlatDataMap`- cache-friendly open-addressing hash containers with Robin Hood hashing.
+- `NCollection_OrderedMap` / `NCollection_OrderedDataMap`- insertion-order-preserving maps with O(1) lookup, append, and removal.
+- `NCollection_KDTree`- header-only static balanced KD-Tree for spatial queries (`gp_Pnt`, `gp_Pnt2d`, `gp_XYZ`, `gp_XY`).
+- `NCollection_ForwardRange`- lightweight forward-range adapter for non-owning index spans.
+
+`Standard_Mutex` is deprecated in favor of `std::mutex`.
+
+@subsection upgrade_800_collections_typedefs Package collection typedefs
+
+The package-specific collection typedefs (`TColStd_*`, `TopTools_*`, `TColgp_*`, etc.) are kept as deprecated aliases of the underlying `NCollection_*` template instantiations and emit deprecation warnings on use. The migration scripts rewrite call sites to use the templates directly:
+
+~~~~{.cpp}
+// Before // After
+TColStd_ListOfInteger aList; NCollection_List aList;
+TopTools_MapOfShape aMap; NCollection_Map aMap;
+TColStd_Array1OfReal anArr; NCollection_Array1 anArr;
+TColgp_SequenceOfPnt aSeq; NCollection_Sequence aSeq;
+~~~~
+
+Two package typedef wrappers have been removed entirely (no backward-compatible aliases): `TColGeom` and `TColGeom2d`. Replace with `NCollection_Array1>` and the equivalent `Geom2d_*` form:
+
+~~~~{.cpp}
+// Before (removed) // After
+#include #include
+TColGeom_Array1OfCurve aCurves; #include
+ NCollection_Array1> aCurves;
+~~~~
+
+@subsection upgrade_800_bspline BSpline/Bezier weights and accessors
+
+BSpline and Bezier curves and surfaces store poles, weights, and knots as direct array value-members rather than `NCollection_HArray*` handles. The previously nullable `Weights()` accessor is replaced by `WeightsArray()`, which always returns a valid reference- non-rational geometry exposes a non-owning view over a static unit-weights buffer with zero allocation:
+
+~~~~{.cpp}
+// Before (nullable)
+const NCollection_Array1* pWeights = aCurve->Weights();
+if (pWeights != nullptr) { /* use weights */ }
+
+// After (always valid)
+const NCollection_Array1& aWeights = aCurve->WeightsArray();
+~~~~
+
+Copy-out accessor overloads (those taking an output `NCollection_Array1` to fill) are deprecated in favour of zero-copy const-reference returning versions:
+
+~~~~{.cpp}
+// Before (deprecated, copies data)
+NCollection_Array1 aPoles;
+aCurve->Poles(aPoles);
+
+// After (zero-copy)
+const NCollection_Array1& aPoles = aCurve->Poles();
+~~~~
+
+The same deprecation applies to single-element accessors throughout the `Convert` package- prefer the batch const-reference accessors (`Poles()`, `Weights()`, `Knots()`, `Multiplicities()`).
+
+@subsection upgrade_800_eval Evaluation hierarchy: EvalD0/D1/D2/D3/DN
+
+The geometry evaluation dispatch hierarchy has been redesigned across all 32 `Geom`/`Geom2d` curve and surface classes and across `Adaptor3d_Curve`, `Adaptor3d_Surface`, and their subclasses.
+
+The new primary virtual dispatch points are `EvalD0`, `EvalD1`, `EvalD2`, `EvalD3`, and `EvalDN`. They return POD result structs (`Geom_CurveD1` / `D2` / `D3`, `Geom_SurfD1` / `D2` / `D3`, and the `Geom2d_*` equivalents) and use exception-based error handling on the hot path.
+
+The old `Value()` and `D0` / `D1` / `D2` / `D3` / `DN` methods are kept as non-virtual inline backward-compatible wrappers that delegate to `EvalD*`. **If your code overrides `D0`/`D1`/`D2`/`D3`/`DN` on a `Geom*` class or an `Adaptor3d_Curve`/`Adaptor3d_Surface` subclass, you must override `EvalD0`/`EvalD1`/`EvalD2`/`EvalD3`/`EvalDN` instead.** Existing call-site code that consumes `Value()` / `D0..DN` continues to work unchanged.
+
+The new `EvalRep` descriptor system additionally allows alternate evaluation paths to be attached per-object via the `Set`/`Get`/`Clear` EvalRep API (full, derivative-bounded, and parameter-mapped descriptors are supported). This is the mechanism behind, for example, the offset-surface fast path that bypasses the expensive offset evaluation when an equivalent non-offset surface is available.
+
+Adaptor classes for elementary geometry now store `gp_*` primitives directly in `std::variant` and dispatch via switch/enum to `ElCLib`/`ElSLib` static methods, eliminating virtual calls for elementary geometry on the evaluation hot path.
+
+@subsection upgrade_800_lprop_gprop LProp consolidation and GProp deprecations
+
+LProp packages are consolidated and several `GProp` classes are deprecated.
+
+- `Geom2dLProp` and `LProp3d` packages are removed and consolidated into the unified `GeomLProp` template classes (`GeomLProp_CLPropsBase`, `GeomLProp_SLProps`). Backward-compatible type aliases for the previous class names are preserved, so most call sites continue to compile unchanged.
+- `LProp_AnalyticCurInf` is removed (dead code).
+- The `GProp_EquaType` enum is removed (no consumers). Dimensionality analysis is now exposed via `PointSetLib_Equation`.
+
+The point-cloud property classes `GProp_PGProps`, `GProp_PEquation`, `GProp_CelGProps`, `GProp_SelGProps`, `GProp_VelGProps` are marked with `Standard_HEADER_DEPRECATED("Deprecated since OCCT 8.0.0. Use PointSetLib_Equation instead")` (and equivalent messages) in favour of the new `PointSetLib` package (`PointSetLib_Props`, `PointSetLib_Equation`), which is provided in `TKMath` without inheritance from `GProp_GProps`.
+
+@subsection upgrade_800_bndlib Bounding-box computation: GeomBndLib
+
+A new `GeomBndLib` package provides geometry-aware bounding boxes for all standard `Geom` curve and surface types via `std::variant`-based per-type dispatch, with analytical solutions for conics and quadrics and PSO+Powell-based tight `BoxOptimal` results. `BndLib_Add3dCurve`, `BndLib_AddSurface`, and `BndLib_Add2dCurve` now delegate to `GeomBndLib`. The public `BndLib` API is preserved unchanged.
+
+@subsection upgrade_800_extremapc Point-to-curve extrema: ExtremaPC
+
+The new `ExtremaPC` package provides point-to-curve extrema computation with per-geometry specialized evaluators (`ExtremaPC_Line`, `ExtremaPC_Circle`, `ExtremaPC_Ellipse`, `ExtremaPC_Hyperbola`, `ExtremaPC_BezierCurve`, `ExtremaPC_BSplineCurve`, `ExtremaPC_OffsetCurve`) and an `ExtremaPC_Curve` aggregator dispatcher.
+
+@subsection upgrade_800_brepgraph BRepGraph- graph-based BRep representation
+
+OCCT 8.0.0 introduces a new graph-based representation of topology and BRep geometry as an alternative to the linked `TopoDS_Shape` data structure. The foundation is split across two layers:
+
+- `BRepGraph` (public)- typed `BRepGraph_NodeId` identifiers, multiple Views (`TopoView`, `RefsView`, `CacheView`, `BuilderView`), bidirectional parent/child explorers (`BRepGraph_ChildExplorer`, `BRepGraph_ParentExplorer`, `BRepGraph_WireExplorer`), iterators (`BRepGraph_DefsIterator`, `BRepGraph_RefsIterator`, `BRepGraph_RelatedIterator`, `BRepGraph_CacheKindIterator`, `BRepGraph_LayerIterator`), extensible Layer/Cache system, mutation guards (`BRepGraph_MutGuard`), history tracking (`BRepGraph_History`), deduplication (`BRepGraph_Deduplicate`), compaction (`BRepGraph_Compact`), deep copy (`BRepGraph_Copy`), and validation (`BRepGraph_Validate`).
+- `BRepGraphInc` (internal)- incidence-table storage with `BRepGraphInc_Populate` (`TopoDS_Shape` -> graph) and `BRepGraphInc_Reconstruct` (graph -> `TopoDS_Shape`) roundtrip conversion.
+
+`BRepGraph_Tool` is the centralized geometry-access API (analogue of `BRep_Tool`). `BRepGraph_Builder` allows programmatic graph construction without an input `TopoDS_Shape`.
+
+The graph representation is additive in 8.0.0- existing `TopoDS_Shape` code continues to work unchanged. Application code that wants to opt in can use `BRepGraphInc_Populate` and `BRepGraphInc_Reconstruct` to convert in either direction.
+
+@subsection upgrade_800_topods TopoDS_TShape redesign
+
+The `TopoDS_TShape` hierarchy has been reworked at the state and dispatch layer:
+
+- `ShapeType()` is non-virtual and embedded in a compact `uint16_t` bit-packed state field on `TopoDS_TShape`. Subclasses no longer override `ShapeType()`; the shape type is stored alongside the orientation/lock/checked/closed/infinite/convex/modified/free flags in the same field.
+- `TopAbs::Compose()`, `Reverse()`, and `Complement()` are inlined `noexcept` static functions in the `TopAbs.hxx` header (constexpr lookup tables) rather than out-of-line functions in `TopAbs.cxx`.
+
+This is a binary-incompatible change. Source compatibility is preserved for code that uses the public `TopoDS_*` and `TopExp*` APIs. Custom `TShape`-derived classes that previously overrode `ShapeType()` must drop the override and rely on the base-class state field.
+
+Child storage on `TopoDS_TShape` remains `NCollection_List` and `TopoDS_Iterator` continues to iterate the list - callers that touch `myShapes` directly do not need to change.
+
+@subsection upgrade_800_handle_outparams Handle out-parameter overloads deprecated
+
+Methods that previously returned `occ::handle<>` values via output parameters are deprecated in favour of return-by-value overloads in `ApplicationFramework`, `DataExchange`, `ModelingAlgorithms`, `ModelingData`, and `Visualization`:
+
+~~~~{.cpp}
+// Before (deprecated)
+occ::handle aDoc;
+anApp.GetDocument(aLabel, aDoc);
+
+// After
+occ::handle aDoc = anApp.GetDocument(aLabel);
+~~~~
+
+Many handle-returning APIs are now `[[nodiscard]]`.
+
+@subsection upgrade_800_mesh_factory Mesh: registry-based discrete-algorithm factory
+
+The legacy `DISCRETPLUGIN` / `DISCRETALGO` symbol-based plugin system is replaced with a registry-based factory. The headers `BRepMesh_PluginMacro.hxx`, `BRepMesh_PluginEntryType.hxx`, and `BRepMesh_FactoryError.hxx` are removed, as are the Draw commands `mpsetfunctionname`, `mpgetfunctionname`, `mperror`.
+
+Migrate plugin discovery to the new factory:
+
+~~~~{.cpp}
+// Before (removed)
+BRepMesh_PluginEntryType aFunc = BRepMesh::PluginEntry("DISCRETPLUGIN");
+
+// After
+occ::handle aFactory =
+ BRepMesh_DiscretAlgoFactory::FindFactory("FastDiscret");
+if (!aFactory.IsNull())
+{
+ occ::handle anAlgo = aFactory->Create();
+}
+~~~~
+
+`BRepMesh_IncrementalMeshFactory` is registered for the "FastDiscret" algorithm and `XBRepMesh_Factory` for the "XBRepMesh" extended meshing algorithm. Loading both `TKMesh` and `TKXMesh` no longer causes symbol collisions.
+
+@subsection upgrade_800_plib PLib refactoring- value types and removed classes
+
+The `PLib_Base` abstract handle class has been removed. `PLib_JacobiPolynomial` and `PLib_HermitJacobi` are now value types (no longer derived from `Standard_Transient`); their methods are non-virtual and `const`. Construct them on the stack or as direct members:
+
+~~~~{.cpp}
+// Before
+occ::handle aPoly = new PLib_JacobiPolynomial(theDegree, theNivConstr);
+aPoly->Points(...);
+
+// After
+PLib_JacobiPolynomial aPoly(theDegree, theNivConstr);
+aPoly.Points(...);
+~~~~
+
+`PLib_DoubleJacobiPolynomial` is removed entirely. There is no direct in-tree replacement- application code that depended on it must be ported manually to a combination of `PLib_JacobiPolynomial` and `PLib_HermitJacobi`, or rewritten against the new `Geom2dProp` / `GeomProp` differential-property packages where applicable.
+
+@subsection upgrade_800_std_math Standard math wrappers deprecated
+
+The OCCT-specific math wrapper functions are deprecated in favour of the `` / `` standard library equivalents:
+
+| Deprecated | Replacement |
+| ---------- | ----------- |
+| `ACos`, `ASin`, `ATan`, `Cos`, `Sin`, `Tan`, `Cosh`, `Sinh`, `Tanh` | `std::acos`, `std::asin`, ... |
+| `Exp`, `Log`, `Pow`, `Sqrt` | `std::exp`, `std::log`, `std::pow`, `std::sqrt` |
+| `Abs`, `Sign` | `std::abs`, `std::copysign` (or `<` comparison) |
+| `Floor`, `Ceiling`, `Round`, `IntegerPart` | `std::floor`, `std::ceil`, `std::round`, `std::trunc` |
+| `Min`, `Max` | `std::min`, `std::max` |
+| `NextAfter` | `std::nextafter` |
+
+@subsection upgrade_800_step_signature StepData_ReadWriteModule::StepType signature
+
+The pure virtual `StepType()` method on `StepData_ReadWriteModule` now returns `const std::string_view&` instead of `const TCollection_AsciiString&`. All subclasses must update their override to match. If your code stored or compared the result against `TCollection_AsciiString` instances, convert through `TCollection_AsciiString(theType.data(), int(theType.size()))` or compare against string literals directly.
+
+@subsection upgrade_800_ais_immediate AIS_InteractiveContext immediate-mode rendering deprecated
+
+The legacy immediate-mode rendering methods on `AIS_InteractiveContext` are deprecated. New code should use the retained-mode pipeline through `Display()` / `Redisplay()` and presentation updates. Specific deprecated entry points emit compiler warnings on use.
+
+@subsection upgrade_800_mutex Standard_Mutex superseded by std::mutex
+
+`Standard_Mutex` and its `Standard_Mutex::Sentry` RAII helper are deprecated. Use the standard library:
+
+~~~~{.cpp}
+// Before
+static Standard_Mutex theMutex;
+{
+ Standard_Mutex::Sentry aLock(theMutex);
+ ...
+}
+
+// After
+static std::mutex theMutex;
+{
+ std::lock_guard aLock(theMutex);
+ ...
+}
+~~~~
+
+`TopTools_MutexForShapeProvider` is removed. Where shape-level locking is needed, allocate a `std::mutex` directly. Several previously mutex-guarded internals in `BRepCheck_*` and Foundation globals have been converted to `thread_local` storage in 8.0.0, which may obviate the lock entirely.
+
+@subsection upgrade_800_visualization_unlit Visualization: implicit UNLIT shading removed
+
+The implicit optimization in `OpenGl_Aspects` that forced UNLIT shading when a material had no reflection properties has been removed. This was breaking PBR materials, interior color handling, and texture modulation. If your application relied on zero-material properties to obtain UNLIT shading, set the shading model explicitly:
+
+~~~~{.cpp}
+// After
+anAspect->SetShadingModel(Graphic3d_TypeOfShadingModel_Unlit);
+~~~~
+
+@subsection upgrade_800_bnd_intersected Bnd: IntersectStatus enum
+
+`Bnd_Range::IsIntersected()` previously returned a magic integer; it now returns the strongly-typed `Bnd_Range::IntersectStatus` enum:
+
+~~~~{.cpp}
+// Before
+int aResult = aRange.IsIntersected(...);
+
+// After
+Bnd_Range::IntersectStatus aResult = aRange.IsIntersected(...);
+~~~~
+
+Several `Bnd_*` accessors (`Center()`, `Min()`, `Max()`, `Get()`) now return `std::optional`. `Bnd_*` classes have been annotated with `[[nodiscard]]` and `noexcept` where appropriate; `Contains()` and `Intersects()` wrappers have been added.
+
+@subsection upgrade_800_geomadaptor_transformed Transformed adaptor changes
+
+`GeomAdaptor_TransformedSurface::GeomSurface()` is deprecated. Use the new original/transformed surface accessors instead. `GeomAdaptor_TransformedCurve` has been introduced as a new base class for `BRepAdaptor_Curve` that wraps a `GeomAdaptor_Curve` (or `Adaptor3d_CurveOnSurface`) with an applied `gp_Trsf`. `GeomAdaptor_Surface` exposes new `ToleranceU()` / `ToleranceV()` accessors.
+
+@subsection upgrade_800_geomhash GeomHash configurable tolerances
+
+Geometry hash classes now expose `CompTolerance` and `HashTolerance` fields and constructors instead of the previously hard-coded `1e-12` constant. Code that depended on the old constant should explicitly request the previous values via the constructors.
+
+@subsection upgrade_800_isclosed IsClosed/IsPeriodic tolerance change
+
+`IsClosed()` on curves and surfaces previously used `gp::Resolution()` (~1e-290), making the check practically unusable. It now uses `Precision::Computational()` (~`DBL_EPSILON`). Trimmed curves and surfaces now also detect integer-period spans when reporting `IsClosed()` / `IsPeriodic()`. Application code that relied on the previous near-zero tolerance must adjust its inputs or its expectations accordingly.
+
+@subsection upgrade_800_build Build and configuration
+
+- `USE_VTK` is now `OFF` by default. Builds that need VIS must opt in explicitly (`-DUSE_VTK=ON`).
+- ARM64 architecture is supported; CMake auto-detection and Windows ARM64 CI are added.
+- **glTF read/write (`USE_RAPIDJSON`)** is now an explicit dependency: glTF support is disabled when RapidJSON is not available. Set `-DUSE_RAPIDJSON=ON` (and ensure RapidJSON is discoverable, or use `BUILD_USE_VCPKG=ON`) to keep glTF.
+- **Documentation build is CMake-driven**. The legacy Tcl-based documentation entrypoints have been removed; use the `Overview`, `RefMan`, and `doc` CMake targets.
+- **`vcpkg` integration**- OCCT ships a vcpkg manifest at `adm/vcpkg/ports/opencascade/vcpkg.json` (referenced via `VCPKG_MANIFEST_DIR`). Configure with `-DBUILD_USE_VCPKG=ON` and the desired `USE_*` flags; the toolchain file is detected automatically from `VCPKG_ROOT`. CMake config files are now installed under `share//` for vcpkg compliance.
+- **Plugin discovery**- Data Exchange plugin registration is centralized through new `Register` / `UnRegister` static methods on configuration nodes, with `DE_MultiPluginHolder` for projects that load multiple providers.
+- Standard exception throw replaces legacy `Standard_Failure::Raise` throughout the OCCT source tree- any custom build system that grepped for `Raise(` should be updated.
+
+@subsection upgrade_800_removed Removed and deprecated- summary
+
+Removed (no backward-compatible alias):
+
+| Item | Replacement |
+| ---- | ----------- |
+| `Standard_Failure::Raise()`, `Instance()`, `Throw()` static methods | `throw Standard_Failure(...)` |
+| `Standard_ErrorHandler::Catches()` / `LastCaughtError()` | Implicit via execution flow / variant in handler |
+| `NCollection_Map::Seek()` / `ChangeSeek()` | `Contained()` returning `std::optional` |
+| `BRepMesh_PluginMacro.hxx`, `BRepMesh_PluginEntryType.hxx`, `BRepMesh_FactoryError.hxx` | `BRepMesh_DiscretAlgoFactory` |
+| Draw commands `mpsetfunctionname`, `mpgetfunctionname`, `mperror` | Not needed with factory pattern |
+| `TColGeom`, `TColGeom2d` packages | `NCollection_Array1>` |
+| `Geom2dLProp`, `LProp3d` packages | `GeomLProp` template classes (aliases preserved) |
+| `LProp_AnalyticCurInf` |- |
+| `GProp_EquaType` enum | `PointSetLib_Equation` |
+| `BUC60720` Draw command, `QABugs_PresentableObject` |- |
+| `PLib_Base` abstract class | `PLib_JacobiPolynomial` / `PLib_HermitJacobi` as value types |
+| `PLib_DoubleJacobiPolynomial` |- (port manually) |
+| `TopTools_MutexForShapeProvider` | `std::mutex` |
+| `OSD_MAllocHook` class, `mallochook` Draw command | Platform tools (Valgrind, AddressSanitizer) |
+| `QANCollection` test package | GTest-based tests under `src/.../GTests/` |
+| `BUILD_PATCH` CMake option |- (apply patches at source level) |
+| Legacy Tcl documentation entrypoints | `Overview`, `RefMan`, `doc` CMake targets |
+| Inspector, ExpToCas (in-tree) | Separate GitHub repositories |
+
+Deprecated (still compiles with warnings):
+
+| Item | Replacement |
+| ---- | ----------- |
+| `Standard_Failure::GetMessageString()` | `what()` |
+| Package collection typedefs (`TColStd_*`, `TopTools_*`, ...) | `NCollection_*` |
+| BSpline / Bezier copy-out accessor overloads | Const-reference returning versions |
+| Convert package single-element accessors | Batch const-reference accessors |
+| Nullable `Weights()` | `WeightsArray()` |
+| `GProp_PGProps`, `GProp_PEquation`, `GProp_CelGProps`, `GProp_SelGProps`, `GProp_VelGProps` | `PointSetLib_Props`, `PointSetLib_Equation` |
+| `GeomAdaptor_TransformedSurface::GeomSurface()` | Original/transformed surface accessors |
+| Handle out-parameter overloads | Return-by-value overloads |
+| `Standard_Mutex` (and `Standard_Mutex::Sentry`) | `std::mutex` (with `std::lock_guard`) |
+| OCCT math wrappers (`ACos`, `Sin`, `Sqrt`, `Min`, `Max`, ...) | `std::` equivalents in `` / `` |
+| `Transfer_TransferDeadLoop` exception | Status-flag-based dead-loop detection |
+| `AIS_InteractiveContext` immediate-mode rendering methods | Retained-mode pipeline |
diff --git a/dox/user_guides/de_wrapper/de_wrapper.md b/dox/user_guides/de_wrapper/de_wrapper.md
index 336d7e1de9..fe9367a54b 100644
--- a/dox/user_guides/de_wrapper/de_wrapper.md
+++ b/dox/user_guides/de_wrapper/de_wrapper.md
@@ -24,7 +24,7 @@ This guide principally deals with the following OCCT classes:
| CAD format | Extensions | RW support | Thread Safety | Presentation | Package |
| :--------- | :--------- | :--------- | :----------- | :----------- | :------ |
-| STEP | .stp, .step .stepz | RW | No | BRep, Mesh | DESTEP |
+| STEP | .step, .stp, .stepz | RW | Yes (per-reader) | BRep, Mesh | DESTEP |
| XCAF | .xbf | RW | Yes | BRep, Mesh | DEXCAF |
| BREP | .brep | RW | Yes | BRep, Mesh | DEBREP |
| IGES | .igs, .iges | RW | No | BRep | DEIGES |
@@ -37,6 +37,7 @@ This guide principally deals with the following OCCT classes:
**Note** :
* The format names in the first column match the FormatName values used for configuration nodes.
* The VendorName for all listed CAD formats is "OCC".
+ * For STEP, thread safety requires that each concurrent call uses its own *DESTEP_Parameters* instance rather than relying on the process-wide *Interface_Static* settings. See the @ref occt_user_guides__step "STEP user guide" for details.
@section occt_de_wrapper_3 DE Session Configuration
@@ -153,10 +154,11 @@ Dump to resource string. If the vendors list is empty, saves all vendors. If the
occ::handle aSession = DE_Wrapper::GlobalWrapper();
NCollection_List aFormats;
NCollection_List aVendors;
- aFormats.Appends("STEP");
- aVendors.Appends("OCC");
+ aFormats.Append("STEP");
+ aVendors.Append("OCC");
bool aIsRecursive = true;
- TCollection_AsciiString aConf = aSession->aConf->Save(aIsRecursive, aFormats, aVendors);
+ TCollection_AsciiString aConfDump =
+ aSession->Save(aIsRecursive, aFormats, aVendors);
~~~~
Configure using a resource file. If the vendors list is empty, saves all vendors. If the providers list is empty, saves all providers of valid vendors.
~~~~{.cpp}
@@ -164,8 +166,8 @@ Configure using a resource file. If the vendors list is empty, saves all vendors
TCollection_AsciiString aPathToFile = "";
NCollection_List aFormats;
NCollection_List aVendors;
- aFormats.Appends("STEP");
- aVendors.Appends("OCC");
+ aFormats.Append("STEP");
+ aVendors.Append("OCC");
bool aIsRecursive = true;
if (!aSession->Save(aPathToFile, aIsRecursive, aFormats,aVendors))
{
@@ -249,8 +251,8 @@ If the high priority vendor's provider is not supported, a transfer operation is
occ::handle aSession = DE_Wrapper::GlobalWrapper();
TCollection_AsciiString aFormat = "STEP";
NCollection_List aVendors;
- aVendors.Appends("OCC"); // high priority
- aVendors.Appends("DTK");
+ aVendors.Append("OCC"); // high priority
+ aVendors.Append("DTK");
// Flag to disable not chosen vendors, in this case configuration is possible
// otherwise, lower their priority and continue to check ability to transfer
bool aToDisable = true;
@@ -291,7 +293,7 @@ Writing Shape to STEP file.
occ::handle aSession = DE_Wrapper::GlobalWrapper();
TCollection_AsciiString aPathToFile = "example.stp";
TopoDS_Shape aShFrom = ...;
- if (!aSession->Write(aPathToFile, aShRes))
+ if (!aSession->Write(aPathToFile, aShFrom))
{
Message::SendFail() << "Error: Can't write file";
}
diff --git a/dox/user_guides/draw_test_harness/draw_test_harness.md b/dox/user_guides/draw_test_harness/draw_test_harness.md
index b2d2ba726a..cdb93216d1 100644
--- a/dox/user_guides/draw_test_harness/draw_test_harness.md
+++ b/dox/user_guides/draw_test_harness/draw_test_harness.md
@@ -50,7 +50,7 @@ This documentation describes:
This document is a reference manual. It contains a full description of each command. All descriptions have the format illustrated below for the exit command.
-~~~~{.php}
+~~~~{.tcl}
exit
~~~~
@@ -58,7 +58,7 @@ Terminates the Draw, TCL session. If the commands are read from a file using the
**Example:**
-~~~~{.php}
+~~~~{.tcl}
# this is a very short example
exit
~~~~
@@ -66,7 +66,7 @@ exit
@subsection occt_draw_1_3 Getting started
-Install Draw and launch Emacs. Get a command line in Emacs using *Esc x* and key in *woksh*.
+Launch `DRAWEXE` from the CMake build directory after sourcing `env.sh`.
All DRAW Test Harness can be activated in the common executable called **DRAWEXE**. They are grouped in toolkits and can be loaded at run-time thereby implementing dynamically loaded plug-ins. Thus, it is possible to work only with the required commands adding them dynamically without leaving the Test Harness session.
@@ -74,12 +74,12 @@ Declaration of available plug-ins is done through the special resource file(s).
@subsubsection occt_draw_1_3_1 Launching DRAW Test Harness
-Test Harness executable *DRAWEXE* is located in the $CASROOT/\/bin directory (where \ is Win for Windows and Linux for Linux operating systems). Prior to launching it is important to make sure that the environment is correctly setup (usually this is done automatically after the installation process on Windows or after launching specific scripts on Linux).
+The Test Harness executable *DRAWEXE* is produced by the OCCT build and installed under the build / install `bin/` directory (per platform: e.g. `/win64/vc143/bin/`, `/lin64/gcc/bin/`, `/mac64/clang/bin/`). Prior to launching it, source the environment script generated next to it -- `env.sh` on Linux/macOS or `env.bat` on Windows -- so that `PATH`, `LD_LIBRARY_PATH` / `DYLD_LIBRARY_PATH` and the `CSF_*` resource variables are set correctly.
@subsubsection occt_draw_1_3_2 Plug-in resource file
-Open CASCADE Technology is shipped with the DrawPlugin resource file located in the |