mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-05 23:41:44 +00:00
OCC_VER Compatibility
This commit is contained in:
@@ -38,6 +38,7 @@
|
|||||||
#include <BRepClass3d_SolidClassifier.hxx>
|
#include <BRepClass3d_SolidClassifier.hxx>
|
||||||
|
|
||||||
#include <Standard_Macro.hxx>
|
#include <Standard_Macro.hxx>
|
||||||
|
#include <Standard_Version.hxx>
|
||||||
#include <TopoDS_Shape.hxx>
|
#include <TopoDS_Shape.hxx>
|
||||||
#include <Standard_Integer.hxx>
|
#include <Standard_Integer.hxx>
|
||||||
#include <TopTools_ShapeMapHasher.hxx>
|
#include <TopTools_ShapeMapHasher.hxx>
|
||||||
@@ -1932,7 +1933,11 @@ namespace IfcGeom {
|
|||||||
BVH_Triangulation<double, 3> triangulation(builder);
|
BVH_Triangulation<double, 3> triangulation(builder);
|
||||||
|
|
||||||
for (int i = 0; i < elem_verts.size(); i += 3) {
|
for (int i = 0; i < elem_verts.size(); i += 3) {
|
||||||
|
#if OCC_VERSION_HEX >= 0x80000
|
||||||
triangulation.Vertices.Append(BVH_Vec3d(elem_verts[i], elem_verts[i + 1], elem_verts[i + 2]));
|
triangulation.Vertices.Append(BVH_Vec3d(elem_verts[i], elem_verts[i + 1], elem_verts[i + 2]));
|
||||||
|
#else
|
||||||
|
triangulation.Vertices.push_back(BVH_Vec3d(elem_verts[i], elem_verts[i + 1], elem_verts[i + 2]));
|
||||||
|
#endif
|
||||||
verts.push_back(gp_Pnt(elem_verts[i], elem_verts[i + 1], elem_verts[i + 2]));
|
verts.push_back(gp_Pnt(elem_verts[i], elem_verts[i + 1], elem_verts[i + 2]));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1944,7 +1949,11 @@ namespace IfcGeom {
|
|||||||
gp_Vec dir2(v1_pnt, v3_pnt);
|
gp_Vec dir2(v1_pnt, v3_pnt);
|
||||||
gp_Vec cross_product = dir1.Crossed(dir2);
|
gp_Vec cross_product = dir1.Crossed(dir2);
|
||||||
if (cross_product.Magnitude() > Precision::Confusion()) {
|
if (cross_product.Magnitude() > Precision::Confusion()) {
|
||||||
|
#if OCC_VERSION_HEX >= 0x80000
|
||||||
triangulation.Elements.Append(BVH_Vec4i(
|
triangulation.Elements.Append(BVH_Vec4i(
|
||||||
|
#else
|
||||||
|
triangulation.Elements.push_back(BVH_Vec4i(
|
||||||
|
#endif
|
||||||
elem_faces[i], elem_faces[i + 1], elem_faces[i + 2], original_tris_index
|
elem_faces[i], elem_faces[i + 1], elem_faces[i + 2], original_tris_index
|
||||||
));
|
));
|
||||||
original_tris_index++;
|
original_tris_index++;
|
||||||
|
|||||||
@@ -42,9 +42,14 @@
|
|||||||
#include <BRepAlgoAPI_Section.hxx>
|
#include <BRepAlgoAPI_Section.hxx>
|
||||||
#include <ShapeAnalysis_FreeBounds.hxx>
|
#include <ShapeAnalysis_FreeBounds.hxx>
|
||||||
|
|
||||||
|
#include <Standard_Version.hxx>
|
||||||
|
#if OCC_VERSION_HEX >= 0x80000
|
||||||
#include <Standard_Macro.hxx>
|
#include <Standard_Macro.hxx>
|
||||||
#include <TopoDS_Shape.hxx>
|
#include <TopoDS_Shape.hxx>
|
||||||
#include <NCollection_HSequence.hxx>
|
#include <NCollection_HSequence.hxx>
|
||||||
|
#else
|
||||||
|
#include <TopTools_HSequenceOfShape.hxx>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <TopExp.hxx>
|
#include <TopExp.hxx>
|
||||||
|
|
||||||
@@ -57,7 +62,6 @@
|
|||||||
#include <Geom_Circle.hxx>
|
#include <Geom_Circle.hxx>
|
||||||
#include <Geom_Ellipse.hxx>
|
#include <Geom_Ellipse.hxx>
|
||||||
#include <gp_Ax22d.hxx>
|
#include <gp_Ax22d.hxx>
|
||||||
#include <Standard_Version.hxx>
|
|
||||||
#include <GeomAPI.hxx>
|
#include <GeomAPI.hxx>
|
||||||
#include <TopoDS_Wire.hxx>
|
#include <TopoDS_Wire.hxx>
|
||||||
|
|
||||||
@@ -1438,8 +1442,13 @@ void SvgSerializer::write(const geometry_data& data) {
|
|||||||
result = make_transform_mirror_.Shape();
|
result = make_transform_mirror_.Shape();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if OCC_VERSION_HEX >= 0x80000
|
||||||
opencascade::handle<NCollection_HSequence<TopoDS_Shape>> edges = new NCollection_HSequence<TopoDS_Shape>();
|
opencascade::handle<NCollection_HSequence<TopoDS_Shape>> edges = new NCollection_HSequence<TopoDS_Shape>();
|
||||||
opencascade::handle<NCollection_HSequence<TopoDS_Shape>> wires = new NCollection_HSequence<TopoDS_Shape>();
|
opencascade::handle<NCollection_HSequence<TopoDS_Shape>> wires = new NCollection_HSequence<TopoDS_Shape>();
|
||||||
|
#else
|
||||||
|
Handle(TopTools_HSequenceOfShape) edges = new TopTools_HSequenceOfShape();
|
||||||
|
Handle(TopTools_HSequenceOfShape) wires = new TopTools_HSequenceOfShape();
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
TopExp_Explorer exp(result, TopAbs_EDGE);
|
TopExp_Explorer exp(result, TopAbs_EDGE);
|
||||||
for (; exp.More(); exp.Next()) {
|
for (; exp.More(); exp.Next()) {
|
||||||
|
|||||||
@@ -22,9 +22,14 @@
|
|||||||
#ifdef IFOPSH_WITH_OPENCASCADE
|
#ifdef IFOPSH_WITH_OPENCASCADE
|
||||||
#include "../ifcgeom/kernels/opencascade/OpenCascadeConversionResult.h"
|
#include "../ifcgeom/kernels/opencascade/OpenCascadeConversionResult.h"
|
||||||
|
|
||||||
|
#include <Standard_Version.hxx>
|
||||||
|
#if OCC_VERSION_HEX >= 0x80000
|
||||||
#include <Standard_Macro.hxx>
|
#include <Standard_Macro.hxx>
|
||||||
#include <TopoDS_Shape.hxx>
|
#include <TopoDS_Shape.hxx>
|
||||||
#include <NCollection_HSequence.hxx>
|
#include <NCollection_HSequence.hxx>
|
||||||
|
#else
|
||||||
|
#include <TopTools_HSequenceOfShape.hxx>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <BRepBuilderAPI_Transform.hxx>
|
#include <BRepBuilderAPI_Transform.hxx>
|
||||||
#include <BRepBndLib.hxx>
|
#include <BRepBndLib.hxx>
|
||||||
@@ -411,13 +416,21 @@ void TtlWktSerializer::write(const IfcGeom::BRepElement* brep_obj) {
|
|||||||
for (int iter = 0; iter < 10; ++iter) {
|
for (int iter = 0; iter < 10; ++iter) {
|
||||||
|
|
||||||
gp_Pln pln(gp_Pnt(0, 0, zmin + section_height + iter * (height - 1.) / 10.), gp::DZ());
|
gp_Pln pln(gp_Pnt(0, 0, zmin + section_height + iter * (height - 1.) / 10.), gp::DZ());
|
||||||
|
#if OCC_VERSION_HEX >= 0x80000
|
||||||
opencascade::handle<NCollection_HSequence<TopoDS_Shape>> wires = new NCollection_HSequence<TopoDS_Shape>();
|
opencascade::handle<NCollection_HSequence<TopoDS_Shape>> wires = new NCollection_HSequence<TopoDS_Shape>();
|
||||||
|
#else
|
||||||
|
Handle(TopTools_HSequenceOfShape) wires = new TopTools_HSequenceOfShape();
|
||||||
|
#endif
|
||||||
|
|
||||||
size_t N = 0;
|
size_t N = 0;
|
||||||
TopoDS_Iterator it(compound);
|
TopoDS_Iterator it(compound);
|
||||||
// Iterate over components of compound to have better chance of matching section edges to closed wires
|
// Iterate over components of compound to have better chance of matching section edges to closed wires
|
||||||
for (; it.More(); it.Next()) {
|
for (; it.More(); it.Next()) {
|
||||||
|
#if OCC_VERSION_HEX >= 0x80000
|
||||||
opencascade::handle<NCollection_HSequence<TopoDS_Shape>> edges = new NCollection_HSequence<TopoDS_Shape>();
|
opencascade::handle<NCollection_HSequence<TopoDS_Shape>> edges = new NCollection_HSequence<TopoDS_Shape>();
|
||||||
|
#else
|
||||||
|
Handle(TopTools_HSequenceOfShape) edges = new TopTools_HSequenceOfShape();
|
||||||
|
#endif
|
||||||
TopoDS_Shape result = BRepAlgoAPI_Section(it.Value(), pln);
|
TopoDS_Shape result = BRepAlgoAPI_Section(it.Value(), pln);
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user