Files
IfcOpenShell/src/ifcgeom/kernels/cgal/CgalConversionResult.h
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

99 lines
3.8 KiB
C++
Raw Normal View History

2017-01-16 11:53:11 +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 CGALCONVERSIONRESULT_H
#define CGALCONVERSIONRESULT_H
2023-03-21 20:15:01 +01:00
#include "../../../ifcgeom/IfcGeomElement.h"
#undef Handle
#include <boost/property_map/property_map.hpp>
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
#include <CGAL/Polygon_mesh_processing/stitch_borders.h>
#include <CGAL/Polygon_mesh_processing/orientation.h>
#include <CGAL/Polygon_mesh_processing/triangulate_faces.h>
#include <CGAL/Polygon_mesh_processing/compute_normal.h>
#include <CGAL/Polygon_mesh_processing/self_intersections.h>
#include <CGAL/Nef_polyhedron_3.h>
2019-01-23 17:27:13 +01:00
typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel_;
2019-01-23 17:27:13 +01:00
typedef Kernel_::Aff_transformation_3 cgal_placement_t;
typedef Kernel_::Point_3 cgal_point_t;
typedef Kernel_::Vector_3 cgal_direction_t;
typedef Kernel_::Vector_3 cgal_vector_t;
typedef Kernel_::Plane_3 cgal_plane_t;
typedef std::vector<Kernel_::Point_3> cgal_curve_t;
typedef std::vector<Kernel_::Point_3> cgal_wire_t;
struct cgal_face_t {
cgal_wire_t outer;
std::vector<cgal_wire_t> inner;
};
2019-01-23 17:27:13 +01:00
typedef CGAL::Polyhedron_3<Kernel_> cgal_shape_t;
typedef boost::graph_traits<CGAL::Polyhedron_3<Kernel_>>::vertex_descriptor cgal_vertex_descriptor_t;
typedef boost::graph_traits<CGAL::Polyhedron_3<Kernel_>>::face_descriptor cgal_face_descriptor_t;
2019-01-19 12:39:47 +01:00
2023-03-21 20:15:01 +01:00
#include "../../../ifcgeom/ConversionResult.h"
2017-01-16 11:53:11 +01:00
2019-09-01 16:29:00 +02:00
namespace ifcopenshell { namespace geometry {
2019-01-18 15:19:00 +01:00
2023-03-21 20:15:01 +01:00
class CgalShape : public IfcGeom::ConversionResultShape {
2017-01-16 11:53:11 +01:00
public:
CgalShape(const cgal_shape_t& shape)
: shape_(shape)
{}
const cgal_shape_t& shape() const { return shape_; }
operator const cgal_shape_t& () { return shape_; }
2023-03-21 20:15:01 +01:00
virtual void Triangulate(const IfcGeom::IteratorSettings& settings, const ifcopenshell::geometry::taxonomy::matrix4& place, IfcGeom::Representation::Triangulation* t, int surface_style_id) const;
2019-01-18 15:19:00 +01:00
2017-01-16 11:53:11 +01:00
virtual void Serialize(std::string&) const {
throw std::runtime_error("Not implemented");
}
2019-01-18 15:19:00 +01:00
2023-03-21 20:15:01 +01:00
virtual IfcGeom::ConversionResultShape* clone() const {
2017-01-16 11:53:11 +01:00
return new CgalShape(shape_);
}
2019-01-18 15:19:00 +01:00
2019-09-01 16:29:00 +02:00
virtual bool is_manifold() const {
throw std::runtime_error("Not implemented");
}
2023-03-21 20:15:01 +01:00
virtual double bounding_box(void*&) const;
virtual int num_vertices() const;
virtual void set_box(void*);
virtual int surface_genus() const;
2017-01-16 11:53:11 +01:00
private:
cgal_shape_t shape_;
};
2019-09-01 16:29:00 +02:00
}}
2017-01-16 11:53:11 +01:00
#endif