mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-25 17:57:02 +00:00
Linker errors, geom server, warnings
This commit is contained in:
@@ -551,7 +551,7 @@ if(NOT MSVC)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(IFCOPENSHELL_LIBRARIES IfcParse IfcGeom_ifc2x3 IfcGeom_ifc4 IfcGeom)
|
set(IFCOPENSHELL_LIBRARIES IfcParse IfcGeom_ifc2x3 IfcGeom_ifc4 IfcGeom IfcGeom_ifc2x3 IfcGeom_ifc4 IfcGeom)
|
||||||
|
|
||||||
# IfcParse
|
# IfcParse
|
||||||
file(GLOB IFCPARSE_H_FILES ../src/ifcparse/*.h)
|
file(GLOB IFCPARSE_H_FILES ../src/ifcparse/*.h)
|
||||||
|
|||||||
@@ -38,7 +38,10 @@
|
|||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "../ifcgeom/IfcGeomIterator.h"
|
#include "../ifcgeom_schema_agnostic/IfcGeomIterator.h"
|
||||||
|
#include "../ifcgeom/IfcGeomElement.h"
|
||||||
|
#include "../ifcparse/IfcFile.h"
|
||||||
|
#include "../ifcparse/IfcLogger.h"
|
||||||
|
|
||||||
#if USE_VLD
|
#if USE_VLD
|
||||||
#include <vld.h>
|
#include <vld.h>
|
||||||
@@ -378,53 +381,47 @@ public:
|
|||||||
double total_shape_volume = 0.;
|
double total_shape_volume = 0.;
|
||||||
double walkable_surface_area = 0.;
|
double walkable_surface_area = 0.;
|
||||||
|
|
||||||
for (IfcGeom::IfcRepresentationShapeItems::const_iterator it = elem_->geometry().begin(); it != elem_->geometry().end(); ++it) {
|
TopoDS_Shape moved_shape = elem_->geometry().as_compound();
|
||||||
gp_GTrsf gtrsf = it->Placement();
|
|
||||||
const gp_Trsf& o_trsf = elem_->transformation().data();
|
|
||||||
gtrsf.PreMultiply(o_trsf);
|
|
||||||
const TopoDS_Shape& shp = it->Shape();
|
|
||||||
const TopoDS_Shape moved_shape = IfcGeom::Kernel::apply_transformation(shp, gtrsf);
|
|
||||||
|
|
||||||
{
|
{
|
||||||
GProp_GProps prop_area;
|
GProp_GProps prop_area;
|
||||||
BRepGProp::SurfaceProperties(moved_shape, prop_area);
|
BRepGProp::SurfaceProperties(moved_shape, prop_area);
|
||||||
total_surface_area += prop_area.Mass();
|
total_surface_area += prop_area.Mass();
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
GProp_GProps prop_volume;
|
GProp_GProps prop_volume;
|
||||||
BRepGProp::VolumeProperties(moved_shape, prop_volume);
|
BRepGProp::VolumeProperties(moved_shape, prop_volume);
|
||||||
total_shape_volume += prop_volume.Mass();
|
total_shape_volume += prop_volume.Mass();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (elem_->type() == "IfcSpace") {
|
if (elem_->type() == "IfcSpace") {
|
||||||
TopExp_Explorer exp(moved_shape, TopAbs_FACE);
|
TopExp_Explorer exp(moved_shape, TopAbs_FACE);
|
||||||
for (; exp.More(); exp.Next()) {
|
for (; exp.More(); exp.Next()) {
|
||||||
const TopoDS_Face& face = TopoDS::Face(exp.Current());
|
const TopoDS_Face& face = TopoDS::Face(exp.Current());
|
||||||
Handle(Geom_Surface) surf = BRep_Tool::Surface(face);
|
Handle(Geom_Surface) surf = BRep_Tool::Surface(face);
|
||||||
|
|
||||||
// Assume we can only walk on planar surfaces
|
// Assume we can only walk on planar surfaces
|
||||||
if (surf->DynamicType() != STANDARD_TYPE(Geom_Plane)) {
|
if (surf->DynamicType() != STANDARD_TYPE(Geom_Plane)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
BRepGProp_Face prop(face);
|
BRepGProp_Face prop(face);
|
||||||
double u0, u1, v0, v1;
|
double u0, u1, v0, v1;
|
||||||
BRepTools::UVBounds(face, u0, u1, v0, v1);
|
BRepTools::UVBounds(face, u0, u1, v0, v1);
|
||||||
gp_Pnt p;
|
gp_Pnt p;
|
||||||
gp_Vec normal_direction;
|
gp_Vec normal_direction;
|
||||||
prop.Normal((u0 + u1) / 2., (v0 + v1) / 2., p, normal_direction);
|
prop.Normal((u0 + u1) / 2., (v0 + v1) / 2., p, normal_direction);
|
||||||
|
|
||||||
gp_Vec normal(0., 0., 0.);
|
gp_Vec normal(0., 0., 0.);
|
||||||
if (normal_direction.Magnitude() > ALMOST_ZERO) {
|
if (normal_direction.Magnitude() > 1.e-5) {
|
||||||
normal = gp_Dir(normal_direction.XYZ());
|
normal = gp_Dir(normal_direction.XYZ());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (normal.Angle(gp::DZ()) < (MAX_WALKABLE_SURFACE_ANGLE_DEGREES * M_PI / 180.0)) {
|
if (normal.Angle(gp::DZ()) < (MAX_WALKABLE_SURFACE_ANGLE_DEGREES * M_PI / 180.0)) {
|
||||||
GProp_GProps prop_face;
|
GProp_GProps prop_face;
|
||||||
BRepGProp::SurfaceProperties(face, prop_face);
|
BRepGProp::SurfaceProperties(face, prop_face);
|
||||||
walkable_surface_area += prop_face.Mass();
|
walkable_surface_area += prop_face.Mass();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -475,6 +472,7 @@ int main () {
|
|||||||
bool has_more = false;
|
bool has_more = false;
|
||||||
|
|
||||||
IfcGeom::Iterator<float>* iterator = 0;
|
IfcGeom::Iterator<float>* iterator = 0;
|
||||||
|
IfcParse::IfcFile* file = 0;
|
||||||
std::vector< std::pair<uint32_t, uint32_t> > setting_pairs;
|
std::vector< std::pair<uint32_t, uint32_t> > setting_pairs;
|
||||||
|
|
||||||
Hello().write(std::cout);
|
Hello().write(std::cout);
|
||||||
@@ -502,7 +500,8 @@ int main () {
|
|||||||
|
|
||||||
settings.set_deflection_tolerance(deflection);
|
settings.set_deflection_tolerance(deflection);
|
||||||
|
|
||||||
iterator = new IfcGeom::Iterator<float>(settings, data, (int)len);
|
file = new IfcParse::IfcFile(data, (int)len);
|
||||||
|
iterator = new IfcGeom::Iterator<float>(settings, file);
|
||||||
has_more = iterator->initialize();
|
has_more = iterator->initialize();
|
||||||
|
|
||||||
More(has_more).write(std::cout);
|
More(has_more).write(std::cout);
|
||||||
@@ -523,7 +522,9 @@ int main () {
|
|||||||
Next n; n.read(std::cin);
|
Next n; n.read(std::cin);
|
||||||
has_more = iterator->next() != 0;
|
has_more = iterator->next() != 0;
|
||||||
if (!has_more) {
|
if (!has_more) {
|
||||||
|
delete file;
|
||||||
delete iterator;
|
delete iterator;
|
||||||
|
file = 0;
|
||||||
iterator = 0;
|
iterator = 0;
|
||||||
}
|
}
|
||||||
More(has_more).write(std::cout);
|
More(has_more).write(std::cout);
|
||||||
@@ -531,7 +532,7 @@ int main () {
|
|||||||
}
|
}
|
||||||
case GET_LOG: {
|
case GET_LOG: {
|
||||||
GetLog gl; gl.read(std::cin);
|
GetLog gl; gl.read(std::cin);
|
||||||
WriteLog(iterator->getLog()).write(std::cout);
|
WriteLog(Logger::GetLog()).write(std::cout);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
case BYE: {
|
case BYE: {
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ public:
|
|||||||
IfcFile(IfcParse::IfcSpfStream* f);
|
IfcFile(IfcParse::IfcSpfStream* f);
|
||||||
IfcFile(const IfcParse::schema_definition* schema = IfcParse::schema_by_name("IFC4"));
|
IfcFile(const IfcParse::schema_definition* schema = IfcParse::schema_by_name("IFC4"));
|
||||||
|
|
||||||
~IfcFile();
|
virtual ~IfcFile();
|
||||||
|
|
||||||
bool good() const { return good_; }
|
bool good() const { return good_; }
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
%include "../ifcgeom/ifc_geom_api.h"
|
%include "../ifcgeom/ifc_geom_api.h"
|
||||||
%include "../ifcgeom/IfcGeomIteratorSettings.h"
|
%include "../ifcgeom/IfcGeomIteratorSettings.h"
|
||||||
%include "../ifcgeom/IfcGeomElement.h"
|
%include "../ifcgeom/IfcGeomElement.h"
|
||||||
%include "../ifcgeom/IfcGeomMaterial.h"
|
%include "../ifcgeom_schema_agnostic/IfcGeomMaterial.h"
|
||||||
%include "../ifcgeom/IfcGeomRepresentation.h"
|
%include "../ifcgeom/IfcGeomRepresentation.h"
|
||||||
%include "../ifcgeom_schema_agnostic/IfcGeomIterator.h"
|
%include "../ifcgeom_schema_agnostic/IfcGeomIterator.h"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user