2023-03-21 20:15:01 +01:00
|
|
|
/********************************************************************************
|
|
|
|
|
* *
|
|
|
|
|
* This file is part of IfcOpenShell. *
|
|
|
|
|
* *
|
|
|
|
|
* IfcOpenShell is free software: you can redistribute it and/or modify *
|
|
|
|
|
* it under the terms of the Lesser GNU General Public License as published by *
|
|
|
|
|
* the Free Software Foundation, either version 3.0 of the License, or *
|
|
|
|
|
* (at your option) any later version. *
|
|
|
|
|
* *
|
|
|
|
|
* IfcOpenShell is distributed in the hope that it will be useful, *
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
|
|
* Lesser GNU General Public License for more details. *
|
|
|
|
|
* *
|
|
|
|
|
* You should have received a copy of the Lesser GNU General Public License *
|
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
|
|
|
|
* *
|
|
|
|
|
********************************************************************************/
|
|
|
|
|
|
|
|
|
|
#ifndef IFCGEOMOPENCASCADEREPRESENTATION_H
|
|
|
|
|
#define IFCGEOMOPENCASCADEREPRESENTATION_H
|
|
|
|
|
|
|
|
|
|
#include <BRepMesh_IncrementalMesh.hxx>
|
|
|
|
|
#include <BRepGProp_Face.hxx>
|
|
|
|
|
|
|
|
|
|
#include <Poly_Triangulation.hxx>
|
|
|
|
|
#include <TColgp_Array1OfPnt.hxx>
|
|
|
|
|
#include <TColgp_Array1OfPnt2d.hxx>
|
|
|
|
|
|
|
|
|
|
#include <TopExp_Explorer.hxx>
|
|
|
|
|
#include <BRepTools.hxx>
|
|
|
|
|
|
|
|
|
|
#include <gp_GTrsf.hxx>
|
|
|
|
|
#include <BRepAdaptor_Curve.hxx>
|
|
|
|
|
#include <GCPnts_QuasiUniformDeflection.hxx>
|
|
|
|
|
|
|
|
|
|
#include "../../../ifcgeom/ConversionResult.h"
|
|
|
|
|
|
|
|
|
|
namespace ifcopenshell {
|
|
|
|
|
namespace geometry {
|
|
|
|
|
|
|
|
|
|
class OpenCascadeShape : public IfcGeom::ConversionResultShape {
|
|
|
|
|
public:
|
|
|
|
|
OpenCascadeShape(const TopoDS_Shape& shape)
|
|
|
|
|
: shape_(shape) {}
|
|
|
|
|
|
|
|
|
|
const TopoDS_Shape& shape() const { return shape_; }
|
|
|
|
|
operator const TopoDS_Shape& () { return shape_; }
|
|
|
|
|
|
|
|
|
|
virtual void Triangulate(const IfcGeom::IteratorSettings& settings, const ifcopenshell::geometry::taxonomy::matrix4& place, IfcGeom::Representation::Triangulation* t, int surface_style_id) const;
|
|
|
|
|
|
2023-08-26 11:35:23 +02:00
|
|
|
virtual void Serialize(const ifcopenshell::geometry::taxonomy::matrix4& place, std::string&) const;
|
2023-03-21 20:15:01 +01:00
|
|
|
|
|
|
|
|
virtual IfcGeom::ConversionResultShape* clone() const {
|
|
|
|
|
return new OpenCascadeShape(shape_);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
virtual bool is_manifold() const;
|
|
|
|
|
|
|
|
|
|
virtual double bounding_box(void*&) const {
|
|
|
|
|
throw std::runtime_error("Not implemented");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
virtual int num_vertices() const {
|
|
|
|
|
throw std::runtime_error("Not implemented");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
virtual void set_box(void*) {
|
|
|
|
|
throw std::runtime_error("Not implemented");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
virtual int surface_genus() const;
|
|
|
|
|
private:
|
|
|
|
|
TopoDS_Shape shape_;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif
|