mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-31 08:56:34 +00:00
Flatten the geometry representation namespace
Generated with the assistance of an AI coding tool.
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
#include "conversion_result.h"
|
||||
#include "representation.h"
|
||||
|
||||
ifcopenshell::geom::Representation::triangulation* ifcopenshell::geom::conversion_result_shape::Triangulate(const ifcopenshell::geom::settings& settings, ifcopenshell::logger& logger) const
|
||||
ifcopenshell::geom::triangulation* ifcopenshell::geom::conversion_result_shape::Triangulate(const ifcopenshell::geom::settings& settings, ifcopenshell::logger& logger) const
|
||||
{
|
||||
auto t = ifcopenshell::geom::Representation::triangulation::empty(settings);
|
||||
auto t = ifcopenshell::geom::triangulation::empty(settings);
|
||||
static ifcopenshell::geom::taxonomy::matrix4 iden;
|
||||
Triangulate(settings, iden, t, -1, -1, logger);
|
||||
return t;
|
||||
|
||||
@@ -82,9 +82,7 @@ namespace std {
|
||||
|
||||
namespace ifcopenshell::geom {
|
||||
|
||||
namespace Representation {
|
||||
class IFC_GEOM_API triangulation;
|
||||
}
|
||||
class IFC_GEOM_API triangulation;
|
||||
|
||||
#ifndef SWIG
|
||||
template <typename T>
|
||||
@@ -509,8 +507,8 @@ namespace ifcopenshell::geom {
|
||||
#else
|
||||
virtual std::string_view backend_id() const = 0;
|
||||
#endif
|
||||
virtual void Triangulate(ifcopenshell::geom::settings settings, const ifcopenshell::geom::taxonomy::matrix4& place, Representation::triangulation* t, int item_id, int surface_style_id, ifcopenshell::logger& logger = ifcopenshell::logger::root()) const = 0;
|
||||
ifcopenshell::geom::Representation::triangulation* Triangulate(const ifcopenshell::geom::settings& settings, ifcopenshell::logger& logger = ifcopenshell::logger::root()) const;
|
||||
virtual void Triangulate(ifcopenshell::geom::settings settings, const ifcopenshell::geom::taxonomy::matrix4& place, triangulation* t, int item_id, int surface_style_id, ifcopenshell::logger& logger = ifcopenshell::logger::root()) const = 0;
|
||||
ifcopenshell::geom::triangulation* Triangulate(const ifcopenshell::geom::settings& settings, ifcopenshell::logger& logger = ifcopenshell::logger::root()) const;
|
||||
virtual void Serialize(const ifcopenshell::geom::taxonomy::matrix4& place, std::string&) const = 0;
|
||||
|
||||
virtual int surface_genus() const = 0;
|
||||
|
||||
@@ -44,7 +44,7 @@ ifcopenshell::geom::brep_element* ifcopenshell::geom::converter::create_brep_for
|
||||
|
||||
representation_id_builder << representation_node->instance.id();
|
||||
|
||||
ifcopenshell::geom::Representation::brep* shape;
|
||||
ifcopenshell::geom::brep* shape;
|
||||
std::vector<ifcopenshell::geom::conversion_result> shapes;
|
||||
|
||||
if (!kernel_->convert(representation_node, shapes)) {
|
||||
@@ -254,7 +254,7 @@ ifcopenshell::geom::brep_element* ifcopenshell::geom::converter::create_brep_for
|
||||
}
|
||||
}
|
||||
|
||||
shape = new ifcopenshell::geom::Representation::brep(settings_, product_type, representation_id_builder.str(), shapes);
|
||||
shape = new ifcopenshell::geom::brep(settings_, product_type, representation_id_builder.str(), shapes);
|
||||
|
||||
std::string context_string = "";
|
||||
|
||||
@@ -280,7 +280,7 @@ ifcopenshell::geom::brep_element* ifcopenshell::geom::converter::create_brep_for
|
||||
guid,
|
||||
context_string,
|
||||
place,
|
||||
std::shared_ptr<ifcopenshell::geom::Representation::brep>(shape),
|
||||
std::shared_ptr<ifcopenshell::geom::brep>(shape),
|
||||
product
|
||||
);
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace ifcopenshell { namespace geom {
|
||||
|
||||
class IFC_GEOM_API converter {
|
||||
public:
|
||||
typedef std::shared_ptr<ifcopenshell::geom::Representation::brep> brep_ptr;
|
||||
typedef std::shared_ptr<ifcopenshell::geom::brep> brep_ptr;
|
||||
private:
|
||||
ifcopenshell::geom::abstract_mapping* mapping_;
|
||||
std::unique_ptr<ifcopenshell::geom::kernels::abstract_kernel> kernel_;
|
||||
|
||||
+12
-12
@@ -160,12 +160,12 @@ namespace ifcopenshell::geom {
|
||||
|
||||
class brep_element : public element {
|
||||
private:
|
||||
std::shared_ptr<ifcopenshell::geom::Representation::brep> _geometry;
|
||||
std::shared_ptr<ifcopenshell::geom::brep> _geometry;
|
||||
public:
|
||||
const std::shared_ptr<ifcopenshell::geom::Representation::brep>& geometry_pointer() const { return _geometry; }
|
||||
const ifcopenshell::geom::Representation::brep& geometry() const { return *_geometry; }
|
||||
const std::shared_ptr<ifcopenshell::geom::brep>& geometry_pointer() const { return _geometry; }
|
||||
const ifcopenshell::geom::brep& geometry() const { return *_geometry; }
|
||||
brep_element(int id, int parent_id, const std::string& name, const std::string& type, const std::string& guid,
|
||||
const std::string& context, const ifcopenshell::geom::taxonomy::matrix4::ptr& trsf, const std::shared_ptr<ifcopenshell::geom::Representation::brep>& geometry,
|
||||
const std::string& context, const ifcopenshell::geom::taxonomy::matrix4::ptr& trsf, const std::shared_ptr<ifcopenshell::geom::brep>& geometry,
|
||||
const express::entity& product)
|
||||
: element(geometry->settings(), id, parent_id, name, type, guid, context, trsf, product)
|
||||
, _geometry(geometry)
|
||||
@@ -182,15 +182,15 @@ namespace ifcopenshell::geom {
|
||||
|
||||
class triangulation_element : public element {
|
||||
private:
|
||||
std::shared_ptr< ifcopenshell::geom::Representation::triangulation > _geometry;
|
||||
std::shared_ptr< ifcopenshell::geom::triangulation > _geometry;
|
||||
public:
|
||||
const ifcopenshell::geom::Representation::triangulation& geometry() const { return *_geometry; }
|
||||
const std::shared_ptr< ifcopenshell::geom::Representation::triangulation>& geometry_pointer() const { return _geometry; }
|
||||
const ifcopenshell::geom::triangulation& geometry() const { return *_geometry; }
|
||||
const std::shared_ptr< ifcopenshell::geom::triangulation>& geometry_pointer() const { return _geometry; }
|
||||
triangulation_element(const ifcopenshell::geom::brep_element& shape_model)
|
||||
: element(shape_model)
|
||||
, _geometry(std::make_shared<ifcopenshell::geom::Representation::triangulation>(shape_model.geometry()))
|
||||
, _geometry(std::make_shared<ifcopenshell::geom::triangulation>(shape_model.geometry()))
|
||||
{}
|
||||
triangulation_element(const ifcopenshell::geom::element& source, const std::shared_ptr<ifcopenshell::geom::Representation::triangulation>& geometry)
|
||||
triangulation_element(const ifcopenshell::geom::element& source, const std::shared_ptr<ifcopenshell::geom::triangulation>& geometry)
|
||||
: element(source)
|
||||
, _geometry(geometry)
|
||||
{}
|
||||
@@ -202,12 +202,12 @@ namespace ifcopenshell::geom {
|
||||
|
||||
class serialized_element : public element {
|
||||
private:
|
||||
std::shared_ptr<ifcopenshell::geom::Representation::serialization> _geometry;
|
||||
std::shared_ptr<ifcopenshell::geom::serialization> _geometry;
|
||||
public:
|
||||
const ifcopenshell::geom::Representation::serialization& geometry() const { return *_geometry; }
|
||||
const ifcopenshell::geom::serialization& geometry() const { return *_geometry; }
|
||||
serialized_element(const brep_element& shape_model)
|
||||
: element(shape_model)
|
||||
, _geometry(std::make_shared<ifcopenshell::geom::Representation::serialization>(shape_model.geometry()))
|
||||
, _geometry(std::make_shared<ifcopenshell::geom::serialization>(shape_model.geometry()))
|
||||
{}
|
||||
serialized_element(const serialized_element& other) = default;
|
||||
private:
|
||||
|
||||
@@ -303,7 +303,7 @@ void ifcopenshell::geom::iterator::compute_bounds(bool with_geometry)
|
||||
do {
|
||||
auto geom_object = get();
|
||||
const ifcopenshell::geom::triangulation_element* o = static_cast<const ifcopenshell::geom::triangulation_element*>(geom_object.get());
|
||||
const ifcopenshell::geom::Representation::triangulation& mesh = o->geometry();
|
||||
const ifcopenshell::geom::triangulation& mesh = o->geometry();
|
||||
auto mat = o->transformation().data()->ccomponents();
|
||||
Eigen::Vector4d vec, transformed;
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
* Geometrical data in an IFC file consists of shapes (IfcShapeRepresentation) *
|
||||
* and instances (SUBTYPE OF IfcBuildingElement e.g. IfcWindow). *
|
||||
* *
|
||||
* ifcopenshell::geom::Representation::triangulation is a class that represents a *
|
||||
* ifcopenshell::geom::triangulation is a class that represents a *
|
||||
* triangulated IfcShapeRepresentation. *
|
||||
* Triangulation.verts is a 1 dimensional vector of float defining the *
|
||||
* cartesian coordinates of the vertices of the triangulated shape in the *
|
||||
|
||||
@@ -364,7 +364,7 @@ void ifcopenshell::geom::cgal_shape::to_nef() const {
|
||||
}
|
||||
#endif
|
||||
|
||||
void ifcopenshell::geom::cgal_shape::Triangulate(ifcopenshell::geom::settings settings, const ifcopenshell::geom::taxonomy::matrix4& place, ifcopenshell::geom::Representation::triangulation* t, int item_id, int surface_style_id, ifcopenshell::logger& logger) const {
|
||||
void ifcopenshell::geom::cgal_shape::Triangulate(ifcopenshell::geom::settings settings, const ifcopenshell::geom::taxonomy::matrix4& place, ifcopenshell::geom::triangulation* t, int item_id, int surface_style_id, ifcopenshell::logger& logger) const {
|
||||
if (is_point() || is_wire()) {
|
||||
return;
|
||||
}
|
||||
@@ -1035,7 +1035,7 @@ bool ifcopenshell::geom::cgal_shape::surface_area_along_direction(double tol, co
|
||||
|
||||
#ifndef IFOPSH_SIMPLE_KERNEL
|
||||
|
||||
void ifcopenshell::geom::cgal_shape_half_space_decomposition::Triangulate(ifcopenshell::geom::settings settings, const ifcopenshell::geom::taxonomy::matrix4& place, ifcopenshell::geom::Representation::triangulation* t, int item_id, int surface_style_id, ifcopenshell::logger& logger) const {
|
||||
void ifcopenshell::geom::cgal_shape_half_space_decomposition::Triangulate(ifcopenshell::geom::settings settings, const ifcopenshell::geom::taxonomy::matrix4& place, ifcopenshell::geom::triangulation* t, int item_id, int surface_style_id, ifcopenshell::logger& logger) const {
|
||||
throw std::runtime_error("Not implemented");
|
||||
}
|
||||
|
||||
|
||||
@@ -226,7 +226,7 @@ namespace ifcopenshell { namespace geom {
|
||||
const cgal_point& point() const { return std::get<cgal_point>(*shape_); }
|
||||
const cgal_wire& wire() const { return std::get<cgal_wire>(*shape_); }
|
||||
|
||||
virtual void Triangulate(ifcopenshell::geom::settings settings, const ifcopenshell::geom::taxonomy::matrix4& place, ifcopenshell::geom::Representation::triangulation* t, int item_id, int surface_style_id, ifcopenshell::logger& logger = ifcopenshell::logger::root()) const;
|
||||
virtual void Triangulate(ifcopenshell::geom::settings settings, const ifcopenshell::geom::taxonomy::matrix4& place, ifcopenshell::geom::triangulation* t, int item_id, int surface_style_id, ifcopenshell::logger& logger = ifcopenshell::logger::root()) const;
|
||||
virtual void Serialize(const ifcopenshell::geom::taxonomy::matrix4& place, std::string&) const;
|
||||
|
||||
virtual ifcopenshell::geom::conversion_result_shape* clone() const {
|
||||
@@ -319,7 +319,7 @@ namespace ifcopenshell { namespace geom {
|
||||
#endif
|
||||
}
|
||||
|
||||
virtual void Triangulate(ifcopenshell::geom::settings settings, const ifcopenshell::geom::taxonomy::matrix4& place, ifcopenshell::geom::Representation::triangulation* t, int item_id, int surface_style_id, ifcopenshell::logger& logger = ifcopenshell::logger::root()) const;
|
||||
virtual void Triangulate(ifcopenshell::geom::settings settings, const ifcopenshell::geom::taxonomy::matrix4& place, ifcopenshell::geom::triangulation* t, int item_id, int surface_style_id, ifcopenshell::logger& logger = ifcopenshell::logger::root()) const;
|
||||
virtual void Serialize(const ifcopenshell::geom::taxonomy::matrix4& place, std::string&) const;
|
||||
|
||||
virtual int surface_genus() const;
|
||||
|
||||
@@ -215,7 +215,7 @@ std::optional<manifold::Manifold> ifcopenshell::geom::manifold_shape::as_manifol
|
||||
return manifold::Manifold::BatchBoolean(solids, manifold::OpType::Add);
|
||||
}
|
||||
|
||||
void ifcopenshell::geom::manifold_shape::Triangulate(ifcopenshell::geom::settings, const ifcopenshell::geom::taxonomy::matrix4& place, ifcopenshell::geom::Representation::triangulation* t, int item_id, int surface_style_id, ifcopenshell::logger&) const {
|
||||
void ifcopenshell::geom::manifold_shape::Triangulate(ifcopenshell::geom::settings, const ifcopenshell::geom::taxonomy::matrix4& place, ifcopenshell::geom::triangulation* t, int item_id, int surface_style_id, ifcopenshell::logger&) const {
|
||||
for (const auto& part : parts_) {
|
||||
auto mesh = transform_mesh(part.mesh, place);
|
||||
std::vector<int> indices(mesh.NumVert());
|
||||
|
||||
@@ -40,7 +40,7 @@ public:
|
||||
std::optional<manifold::Manifold> as_manifold() const;
|
||||
virtual std::string_view backend_id() const { return "manifold"; }
|
||||
|
||||
virtual void Triangulate(ifcopenshell::geom::settings settings, const ifcopenshell::geom::taxonomy::matrix4& place, ifcopenshell::geom::Representation::triangulation* t, int item_id, int surface_style_id, ifcopenshell::logger& logger = ifcopenshell::logger::root()) const;
|
||||
virtual void Triangulate(ifcopenshell::geom::settings settings, const ifcopenshell::geom::taxonomy::matrix4& place, ifcopenshell::geom::triangulation* t, int item_id, int surface_style_id, ifcopenshell::logger& logger = ifcopenshell::logger::root()) const;
|
||||
virtual void Serialize(const ifcopenshell::geom::taxonomy::matrix4& place, std::string&) const;
|
||||
|
||||
virtual int surface_genus() const;
|
||||
|
||||
@@ -68,7 +68,7 @@ ifcopenshell::geom::conversion_result_shape* ifcopenshell::geom::open_cascade_sh
|
||||
return new open_cascade_shape(shape_);
|
||||
}
|
||||
|
||||
void ifcopenshell::geom::open_cascade_shape::Triangulate(ifcopenshell::geom::settings settings, const ifcopenshell::geom::taxonomy::matrix4& place, ifcopenshell::geom::Representation::triangulation* t, int item_id, int surface_style_id, ifcopenshell::logger& logger) const {
|
||||
void ifcopenshell::geom::open_cascade_shape::Triangulate(ifcopenshell::geom::settings settings, const ifcopenshell::geom::taxonomy::matrix4& place, ifcopenshell::geom::triangulation* t, int item_id, int surface_style_id, ifcopenshell::logger& logger) const {
|
||||
|
||||
// @todo remove duplication with open_cascade_kernel::convert(const taxonomy::matrix4::ptr matrix, gp_GTrsf& trsf);
|
||||
// above can be static?
|
||||
@@ -257,7 +257,7 @@ void ifcopenshell::geom::open_cascade_shape::Triangulate(ifcopenshell::geom::set
|
||||
}
|
||||
|
||||
if (!t->normals().empty() && settings.get<settings::GenerateUvs>().get()) {
|
||||
t->uvs_ref() = ifcopenshell::geom::Representation::triangulation::box_project_uvs(t->verts(), t->normals());
|
||||
t->uvs_ref() = ifcopenshell::geom::triangulation::box_project_uvs(t->verts(), t->normals());
|
||||
}
|
||||
|
||||
if (num_faces == 0) {
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace ifcopenshell {
|
||||
operator const TopoDS_Shape& ();
|
||||
virtual std::string_view backend_id() const;
|
||||
|
||||
virtual void Triangulate(ifcopenshell::geom::settings settings, const ifcopenshell::geom::taxonomy::matrix4& place, ifcopenshell::geom::Representation::triangulation* t, int item_id, int surface_style_id, ifcopenshell::logger& logger = ifcopenshell::logger::root()) const;
|
||||
virtual void Triangulate(ifcopenshell::geom::settings settings, const ifcopenshell::geom::taxonomy::matrix4& place, ifcopenshell::geom::triangulation* t, int item_id, int surface_style_id, ifcopenshell::logger& logger = ifcopenshell::logger::root()) const;
|
||||
virtual void Serialize(const ifcopenshell::geom::taxonomy::matrix4& place, std::string&) const;
|
||||
|
||||
virtual ifcopenshell::geom::conversion_result_shape* clone() const;
|
||||
|
||||
@@ -374,7 +374,7 @@ bool ifcopenshell::geom::open_cascade_kernel::convert_impl(const taxonomy::revol
|
||||
//
|
||||
// representation_id_builder << representation->data().id();
|
||||
//
|
||||
// ifcopenshell::geom::Representation::brep* shape;
|
||||
// ifcopenshell::geom::brep* shape;
|
||||
// std::vector<ifcopenshell::geom::conversion_result> shapes, shapes2;
|
||||
//
|
||||
// if (!convert_shapes(representation, shapes)) {
|
||||
@@ -524,16 +524,16 @@ bool ifcopenshell::geom::open_cascade_kernel::convert_impl(const taxonomy::revol
|
||||
// trsf = gp_Trsf();
|
||||
// representation_id_builder << "-world-coords";
|
||||
// }
|
||||
// shape = new ifcopenshell::geom::Representation::brep(element_settings, representation_id_builder.str(), opened_shapes);
|
||||
// shape = new ifcopenshell::geom::brep(element_settings, representation_id_builder.str(), opened_shapes);
|
||||
// } else if (settings.get(IteratorSettings::USE_WORLD_COORDS)) {
|
||||
// for (std::vector<ifcopenshell::geom::conversion_result>::iterator it = shapes.begin(); it != shapes.end(); ++it) {
|
||||
// it->prepend(trsf);
|
||||
// }
|
||||
// trsf = gp_Trsf();
|
||||
// representation_id_builder << "-world-coords";
|
||||
// shape = new ifcopenshell::geom::Representation::brep(element_settings, representation_id_builder.str(), shapes);
|
||||
// shape = new ifcopenshell::geom::brep(element_settings, representation_id_builder.str(), shapes);
|
||||
// } else {
|
||||
// shape = new ifcopenshell::geom::Representation::brep(element_settings, representation_id_builder.str(), shapes);
|
||||
// shape = new ifcopenshell::geom::brep(element_settings, representation_id_builder.str(), shapes);
|
||||
// }
|
||||
//
|
||||
// std::string context_string = "";
|
||||
@@ -551,7 +551,7 @@ bool ifcopenshell::geom::open_cascade_kernel::convert_impl(const taxonomy::revol
|
||||
// guid,
|
||||
// context_string,
|
||||
// trsf,
|
||||
// std::shared_ptr<ifcopenshell::geom::Representation::brep>(shape),
|
||||
// std::shared_ptr<ifcopenshell::geom::brep>(shape),
|
||||
// product
|
||||
// );
|
||||
//
|
||||
|
||||
@@ -286,7 +286,7 @@ ifcopenshell::geom::passthrough_shape::passthrough_shape(const std::vector<passt
|
||||
ifcopenshell::geom::passthrough_shape::passthrough_shape(std::vector<passthrough_part>&& parts)
|
||||
: parts_(normalize_parts(parts)) {}
|
||||
|
||||
void ifcopenshell::geom::passthrough_shape::Triangulate(ifcopenshell::geom::settings, const ifcopenshell::geom::taxonomy::matrix4& place, ifcopenshell::geom::Representation::triangulation* t, int item_id, int surface_style_id, ifcopenshell::logger&) const {
|
||||
void ifcopenshell::geom::passthrough_shape::Triangulate(ifcopenshell::geom::settings, const ifcopenshell::geom::taxonomy::matrix4& place, ifcopenshell::geom::triangulation* t, int item_id, int surface_style_id, ifcopenshell::logger&) const {
|
||||
auto mesh = build_mesh(parts_, &place);
|
||||
std::vector<int> indices(mesh.vertices.size());
|
||||
for (size_t i = 0; i < mesh.vertices.size(); ++i) {
|
||||
|
||||
@@ -24,7 +24,7 @@ public:
|
||||
const std::vector<passthrough_part>& parts() const { return parts_; }
|
||||
virtual std::string_view backend_id() const { return "passthrough"; }
|
||||
|
||||
virtual void Triangulate(ifcopenshell::geom::settings settings, const ifcopenshell::geom::taxonomy::matrix4& place, ifcopenshell::geom::Representation::triangulation* t, int item_id, int surface_style_id, ifcopenshell::logger& logger = ifcopenshell::logger::root()) const;
|
||||
virtual void Triangulate(ifcopenshell::geom::settings settings, const ifcopenshell::geom::taxonomy::matrix4& place, ifcopenshell::geom::triangulation* t, int item_id, int surface_style_id, ifcopenshell::logger& logger = ifcopenshell::logger::root()) const;
|
||||
virtual void Serialize(const ifcopenshell::geom::taxonomy::matrix4& place, std::string&) const;
|
||||
|
||||
virtual int surface_genus() const;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#include "representation.h"
|
||||
|
||||
ifcopenshell::geom::Representation::serialization::serialization(const brep& brep)
|
||||
ifcopenshell::geom::serialization::serialization(const brep& brep)
|
||||
: representation(brep.settings(), brep.entity(), brep.id())
|
||||
{
|
||||
for (auto it = brep.begin(); it != brep.end(); ++it) {
|
||||
@@ -53,7 +53,7 @@ ifcopenshell::geom::Representation::serialization::serialization(const brep& bre
|
||||
delete comp;
|
||||
}
|
||||
|
||||
ifcopenshell::geom::conversion_result_shape* ifcopenshell::geom::Representation::brep::as_compound(bool force_meters) const {
|
||||
ifcopenshell::geom::conversion_result_shape* ifcopenshell::geom::brep::as_compound(bool force_meters) const {
|
||||
conversion_result_shape* accum = nullptr;
|
||||
|
||||
for (auto it = begin(); it != end(); ++it) {
|
||||
@@ -75,7 +75,7 @@ ifcopenshell::geom::conversion_result_shape* ifcopenshell::geom::Representation:
|
||||
return accum;
|
||||
}
|
||||
|
||||
bool ifcopenshell::geom::Representation::brep::calculate_surface_area(double& area) const {
|
||||
bool ifcopenshell::geom::brep::calculate_surface_area(double& area) const {
|
||||
std::unique_ptr<conversion_result_shape> s(as_compound());
|
||||
if (!s) {
|
||||
area = 0.;
|
||||
@@ -85,7 +85,7 @@ bool ifcopenshell::geom::Representation::brep::calculate_surface_area(double& ar
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ifcopenshell::geom::Representation::brep::calculate_volume(double& volume) const {
|
||||
bool ifcopenshell::geom::brep::calculate_volume(double& volume) const {
|
||||
std::unique_ptr<conversion_result_shape> s(as_compound());
|
||||
if (!s) {
|
||||
volume = 0.;
|
||||
@@ -95,7 +95,7 @@ bool ifcopenshell::geom::Representation::brep::calculate_volume(double& volume)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ifcopenshell::geom::Representation::brep::calculate_projected_surface_area(const ifcopenshell::geom::taxonomy::matrix4::ptr& place, double& along_x, double& along_y, double& along_z) const {
|
||||
bool ifcopenshell::geom::brep::calculate_projected_surface_area(const ifcopenshell::geom::taxonomy::matrix4::ptr& place, double& along_x, double& along_y, double& along_z) const {
|
||||
along_x = along_y = along_z = 0.;
|
||||
|
||||
for (std::vector<ifcopenshell::geom::conversion_result>::const_iterator it = begin(); it != end(); ++it) {
|
||||
@@ -116,7 +116,7 @@ bool ifcopenshell::geom::Representation::brep::calculate_projected_surface_area(
|
||||
return true;
|
||||
}
|
||||
|
||||
ifcopenshell::geom::Representation::triangulation::triangulation(const brep& shape_model)
|
||||
ifcopenshell::geom::triangulation::triangulation(const brep& shape_model)
|
||||
: representation(shape_model.settings(), shape_model.entity(), shape_model.id())
|
||||
, weld_offset_(0)
|
||||
{
|
||||
@@ -154,7 +154,7 @@ ifcopenshell::geom::Representation::triangulation::triangulation(const brep& sha
|
||||
/// Generates UVs for a single mesh using box projection.
|
||||
/// @todo Very simple impl. Assumes that input vertices and normals match 1:1.
|
||||
|
||||
std::vector<double> ifcopenshell::geom::Representation::triangulation::box_project_uvs(const std::vector<double>& vertices, const std::vector<double>& normals)
|
||||
std::vector<double> ifcopenshell::geom::triangulation::box_project_uvs(const std::vector<double>& vertices, const std::vector<double>& normals)
|
||||
{
|
||||
std::vector<double> uvs;
|
||||
uvs.resize(vertices.size() / 3 * 2);
|
||||
@@ -182,7 +182,7 @@ std::vector<double> ifcopenshell::geom::Representation::triangulation::box_proje
|
||||
return uvs;
|
||||
}
|
||||
|
||||
int ifcopenshell::geom::Representation::triangulation::addVertex(int item_id, int material_index, double pX, double pY, double pZ) {
|
||||
int ifcopenshell::geom::triangulation::addVertex(int item_id, int material_index, double pX, double pY, double pZ) {
|
||||
const bool convert = settings().get<ifcopenshell::geom::settings::ConvertBackUnits>().get();
|
||||
auto unit_magnitude = settings().get<ifcopenshell::geom::settings::LengthUnit>().get();
|
||||
const double X = convert ? (pX /unit_magnitude) : pX;
|
||||
@@ -205,12 +205,12 @@ int ifcopenshell::geom::Representation::triangulation::addVertex(int item_id, in
|
||||
return i;
|
||||
}
|
||||
|
||||
void ifcopenshell::geom::Representation::triangulation::registerEdgeCount(int n1, int n2, std::map<std::pair<int, int>, int>& edgecount) {
|
||||
void ifcopenshell::geom::triangulation::registerEdgeCount(int n1, int n2, std::map<std::pair<int, int>, int>& edgecount) {
|
||||
const edge e = edge((std::min)(n1, n2), (std::max)(n1, n2));
|
||||
edgecount[e] ++;
|
||||
}
|
||||
|
||||
const ifcopenshell::geom::conversion_result_shape* ifcopenshell::geom::Representation::brep::item(int i) const {
|
||||
const ifcopenshell::geom::conversion_result_shape* ifcopenshell::geom::brep::item(int i) const {
|
||||
if (i >= 0 && i < shapes_.size()) {
|
||||
return shapes_[i].Shape()->moved(shapes_[i].Placement());
|
||||
} else {
|
||||
@@ -218,7 +218,7 @@ const ifcopenshell::geom::conversion_result_shape* ifcopenshell::geom::Represent
|
||||
}
|
||||
}
|
||||
|
||||
int ifcopenshell::geom::Representation::brep::item_id(int i) const {
|
||||
int ifcopenshell::geom::brep::item_id(int i) const {
|
||||
if (i >= 0 && i < shapes_.size()) {
|
||||
return shapes_[i].ItemId();
|
||||
} else {
|
||||
|
||||
@@ -27,8 +27,6 @@
|
||||
|
||||
namespace ifcopenshell::geom {
|
||||
|
||||
namespace Representation {
|
||||
|
||||
class IFC_GEOM_API representation {
|
||||
representation(const representation&); //N/A
|
||||
representation& operator =(const representation&); //N/A
|
||||
@@ -235,7 +233,6 @@ namespace ifcopenshell::geom {
|
||||
triangulation& operator=(const triangulation&);
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user