Linker errors, geom server, warnings

This commit is contained in:
Thomas Krijnen
2017-12-29 13:48:08 +01:00
parent 19aebacbd8
commit 05e6f56911
4 changed files with 47 additions and 46 deletions
+1 -1
View File
@@ -551,7 +551,7 @@ if(NOT MSVC)
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
file(GLOB IFCPARSE_H_FILES ../src/ifcparse/*.h)
+44 -43
View File
@@ -38,7 +38,10 @@
#include <fcntl.h>
#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
#include <vld.h>
@@ -378,53 +381,47 @@ public:
double total_shape_volume = 0.;
double walkable_surface_area = 0.;
for (IfcGeom::IfcRepresentationShapeItems::const_iterator it = elem_->geometry().begin(); it != elem_->geometry().end(); ++it) {
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);
TopoDS_Shape moved_shape = elem_->geometry().as_compound();
{
GProp_GProps prop_area;
BRepGProp::SurfaceProperties(moved_shape, prop_area);
total_surface_area += prop_area.Mass();
}
{
GProp_GProps prop_area;
BRepGProp::SurfaceProperties(moved_shape, prop_area);
total_surface_area += prop_area.Mass();
}
{
GProp_GProps prop_volume;
BRepGProp::VolumeProperties(moved_shape, prop_volume);
total_shape_volume += prop_volume.Mass();
}
{
GProp_GProps prop_volume;
BRepGProp::VolumeProperties(moved_shape, prop_volume);
total_shape_volume += prop_volume.Mass();
}
if (elem_->type() == "IfcSpace") {
TopExp_Explorer exp(moved_shape, TopAbs_FACE);
for (; exp.More(); exp.Next()) {
const TopoDS_Face& face = TopoDS::Face(exp.Current());
Handle(Geom_Surface) surf = BRep_Tool::Surface(face);
if (elem_->type() == "IfcSpace") {
TopExp_Explorer exp(moved_shape, TopAbs_FACE);
for (; exp.More(); exp.Next()) {
const TopoDS_Face& face = TopoDS::Face(exp.Current());
Handle(Geom_Surface) surf = BRep_Tool::Surface(face);
// Assume we can only walk on planar surfaces
if (surf->DynamicType() != STANDARD_TYPE(Geom_Plane)) {
continue;
}
// Assume we can only walk on planar surfaces
if (surf->DynamicType() != STANDARD_TYPE(Geom_Plane)) {
continue;
}
BRepGProp_Face prop(face);
double u0, u1, v0, v1;
BRepTools::UVBounds(face, u0, u1, v0, v1);
gp_Pnt p;
gp_Vec normal_direction;
prop.Normal((u0 + u1) / 2., (v0 + v1) / 2., p, normal_direction);
BRepGProp_Face prop(face);
double u0, u1, v0, v1;
BRepTools::UVBounds(face, u0, u1, v0, v1);
gp_Pnt p;
gp_Vec normal_direction;
prop.Normal((u0 + u1) / 2., (v0 + v1) / 2., p, normal_direction);
gp_Vec normal(0., 0., 0.);
if (normal_direction.Magnitude() > ALMOST_ZERO) {
normal = gp_Dir(normal_direction.XYZ());
}
gp_Vec normal(0., 0., 0.);
if (normal_direction.Magnitude() > 1.e-5) {
normal = gp_Dir(normal_direction.XYZ());
}
if (normal.Angle(gp::DZ()) < (MAX_WALKABLE_SURFACE_ANGLE_DEGREES * M_PI / 180.0)) {
GProp_GProps prop_face;
BRepGProp::SurfaceProperties(face, prop_face);
walkable_surface_area += prop_face.Mass();
}
if (normal.Angle(gp::DZ()) < (MAX_WALKABLE_SURFACE_ANGLE_DEGREES * M_PI / 180.0)) {
GProp_GProps prop_face;
BRepGProp::SurfaceProperties(face, prop_face);
walkable_surface_area += prop_face.Mass();
}
}
}
@@ -475,6 +472,7 @@ int main () {
bool has_more = false;
IfcGeom::Iterator<float>* iterator = 0;
IfcParse::IfcFile* file = 0;
std::vector< std::pair<uint32_t, uint32_t> > setting_pairs;
Hello().write(std::cout);
@@ -502,7 +500,8 @@ int main () {
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();
More(has_more).write(std::cout);
@@ -523,7 +522,9 @@ int main () {
Next n; n.read(std::cin);
has_more = iterator->next() != 0;
if (!has_more) {
delete file;
delete iterator;
file = 0;
iterator = 0;
}
More(has_more).write(std::cout);
@@ -531,7 +532,7 @@ int main () {
}
case GET_LOG: {
GetLog gl; gl.read(std::cin);
WriteLog(iterator->getLog()).write(std::cout);
WriteLog(Logger::GetLog()).write(std::cout);
continue;
}
case BYE: {
+1 -1
View File
@@ -99,7 +99,7 @@ public:
IfcFile(IfcParse::IfcSpfStream* f);
IfcFile(const IfcParse::schema_definition* schema = IfcParse::schema_by_name("IFC4"));
~IfcFile();
virtual ~IfcFile();
bool good() const { return good_; }
+1 -1
View File
@@ -41,7 +41,7 @@
%include "../ifcgeom/ifc_geom_api.h"
%include "../ifcgeom/IfcGeomIteratorSettings.h"
%include "../ifcgeom/IfcGeomElement.h"
%include "../ifcgeom/IfcGeomMaterial.h"
%include "../ifcgeom_schema_agnostic/IfcGeomMaterial.h"
%include "../ifcgeom/IfcGeomRepresentation.h"
%include "../ifcgeom_schema_agnostic/IfcGeomIterator.h"