Skip to content

Commit 93525ff

Browse files
mosfet80donovaly
authored andcommitted
removed references to OCC<7
1 parent e9890c0 commit 93525ff

Some content is hidden

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

46 files changed

+49
-714
lines changed

src/Mod/Import/App/AppImportPy.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -356,12 +356,7 @@ class Module : public Py::ExtensionModule<Module>
356356
// writer.SetColorMode(Standard_False);
357357
writer.Transfer(hDoc, STEPControl_AsIs);
358358

359-
// edit STEP header
360-
#if OCC_VERSION_HEX >= 0x060500
361359
APIHeaderSection_MakeHeader makeHeader(writer.ChangeWriter().Model());
362-
#else
363-
APIHeaderSection_MakeHeader makeHeader(writer.Writer().Model());
364-
#endif
365360
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
366361
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/Part")->GetGroup("STEP");
367362

src/Mod/Import/App/ExportOCAF.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,7 @@
7373
# include <TopoDS_Iterator.hxx>
7474
# include <APIHeaderSection_MakeHeader.hxx>
7575
# include <OSD_Exception.hxx>
76-
#if OCC_VERSION_HEX >= 0x060500
7776
# include <TDataXtd_Shape.hxx>
78-
# else
79-
# include <TDataStd_Shape.hxx>
80-
# endif
8177
#endif
8278

8379
#include <Base/Console.h>

src/Mod/Import/App/ImportOCAF.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,7 @@
7575
# include <TopoDS_Iterator.hxx>
7676
# include <APIHeaderSection_MakeHeader.hxx>
7777
# include <OSD_Exception.hxx>
78-
#if OCC_VERSION_HEX >= 0x060500
7978
# include <TDataXtd_Shape.hxx>
80-
# else
81-
# include <TDataStd_Shape.hxx>
82-
# endif
8379
#endif
8480

8581
#include <boost/algorithm/string.hpp>

src/Mod/Import/App/ImportOCAFAssembly.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,7 @@
5656
# include <TopoDS_Iterator.hxx>
5757
# include <APIHeaderSection_MakeHeader.hxx>
5858
# include <OSD_Exception.hxx>
59-
#if OCC_VERSION_HEX >= 0x060500
6059
# include <TDataXtd_Shape.hxx>
61-
# else
62-
# include <TDataStd_Shape.hxx>
63-
# endif
6460
#endif
6561

6662
#include "ImportOCAFAssembly.h"

src/Mod/Import/Gui/AppImportGuiPy.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,7 @@
7171
# include <XSControl_TransferReader.hxx>
7272
# include <XSControl_WorkSession.hxx>
7373

74-
#if OCC_VERSION_HEX >= 0x060500
7574
# include <TDataXtd_Shape.hxx>
76-
# else
77-
# include <TDataStd_Shape.hxx>
78-
# endif
7975
#if OCC_VERSION_HEX >= 0x070500
8076
# include <Message_ProgressRange.hxx>
8177
# include <RWGltf_CafWriter.hxx>
@@ -644,11 +640,8 @@ class Module : public Py::ExtensionModule<Module>
644640
writer.Transfer(hDoc, STEPControl_AsIs);
645641

646642
// edit STEP header
647-
#if OCC_VERSION_HEX >= 0x060500
648643
APIHeaderSection_MakeHeader makeHeader(writer.ChangeWriter().Model());
649-
#else
650-
APIHeaderSection_MakeHeader makeHeader(writer.Writer().Model());
651-
#endif
644+
652645
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
653646
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/Part")->GetGroup("STEP");
654647

src/Mod/MeshPart/App/MeshFlattening.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -196,15 +196,9 @@ ColMat<double, 3> FaceUnwrapper::interpolateFlatFace(const TopoDS_Face& face)
196196
// extract xyz poles, knots, weights, degree
197197
const Handle(Geom_Surface) &_surface = BRep_Tool::Surface(face);
198198
const Handle(Geom_BSplineSurface) &_bspline = Handle(Geom_BSplineSurface)::DownCast(_surface);
199-
#if OCC_VERSION_HEX < 0x070000
200-
TColStd_Array1OfReal _uknots(1, _bspline->NbUPoles() + _bspline->UDegree() + 1);
201-
TColStd_Array1OfReal _vknots(1, _bspline->NbVPoles() + _bspline->VDegree() + 1);
202-
_bspline->UKnotSequence(_uknots);
203-
_bspline->VKnotSequence(_vknots);
204-
#else
199+
205200
const TColStd_Array1OfReal &_uknots = _bspline->UKnotSequence();
206201
const TColStd_Array1OfReal &_vknots = _bspline->VKnotSequence();
207-
#endif
208202

209203
Eigen::VectorXd weights;
210204
weights.resize(_bspline->NbUPoles() * _bspline->NbVPoles());

src/Mod/Part/App/AppPartPy.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,11 +1172,7 @@ class Module : public Py::ExtensionModule<Module>
11721172
aPlane = new Geom_Plane(p, d);
11731173
}
11741174

1175-
BRepBuilderAPI_MakeFace Face(aPlane, 0.0, length, 0.0, width
1176-
#if OCC_VERSION_HEX >= 0x060502
1177-
, Precision::Confusion()
1178-
#endif
1179-
);
1175+
BRepBuilderAPI_MakeFace Face(aPlane, 0.0, length, 0.0, width, Precision::Confusion() );
11801176
return Py::asObject(new TopoShapeFacePy(new TopoShape((Face.Face()))));
11811177
}
11821178
catch (Standard_DomainError&) {

src/Mod/Part/App/Attacher.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -495,10 +495,8 @@ eRefType AttachEngine::getShapeType(const TopoDS_Shape& sh)
495495
case GeomAbs_BezierCurve:
496496
case GeomAbs_BSplineCurve:
497497
case GeomAbs_OtherCurve:
498-
#if OCC_VERSION_HEX >= 0x070000
499498
case GeomAbs_OffsetCurve:
500-
#endif
501-
return rtCurve;
499+
return rtCurve;
502500
}
503501
}break;
504502
case TopAbs_WIRE:

src/Mod/Part/App/BRepOffsetAPI_MakeOffsetFix.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,7 @@ BRepOffsetAPI_MakeOffsetFix::BRepOffsetAPI_MakeOffsetFix()
5252

5353
BRepOffsetAPI_MakeOffsetFix::BRepOffsetAPI_MakeOffsetFix(const GeomAbs_JoinType Join, const Standard_Boolean IsOpenResult)
5454
{
55-
#if OCC_VERSION_HEX >= 0x060900
5655
mkOffset.Init(Join, IsOpenResult);
57-
#else
58-
(void)IsOpenResult;
59-
mkOffset.Init(Join);
60-
#endif
6156
}
6257

6358
BRepOffsetAPI_MakeOffsetFix::~BRepOffsetAPI_MakeOffsetFix()

src/Mod/Part/App/BRepOffsetAPI_MakePipeShellPyImp.cpp

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::setSpineSupport(PyObject *args)
142142

143143
PyObject* BRepOffsetAPI_MakePipeShellPy::setAuxiliarySpine(PyObject *args)
144144
{
145-
#if OCC_VERSION_HEX >= 0x060700
146145
PyObject *spine, *curv, *keep;
147146
if (!PyArg_ParseTuple(args, "O!O!O!",&Part::TopoShapePy::Type,&spine
148147
,&PyBool_Type,&curv
@@ -178,31 +177,6 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::setAuxiliarySpine(PyObject *args)
178177
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
179178
return nullptr;
180179
}
181-
#else
182-
PyObject *spine, *curv, *keep;
183-
if (!PyArg_ParseTuple(args, "O!O!O!",&Part::TopoShapePy::Type,&spine
184-
,&PyBool_Type,&curv
185-
,&PyBool_Type,&keep))
186-
return 0;
187-
188-
try {
189-
const TopoDS_Shape& s = static_cast<Part::TopoShapePy*>(spine)->getTopoShapePtr()->getShape();
190-
if (s.IsNull() || s.ShapeType() != TopAbs_WIRE) {
191-
PyErr_SetString(PyExc_TypeError, "spine is not a wire");
192-
return 0;
193-
}
194-
195-
this->getBRepOffsetAPI_MakePipeShellPtr()->SetMode(
196-
TopoDS::Wire(s),
197-
PyObject_IsTrue(curv) ? Standard_True : Standard_False,
198-
PyObject_IsTrue(keep) ? Standard_True : Standard_False);
199-
Py_Return;
200-
}
201-
catch (Standard_Failure& e) {
202-
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
203-
return 0;
204-
}
205-
#endif
206180
}
207181

208182
PyObject* BRepOffsetAPI_MakePipeShellPy::add(PyObject *args, PyObject *kwds)
@@ -440,14 +414,8 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::setMaxDegree(PyObject *args)
440414
return nullptr;
441415

442416
try {
443-
#if OCC_VERSION_HEX >= 0x060800
444417
this->getBRepOffsetAPI_MakePipeShellPtr()->SetMaxDegree(degree);
445418
Py_Return;
446-
#else
447-
(void)args;
448-
PyErr_SetString(PyExc_RuntimeError, "requires OCC >= 6.8");
449-
return 0;
450-
#endif
451419
}
452420
catch (Standard_Failure& e) {
453421
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
@@ -462,14 +430,8 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::setMaxSegments(PyObject *args)
462430
return nullptr;
463431

464432
try {
465-
#if OCC_VERSION_HEX >= 0x060800
466433
this->getBRepOffsetAPI_MakePipeShellPtr()->SetMaxSegments(nbseg);
467434
Py_Return;
468-
#else
469-
(void)args;
470-
PyErr_SetString(PyExc_RuntimeError, "requires OCC >= 6.8");
471-
return 0;
472-
#endif
473435
}
474436
catch (Standard_Failure& e) {
475437
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());
@@ -484,13 +446,8 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::setForceApproxC1(PyObject *args)
484446
return nullptr;
485447

486448
try {
487-
#if OCC_VERSION_HEX >= 0x060700
488449
this->getBRepOffsetAPI_MakePipeShellPtr()->SetForceApproxC1(PyObject_IsTrue(obj) ? Standard_True : Standard_False);
489450
Py_Return;
490-
#else
491-
PyErr_SetString(PyExc_RuntimeError, "requires OCC >= 6.7");
492-
return 0;
493-
#endif
494451
}
495452
catch (Standard_Failure& e) {
496453
PyErr_SetString(PartExceptionOCCError, e.GetMessageString());

src/Mod/Part/App/FeaturePartFuse.cpp

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -112,34 +112,6 @@ App::DocumentObjectExecReturn *MultiFuse::execute(void)
112112
if (s.size() >= 2) {
113113
try {
114114
std::vector<ShapeHistory> history;
115-
#if OCC_VERSION_HEX <= 0x060800
116-
TopoDS_Shape resShape = s.front();
117-
if (resShape.IsNull())
118-
throw NullShapeException("Input shape is null");
119-
for (std::vector<TopoDS_Shape>::iterator it = s.begin()+1; it != s.end(); ++it) {
120-
if (it->IsNull())
121-
throw NullShapeException("Input shape is null");
122-
123-
// Let's call algorithm computing a fuse operation:
124-
BRepAlgoAPI_Fuse mkFuse(resShape, *it);
125-
// Let's check if the fusion has been successful
126-
if (!mkFuse.IsDone())
127-
throw BooleanException("Fusion failed");
128-
resShape = mkFuse.Shape();
129-
130-
ShapeHistory hist1 = buildHistory(mkFuse, TopAbs_FACE, resShape, mkFuse.Shape1());
131-
ShapeHistory hist2 = buildHistory(mkFuse, TopAbs_FACE, resShape, mkFuse.Shape2());
132-
if (history.empty()) {
133-
history.push_back(hist1);
134-
history.push_back(hist2);
135-
}
136-
else {
137-
for (std::vector<ShapeHistory>::iterator jt = history.begin(); jt != history.end(); ++jt)
138-
*jt = joinHistory(*jt, hist1);
139-
history.push_back(hist2);
140-
}
141-
}
142-
#else
143115
BRepAlgoAPI_Fuse mkFuse;
144116
TopTools_ListOfShape shapeArguments,shapeTools;
145117
const TopoDS_Shape& shape = s.front();
@@ -163,7 +135,6 @@ App::DocumentObjectExecReturn *MultiFuse::execute(void)
163135
for (std::vector<TopoDS_Shape>::iterator it = s.begin(); it != s.end(); ++it) {
164136
history.push_back(buildHistory(mkFuse, TopAbs_FACE, resShape, *it));
165137
}
166-
#endif
167138
if (resShape.IsNull())
168139
throw Base::RuntimeError("Resulting shape is null");
169140

src/Mod/Part/App/FeaturePartSection.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ short Section::mustExecute() const
5151
BRepAlgoAPI_BooleanOperation* Section::makeOperation(const TopoDS_Shape& base, const TopoDS_Shape& tool) const
5252
{
5353
// Let's call algorithm computing a section operation:
54-
#if OCC_VERSION_HEX < 0x060900
55-
return new BRepAlgoAPI_Section(base, tool);
56-
#else
54+
5755
bool approx = Approximation.getValue();
5856
std::unique_ptr<BRepAlgoAPI_Section> mkSection(new BRepAlgoAPI_Section());
5957
mkSection->Init1(base);
@@ -63,5 +61,4 @@ BRepAlgoAPI_BooleanOperation* Section::makeOperation(const TopoDS_Shape& base, c
6361
if (!mkSection->IsDone())
6462
throw Base::RuntimeError("Section failed");
6563
return mkSection.release();
66-
#endif
6764
}

src/Mod/Part/App/Geom2d/Geometry2dPyImp.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -143,13 +143,7 @@ PyObject* Geometry2dPy::transform(PyObject *args)
143143
double a23 = static_cast<double>(Py::Float(list.getItem(5)));
144144

145145
gp_Trsf mat;
146-
mat.SetValues(a11, a12, 0, a13,
147-
a21, a22, 0, a23,
148-
0 , 0, 1, 0
149-
#if OCC_VERSION_HEX < 0x060800
150-
, 0.00001,0.00001
151-
#endif
152-
); //precision was removed in OCCT CR0025194
146+
mat.SetValues(a11, a12, 0, a13, a21, a22, 0, a23, 0, 0, 1, 0);
153147
gp_Trsf2d trf(mat);
154148

155149
getGeometry2dPtr()->handle()->Transform(trf);

src/Mod/Part/App/Geometry.cpp

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -462,11 +462,7 @@ void Geometry::transform(const Base::Matrix4D& mat)
462462
gp_Trsf trf;
463463
trf.SetValues(mat[0][0],mat[0][1],mat[0][2],mat[0][3],
464464
mat[1][0],mat[1][1],mat[1][2],mat[1][3],
465-
mat[2][0],mat[2][1],mat[2][2],mat[2][3]
466-
#if OCC_VERSION_HEX < 0x060800
467-
, 0.00001,0.00001
468-
#endif
469-
); //precision was removed in OCCT CR0025194
465+
mat[2][0],mat[2][1],mat[2][2],mat[2][3]);
470466
handle()->Transform(trf);
471467
}
472468

@@ -2138,11 +2134,8 @@ void GeomArcOfConic::setXAxisDir(const Base::Vector3d& newdir)
21382134
Handle(Geom_TrimmedCurve) curve = Handle(Geom_TrimmedCurve)::DownCast(handle());
21392135
Handle(Geom_Conic) c = Handle(Geom_Conic)::DownCast( curve->BasisCurve() );
21402136
assert(!c.IsNull());
2141-
#if OCC_VERSION_HEX >= 0x060504
2137+
21422138
if (newdir.Sqr() < Precision::SquareConfusion())
2143-
#else
2144-
if (newdir.Length() < Precision::Confusion())
2145-
#endif
21462139
return;//zero vector was passed. Keep the old orientation.
21472140

21482141
try {
@@ -2722,11 +2715,7 @@ Base::Vector3d GeomEllipse::getMajorAxisDir() const
27222715
*/
27232716
void GeomEllipse::setMajorAxisDir(Base::Vector3d newdir)
27242717
{
2725-
#if OCC_VERSION_HEX >= 0x060504
27262718
if (newdir.Sqr() < Precision::SquareConfusion())
2727-
#else
2728-
if (newdir.Length() < Precision::Confusion())
2729-
#endif
27302719
return;//zero vector was passed. Keep the old orientation.
27312720
try {
27322721
gp_Ax2 pos = myCurve->Position();
@@ -2941,11 +2930,7 @@ void GeomArcOfEllipse::setMajorAxisDir(Base::Vector3d newdir)
29412930
{
29422931
Handle(Geom_Ellipse) c = Handle(Geom_Ellipse)::DownCast( myCurve->BasisCurve() );
29432932
assert(!c.IsNull());
2944-
#if OCC_VERSION_HEX >= 0x060504
29452933
if (newdir.Sqr() < Precision::SquareConfusion())
2946-
#else
2947-
if (newdir.Length() < Precision::Confusion())
2948-
#endif
29492934
return;//zero vector was passed. Keep the old orientation.
29502935
try {
29512936
gp_Ax2 pos = c->Position();
@@ -3379,11 +3364,7 @@ void GeomArcOfHyperbola::setMajorAxisDir(Base::Vector3d newdir)
33793364
{
33803365
Handle(Geom_Hyperbola) c = Handle(Geom_Hyperbola)::DownCast( myCurve->BasisCurve() );
33813366
assert(!c.IsNull());
3382-
#if OCC_VERSION_HEX >= 0x060504
33833367
if (newdir.Sqr() < Precision::SquareConfusion())
3384-
#else
3385-
if (newdir.Length() < Precision::Confusion())
3386-
#endif
33873368
return;//zero vector was passed. Keep the old orientation.
33883369

33893370
try {
@@ -4239,11 +4220,7 @@ TopoDS_Shape GeomSurface::toShape() const
42394220
Handle(Geom_Surface) s = Handle(Geom_Surface)::DownCast(handle());
42404221
Standard_Real u1,u2,v1,v2;
42414222
s->Bounds(u1,u2,v1,v2);
4242-
BRepBuilderAPI_MakeFace mkBuilder(s, u1, u2, v1, v2
4243-
#if OCC_VERSION_HEX >= 0x060502
4244-
, Precision::Confusion()
4245-
#endif
4246-
);
4223+
BRepBuilderAPI_MakeFace mkBuilder(s, u1, u2, v1, v2, Precision::Confusion() );
42474224
return mkBuilder.Shape();
42484225
}
42494226

@@ -4255,7 +4232,6 @@ bool GeomSurface::tangentU(double u, double v, gp_Dir& dirU) const
42554232
prop.TangentU(dirU);
42564233
return true;
42574234
}
4258-
42594235
return false;
42604236
}
42614237

@@ -5555,13 +5531,11 @@ std::unique_ptr<GeomCurve> makeFromCurveAdaptor(const Adaptor3d_Curve& adapt)
55555531
geoCurve.reset(new GeomBSplineCurve(adapt.BSpline()));
55565532
break;
55575533
}
5558-
#if OCC_VERSION_HEX >= 0x070000
55595534
case GeomAbs_OffsetCurve:
55605535
{
55615536
geoCurve.reset(new GeomOffsetCurve(adapt.OffsetCurve()));
55625537
break;
55635538
}
5564-
#endif
55655539
case GeomAbs_OtherCurve:
55665540
default:
55675541
break;

src/Mod/Part/App/GeometrySurfacePyImp.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,7 @@ PyObject* GeometrySurfacePy::toShape(PyObject *args)
136136
s->Bounds(u1,u2,v1,v2);
137137
if (!PyArg_ParseTuple(args, "|dddd", &u1,&u2,&v1,&v2))
138138
return nullptr;
139-
BRepBuilderAPI_MakeFace mkBuilder(s, u1, u2, v1, v2
140-
#if OCC_VERSION_HEX >= 0x060502
141-
, Precision::Confusion()
142-
#endif
143-
);
139+
BRepBuilderAPI_MakeFace mkBuilder(s, u1, u2, v1, v2, Precision::Confusion() );
144140
TopoDS_Shape sh = mkBuilder.Shape();
145141
return new TopoShapeFacePy(new TopoShape(sh));
146142
}

0 commit comments

Comments
 (0)