Skip to content

Commit 636da4c

Browse files
Start with 7.8 (#146)
* Start with 7.8 * Add 7.8.0 headers * Update parsing headers * Syntax fix * Another missing header * Update pywrap * 7.8 compiles * Update pywrap * Update meta.yaml for 7.8 * Update pywrap again * Update pywrap * STEPControl fix * Trying with newer gcc * Use conda compilers * Do not use cxx-compiler for generate * Add gl headers * Skip Standard_MemoryUtils.hxx * Update headers for 7.8.1 * Update env specs * Update to latest build * Install occt only in the compile stage * Revert * Remove libcxx * Revert chagnes to ChFi3d.hxx
1 parent c692e6e commit 636da4c

File tree

534 files changed

+7350
-8713
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

534 files changed

+7350
-8713
lines changed

build-bindings-job.yml

+2-5
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ parameters:
1111
config_file: 'ocp.toml'
1212
conda_bld: '3.27.0'
1313
conda_env_file: 'environment.devenv.yml'
14-
CXX: g++-8
14+
CXX: g++-12
1515

1616
jobs:
1717
- job: ${{ parameters.name }}
@@ -128,8 +128,6 @@ jobs:
128128
cmake --build build -j $(n_cores) -- -k 0 && \
129129
rm -rf build/CMakeFiles
130130
displayName: 'Compile'
131-
env:
132-
CXX: ${{ parameters.CXX }}
133131
134132
- ${{ if contains(parameters.vmImage, 'mac') }}:
135133
- bash: |
@@ -140,8 +138,7 @@ jobs:
140138
cmake --build build -j $(n_cores) -- -k 0 && \
141139
rm -rf build/CMakeFiles
142140
displayName: 'Compile'
143-
env:
144-
CXX: "clang++"
141+
145142
146143
- ${{ if contains(parameters.vmImage, 'win') }}:
147144
- script: |

conda/meta.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
{% set OCCT_VER = "7.7.2" %}
2-
{% set OCP_TWEAK = "1" %}
1+
{% set OCCT_VER = "7.8.1" %}
2+
{% set OCP_TWEAK = "0" %}
33

44
package:
55
name: ocp

environment.devenv.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ channels:
44
dependencies:
55
- boost-cpp=1.84.* # [not osx]
66
- boost-cpp=1.82.* # [osx]
7-
- occt=7.7.2=all*
87
- vtk=9.2.6=*220 # [not osx]
98
- vtk=9.2.6=*218 # [osx]
9+
- occt=7.8.1=all*
1010
- pybind11=2.10.*
1111
- python={{ get_env("PYTHON_VERSION", default="3.9") }}
1212
- cmake >3.24
@@ -15,7 +15,6 @@ dependencies:
1515
- git+https://github.com/CadQuery/pybind11-stubgen.git
1616
{% if get_env("STAGE", default="generate") == "generate" %}
1717
- clangdev=15.*
18-
- libcxx=15.* # [not win]
1918
- python-clang
2019
- joblib
2120
- toml
@@ -29,4 +28,7 @@ dependencies:
2928
- tqdm
3029
- toposort
3130
- py-lief
31+
{% else %}
32+
- cxx-compiler # [not win]
33+
- mesa-libgl-devel-cos6-x86_64 # [linux]
3234
{% endif %}

ocp.toml

+52-4
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ modules = ["Standard",
330330
"IMeshData",
331331
"APIHeaderSection"]
332332

333-
exclude = ["Standard_Handle.hxx","Standard",
333+
exclude = ["Standard_Handle.hxx","Standard", "Standard_MemoryUtils.hxx",
334334
"math_GaussPoints.hxx","NCollection_Shared.hxx","OSD_WNT.hxx",
335335
"Geom2dToIGES","BRepGProp_Gauss.hxx","BRepLib_CheckCurveOnSurface.hxx",
336336
"BVH_Types.hxx","BVH_RadixSorter.hxx","BVH_IndexedBoxSet.hxx",
@@ -430,9 +430,26 @@ class Adaptor3d_Surface;
430430

431431
include_header_pre_top = """#include <gp_XYZ.hxx>
432432
#include <gp_XY.hxx>"""
433-
include_header_pre = "const size_t DefaultBlockSize = 24600;"
433+
include_header_pre = """const size_t DefaultBlockSize = 24600;
434+
const size_t THE_DEFAULT_BLOCK_SIZE = DefaultBlockSize;"""
434435
exclude_classes = ["NCollection","NCollection_ListNode"]
435436

437+
include_body_template_post="""
438+
template <typename T>
439+
void preregister_template_NCollection_Vector(py::object &m, const char *name){
440+
preregister_template_NCollection_DynamicArray<T>(m, name);
441+
};
442+
443+
template <typename T>
444+
void register_template_NCollection_Vector(py::object &m, const char *name){
445+
register_template_NCollection_DynamicArray<T>(m, name);
446+
};
447+
"""
448+
449+
[Modules.NCollection.Templates.NCollection_Array1]
450+
451+
exclude_constructors = [3]
452+
436453
[Modules.NCollection.parsing_headers]
437454

438455
"NCollection_CellFilter.hxx" = """#include <gp_XYZ.hxx>
@@ -637,7 +654,6 @@ class Adaptor3d_Surface;
637654
[Modules.BOPDS.parsing_headers]
638655

639656
"BOPDS_DataMapOfPaveBlockListOfInteger.hxx" = "#include <BOPDS_PaveBlock.hxx>"
640-
"BOPDS_DataMapOfIntegerListOfPaveBlock.hxx" = "#include <TColStd_MapIntegerHasher.hxx>"
641657

642658
[Modules.BRepMesh]
643659

@@ -856,6 +872,10 @@ struct NSOpenGLContext {};"""
856872
exclude_classes = ["TDF_LabelNode"]
857873
exclude_methods = ["TDF_DerivedAttribute::Register", "TDF_Label::FindAttribute"]
858874

875+
[Modules.TDF.parsing_headers]
876+
877+
"TDF_LabelIndexedMap.hxx" = "#include <TDF_Label.hxx>"
878+
859879
[Modules.TDF.Classes.TDF_Label.additional_methods.FindAttribute]
860880

861881
body = "[]( TDF_Label & self , const Standard_GUID& anID, TDF_Attribute& anAttribute){ Handle(TDF_Attribute) dummy_attr; auto rv = self.FindAttribute(anID, dummy_attr); anAttribute.Restore(dummy_attr); return rv;}"
@@ -885,6 +905,7 @@ struct NSOpenGLContext {};"""
885905
[Modules.STEPConstruct.parsing_headers]
886906

887907
"STEPConstruct_PointHasher.hxx" = "#include <gp_Pnt.hxx>"
908+
"STEPConstruct_Styles.hxx" = "#include <StepData_StepModel.hxx>"
888909

889910
[Modules.RWStl]
890911

@@ -1336,12 +1357,19 @@ using rapidjson::BasicOStreamWrapper;"""
13361357
[Modules.TopoDSToStep.parsing_headers]
13371358

13381359
"TopoDSToStep_MakeTessellatedItem.hxx" = "class TopoDSToStep_Tool;"
1360+
"TopoDSToStep_MakeStepWire.hxx" = "#include <StepData_Factors.hxx>"
1361+
"TopoDSToStep_MakeShellBasedSurfaceModel.hxx" = "#include <StepData_Factors.hxx>"
1362+
"TopoDSToStep_MakeBrepWithVoids.hxx" = "#include <StepData_Factors.hxx>"
1363+
"TopoDSToStep_MakeStepVertex.hxx" = "#include <StepData_Factors.hxx>"
1364+
"TopoDSToStep_MakeGeometricCurveSet.hxx" = "#include <StepData_Factors.hxx>"
1365+
"TopoDSToStep_MakeFacetedBrepAndBrepWithVoids.hxx" = "#include <StepData_Factors.hxx>"
13391366

13401367
[Modules.XCAFDoc]
13411368

13421369
[Modules.XCAFDoc.parsing_headers]
13431370
"XCAFDoc_AssemblyTool.hxx" = "#include <TDF_Label.hxx>"
13441371
"XCAFDoc_AssemblyIterator.hxx" = "#include <TDF_Label.hxx>"
1372+
"XCAFDoc_AssemblyGraph.hxx" = "#include <TDF_Label.hxx>"
13451373

13461374
[Modules.DE]
13471375

@@ -1355,14 +1383,34 @@ using rapidjson::BasicOStreamWrapper;"""
13551383

13561384
include_header_pre = """
13571385
#include <IFSelect_ReturnStatus.hxx>
1386+
#include <istream>
13581387
#include <ostream>
1359-
using std::basic_ostream;"""
1388+
1389+
using std::basic_ostream;
1390+
using std::basic_istream;"""
13601391

13611392
[Modules.IMeshTools]
13621393

13631394
include_header_pre = """
13641395
#include <IMeshData_Face.hxx>"""
13651396

1397+
[Modules.GeomToStep]
1398+
1399+
[Modules.GeomToStep.parsing_headers]
1400+
1401+
"GeomToStep_MakeHyperbola.hxx" = "#include <StepData_Factors.hxx>"
1402+
1403+
[Modules.StepToTopoDS]
1404+
1405+
[Modules.StepToTopoDS.parsing_headers]
1406+
1407+
"StepToTopoDS_TranslateEdgeLoop.hxx" = "#include <StepData_Factors.hxx>"
1408+
"StepToTopoDS_TranslateShell.hxx" = "#include <StepData_Factors.hxx>"
1409+
"StepToTopoDS_TranslateSolid.hxx" = "#include <StepData_Factors.hxx>"
1410+
"StepToTopoDS_TranslateCurveBoundedSurface.hxx" = "#include <StepData_Factors.hxx>"
1411+
"StepToTopoDS_TranslateCompositeCurve.hxx" = "#include <StepData_Factors.hxx>"
1412+
"StepToTopoDS_Builder.hxx" = "#include <StepData_Factors.hxx>"
1413+
13661414
[Modules.APIHeaderSection]
13671415

13681416
include_header_pre = """

opencascade/AIS_ColoredShape.hxx

+1-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include <NCollection_IndexedDataMap.hxx>
2222
#include <TopoDS_Compound.hxx>
2323
#include <TopTools_MapOfShape.hxx>
24-
#include <TColStd_MapTransientHasher.hxx>
2524

2625
class StdSelect_BRepOwner;
2726

@@ -104,7 +103,7 @@ protected: //! @name override presentation computation
104103

105104
protected:
106105

107-
typedef NCollection_IndexedDataMap<Handle(AIS_ColoredDrawer), TopoDS_Compound, TColStd_MapTransientHasher> DataMapOfDrawerCompd;
106+
typedef NCollection_IndexedDataMap<Handle(AIS_ColoredDrawer), TopoDS_Compound> DataMapOfDrawerCompd;
108107

109108
protected:
110109

opencascade/AIS_DataMapOfIOStatus.hxx

+2-3
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,10 @@
1919

2020
#include <AIS_InteractiveObject.hxx>
2121
#include <AIS_GlobalStatus.hxx>
22-
#include <TColStd_MapTransientHasher.hxx>
2322
#include <NCollection_DataMap.hxx>
2423

25-
typedef NCollection_DataMap<Handle(AIS_InteractiveObject),Handle(AIS_GlobalStatus),TColStd_MapTransientHasher> AIS_DataMapOfIOStatus;
26-
typedef NCollection_DataMap<Handle(AIS_InteractiveObject),Handle(AIS_GlobalStatus),TColStd_MapTransientHasher>::Iterator AIS_DataMapIteratorOfDataMapOfIOStatus;
24+
typedef NCollection_DataMap<Handle(AIS_InteractiveObject),Handle(AIS_GlobalStatus)> AIS_DataMapOfIOStatus;
25+
typedef NCollection_DataMap<Handle(AIS_InteractiveObject),Handle(AIS_GlobalStatus)>::Iterator AIS_DataMapIteratorOfDataMapOfIOStatus;
2726

2827

2928
#endif

opencascade/AIS_DragAction.hxx

+5-4
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@
1717
//! Dragging action.
1818
enum AIS_DragAction
1919
{
20-
AIS_DragAction_Start, //!< (try) start dragging object
21-
AIS_DragAction_Update, //!< perform dragging (update position)
22-
AIS_DragAction_Stop, //!< stop dragging (save position)
23-
AIS_DragAction_Abort, //!< abort dragging (restore initial position)
20+
AIS_DragAction_Start, //!< (try) start dragging object
21+
AIS_DragAction_Confirmed, //!< dragging interaction is confirmed.
22+
AIS_DragAction_Update, //!< perform dragging (update position)
23+
AIS_DragAction_Stop, //!< stop dragging (save position)
24+
AIS_DragAction_Abort, //!< abort dragging (restore initial position)
2425
};
2526

2627
#endif // _AIS_DragAction_HeaderFile

opencascade/AIS_ViewCube.hxx

+2-11
Original file line numberDiff line numberDiff line change
@@ -640,18 +640,9 @@ protected:
640640

641641
protected:
642642

643-
//! Trivial hasher to avoid ambiguity with enumeration type.
644-
struct IntegerHasher
645-
{
646-
static Standard_Integer HashCode (Standard_Integer theValue, Standard_Integer theUpper) { return ::HashCode (theValue, theUpper); }
647-
static Standard_Boolean IsEqual (Standard_Integer theA, Standard_Integer theB) { return theA == theB; }
648-
};
649-
650-
protected:
651-
652-
NCollection_DataMap<V3d_TypeOfOrientation, TCollection_AsciiString, IntegerHasher>
643+
NCollection_DataMap<V3d_TypeOfOrientation, TCollection_AsciiString>
653644
myBoxSideLabels; //!< map with box side labels
654-
NCollection_DataMap<Prs3d_DatumParts, TCollection_AsciiString, IntegerHasher>
645+
NCollection_DataMap<Prs3d_DatumParts, TCollection_AsciiString>
655646
myAxesLabels; //!< map with axes labels
656647
Handle(Prs3d_ShadingAspect) myBoxEdgeAspect; //!< style for box edges
657648
Handle(Prs3d_ShadingAspect) myBoxCornerAspect; //!< style for box corner

opencascade/AIS_ViewInputBuffer.hxx

+9-7
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,14 @@ public:
8787
struct _draggingParams
8888
{
8989
bool ToStart; //!< start dragging
90+
bool ToConfirm; //!< confirm dragging
9091
bool ToMove; //!< perform dragging
9192
bool ToStop; //!< stop dragging
9293
bool ToAbort; //!< abort dragging (restore previous position)
9394
Graphic3d_Vec2i PointStart; //!< drag start point
9495
Graphic3d_Vec2i PointTo; //!< drag end point
9596

96-
_draggingParams() : ToStart (false), ToMove (false), ToStop (false), ToAbort (false) {}
97+
_draggingParams() : ToStart (false), ToConfirm (false), ToMove (false), ToStop (false), ToAbort (false) {}
9798
} Dragging;
9899

99100
struct _orbitRotation
@@ -139,12 +140,13 @@ public:
139140
Selection.ToApplyTool = false;
140141
IsNewGesture = false;
141142
ZoomActions.Clear();
142-
Panning.ToStart = false;
143-
Panning.ToPan = false;
144-
Dragging.ToStart = false;
145-
Dragging.ToMove = false;
146-
Dragging.ToStop = false;
147-
Dragging.ToAbort = false;
143+
Panning.ToStart = false;
144+
Panning.ToPan = false;
145+
Dragging.ToStart = false;
146+
Dragging.ToConfirm = false;
147+
Dragging.ToMove = false;
148+
Dragging.ToStop = false;
149+
Dragging.ToAbort = false;
148150
OrbitRotation.ToStart = false;
149151
OrbitRotation.ToRotate = false;
150152
ViewRotation.ToStart = false;

opencascade/AdvApprox_ApproxAFunction.hxx

-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
#include <TColgp_HArray2OfPnt2d.hxx>
3131
#include <TColgp_HArray2OfPnt.hxx>
3232
#include <TColStd_HArray1OfInteger.hxx>
33-
#include <Standard_Address.hxx>
3433
#include <AdvApprox_EvaluatorFunction.hxx>
3534
#include <TColStd_Array1OfInteger.hxx>
3635
#include <TColStd_Array1OfReal.hxx>

opencascade/AdvApprox_SimpleApprox.hxx

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
#include <Standard_Integer.hxx>
2525
#include <TColStd_HArray1OfReal.hxx>
2626
#include <TColStd_HArray2OfReal.hxx>
27-
#include <Standard_Address.hxx>
2827
#include <GeomAbs_Shape.hxx>
2928
#include <AdvApprox_EvaluatorFunction.hxx>
3029
#include <TColStd_Array1OfInteger.hxx>

opencascade/AppCont_LeastSquare.hxx

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include <math_Matrix.hxx>
2323
#include <NCollection_Array1.hxx>
2424
#include <AppParCurves_Constraint.hxx>
25-
25+
#include <math_Vector.hxx>
2626

2727
struct PeriodicityInfo
2828
{

opencascade/ApproxInt_KnotTools.hxx

+4-17
Original file line numberDiff line numberDiff line change
@@ -14,34 +14,21 @@
1414
#ifndef _ApproxInt_KnotTools_HeaderFile
1515
#define _ApproxInt_KnotTools_HeaderFile
1616

17-
#ifndef _Standard_DefineAlloc_HeaderFile
1817
#include <Standard_DefineAlloc.hxx>
19-
#endif
20-
#ifndef _Standard_Macro_HeaderFile
2118
#include <Standard_Macro.hxx>
22-
#endif
23-
24-
#ifndef _Standard_Boolean_HeaderFile
2519
#include <Standard_Boolean.hxx>
26-
#endif
27-
#ifndef _Standard_Real_HeaderFile
2820
#include <Standard_Real.hxx>
29-
#endif
30-
#ifndef _Standard_Integer_HeaderFile
3121
#include <Standard_Integer.hxx>
32-
#endif
33-
3422
#include <TColgp_Array1OfPnt2d.hxx>
23+
#include <NCollection_Sequence.hxx>
24+
#include <NCollection_List.hxx>
25+
#include <math_Vector.hxx>
3526
#include <TColgp_Array1OfPnt.hxx>
3627
#include <TColStd_Array1OfReal.hxx>
3728
#include <NCollection_LocalArray.hxx>
29+
#include <NCollection_Vector.hxx>
3830
#include <Approx_ParametrizationType.hxx>
3931

40-
class math_Vector;
41-
template <class A> class NCollection_Sequence;
42-
template <class A> class NCollection_List;
43-
template <class A> class NCollection_Vector;
44-
4532
class IntPatch_WLine;
4633

4734
// Corresponds for debug information output.

opencascade/Approx_BSplComputeLine.gxx

+6-4
Original file line numberDiff line numberDiff line change
@@ -808,8 +808,11 @@ void Approx_BSplComputeLine::Parameters(const MultiLine& Line,
808808
const Standard_Integer aNbp = lastP - firstP + 1;
809809

810810

811+
// The first parameter should always be zero according to all the logic below,
812+
// so division by any value will give zero anyway, so it should never be scaled
813+
// to avoid case when there is only one parameter in the array thus division by zero happens.
814+
TheParameters(firstP) = 0.0;
811815
if (aNbp == 2) {
812-
TheParameters(firstP) = 0.0;
813816
TheParameters(lastP) = 1.0;
814817
}
815818
else if (Par == Approx_ChordLength || Par == Approx_Centripetal)
@@ -820,7 +823,6 @@ void Approx_BSplComputeLine::Parameters(const MultiLine& Line,
820823
if (nbP3d == 0) mynbP3d = 1;
821824
if (nbP2d == 0) mynbP2d = 1;
822825

823-
TheParameters(firstP) = 0.0;
824826
dist = 0.0;
825827
TColgp_Array1OfPnt tabP(1, mynbP3d);
826828
TColgp_Array1OfPnt tabPP(1, mynbP3d);
@@ -861,10 +863,10 @@ void Approx_BSplComputeLine::Parameters(const MultiLine& Line,
861863
TheParameters(i) = TheParameters(i - 1) + Sqrt(dist);
862864
}
863865
}
864-
for (i = firstP; i <= lastP; i++) TheParameters(i) /= TheParameters(lastP);
866+
for (i = firstP + 1; i <= lastP; i++) TheParameters(i) /= TheParameters(lastP);
865867
}
866868
else {
867-
for (i = firstP; i <= lastP; i++) {
869+
for (i = firstP + 1; i <= lastP; i++) {
868870
TheParameters(i) = (Standard_Real(i) - firstP) /
869871
(Standard_Real(lastP - Standard_Real(firstP)));
870872
}

0 commit comments

Comments
 (0)