Fix compiler warnings

This commit is contained in:
Thomas Krijnen
2016-05-02 15:56:08 +02:00
parent 39e26dff46
commit 37f0e09947
2 changed files with 24 additions and 25 deletions
+3 -3
View File
@@ -175,8 +175,8 @@ public:
bool convert_openings_fast(const IfcSchema::IfcProduct* entity, const IfcSchema::IfcRelVoidsElement::list::ptr& openings, const IfcRepresentationShapeItems& entity_shapes, const gp_Trsf& entity_trsf, IfcRepresentationShapeItems& cut_shapes); bool convert_openings_fast(const IfcSchema::IfcProduct* entity, const IfcSchema::IfcRelVoidsElement::list::ptr& openings, const IfcRepresentationShapeItems& entity_shapes, const gp_Trsf& entity_trsf, IfcRepresentationShapeItems& cut_shapes);
bool convert_layerset(const IfcSchema::IfcProduct*, std::vector<Handle_Geom_Surface>&, std::vector<const SurfaceStyle*>&, std::vector<double>&); bool convert_layerset(const IfcSchema::IfcProduct*, std::vector<Handle_Geom_Surface>&, std::vector<const SurfaceStyle*>&, std::vector<double>&);
bool apply_layerset(const IfcRepresentationShapeItems&, const std::vector<Handle_Geom_Surface>&, const std::vector<const SurfaceStyle*>&, const std::vector<double>& thickness, IfcRepresentationShapeItems&); bool apply_layerset(const IfcRepresentationShapeItems&, const std::vector<Handle_Geom_Surface>&, const std::vector<const SurfaceStyle*>&, IfcRepresentationShapeItems&);
bool apply_folded_layerset(const IfcRepresentationShapeItems&, const std::vector< std::vector<Handle_Geom_Surface> >&, const std::vector<const SurfaceStyle*>&, const std::vector<double>& thickness, IfcRepresentationShapeItems&); bool apply_folded_layerset(const IfcRepresentationShapeItems&, const std::vector< std::vector<Handle_Geom_Surface> >&, const std::vector<const SurfaceStyle*>&, IfcRepresentationShapeItems&);
bool fold_layers(const IfcSchema::IfcWall*, const IfcRepresentationShapeItems&, const std::vector<Handle_Geom_Surface>&, const std::vector<double>&, std::vector< std::vector<Handle_Geom_Surface> >&); bool fold_layers(const IfcSchema::IfcWall*, const IfcRepresentationShapeItems&, const std::vector<Handle_Geom_Surface>&, const std::vector<double>&, std::vector< std::vector<Handle_Geom_Surface> >&);
bool split_solid_by_surface(const TopoDS_Shape&, const Handle_Geom_Surface&, TopoDS_Shape&, TopoDS_Shape&); bool split_solid_by_surface(const TopoDS_Shape&, const Handle_Geom_Surface&, TopoDS_Shape&, TopoDS_Shape&);
@@ -185,7 +185,7 @@ public:
const Handle_Geom_Curve intersect(const Handle_Geom_Surface&, const Handle_Geom_Surface&); const Handle_Geom_Curve intersect(const Handle_Geom_Surface&, const Handle_Geom_Surface&);
const Handle_Geom_Curve intersect(const Handle_Geom_Surface&, const TopoDS_Face&); const Handle_Geom_Curve intersect(const Handle_Geom_Surface&, const TopoDS_Face&);
const Handle_Geom_Curve intersect(const TopoDS_Face&, const Handle_Geom_Surface&); const Handle_Geom_Curve intersect(const TopoDS_Face&, const Handle_Geom_Surface&);
bool intersect(const Handle_Geom_Curve&, const Handle_Geom_Surface&, gp_Pnt&, double& u, double& v, double& w); bool intersect(const Handle_Geom_Curve&, const Handle_Geom_Surface&, gp_Pnt&);
bool intersect(const Handle_Geom_Curve&, const TopoDS_Face&, gp_Pnt&); bool intersect(const Handle_Geom_Curve&, const TopoDS_Face&, gp_Pnt&);
bool intersect(const Handle_Geom_Curve&, const TopoDS_Shape&, std::vector<gp_Pnt>&); bool intersect(const Handle_Geom_Curve&, const TopoDS_Shape&, std::vector<gp_Pnt>&);
bool intersect(const Handle_Geom_Surface&, const TopoDS_Shape&, std::vector< std::pair<Handle_Geom_Surface, Handle_Geom_Curve> >&); bool intersect(const Handle_Geom_Surface&, const TopoDS_Shape&, std::vector< std::pair<Handle_Geom_Surface, Handle_Geom_Curve> >&);
+21 -22
View File
@@ -1117,11 +1117,11 @@ IfcGeom::BRepElement<P>* IfcGeom::Kernel::create_brep_for_representation_and_pro
std::vector<const SurfaceStyle*> styles; std::vector<const SurfaceStyle*> styles;
if (convert_layerset(product, layers, styles, thickness)) { if (convert_layerset(product, layers, styles, thickness)) {
if (product->as<IfcSchema::IfcWall>() && fold_layers(product->as<IfcSchema::IfcWall>(), shapes, layers, thickness, folded_layers)) { if (product->as<IfcSchema::IfcWall>() && fold_layers(product->as<IfcSchema::IfcWall>(), shapes, layers, thickness, folded_layers)) {
if (apply_folded_layerset(shapes, folded_layers, styles, thickness, shapes2)) { if (apply_folded_layerset(shapes, folded_layers, styles, shapes2)) {
std::swap(shapes, shapes2); std::swap(shapes, shapes2);
} }
} else { } else {
if (apply_layerset(shapes, layers, styles, thickness, shapes2)) { if (apply_layerset(shapes, layers, styles, shapes2)) {
std::swap(shapes, shapes2); std::swap(shapes, shapes2);
} }
} }
@@ -1412,13 +1412,11 @@ bool IfcGeom::Kernel::convert_layerset(const IfcSchema::IfcProduct* product, std
TopExp_Explorer exp(axis_shape, TopAbs_EDGE); TopExp_Explorer exp(axis_shape, TopAbs_EDGE);
TopoDS_Edge axis_edge; TopoDS_Edge axis_edge;
int edge_count = 0; int edge_count = 0;
for (; exp.More(); exp.Next()) {
if (exp.More()) {
axis_edge = TopoDS::Edge(exp.Current()); axis_edge = TopoDS::Edge(exp.Current());
++ edge_count; ++ edge_count;
break; } else {
}
if (edge_count == 0) {
Logger::Message(Logger::LOG_WARNING, "No edge found in axis representation:", product->entity); Logger::Message(Logger::LOG_WARNING, "No edge found in axis representation:", product->entity);
return false; return false;
} }
@@ -1521,7 +1519,7 @@ const Handle_Geom_Curve IfcGeom::Kernel::intersect(const TopoDS_Face& a, const H
return intersect(BRep_Tool::Surface(a), b); return intersect(BRep_Tool::Surface(a), b);
} }
bool IfcGeom::Kernel::intersect(const Handle_Geom_Curve& a, const Handle_Geom_Surface& b, gp_Pnt& p, double& u, double& v, double& w) { bool IfcGeom::Kernel::intersect(const Handle_Geom_Curve& a, const Handle_Geom_Surface& b, gp_Pnt& p) {
GeomAPI_IntCS x(a, b); GeomAPI_IntCS x(a, b);
if (x.IsDone() && x.NbPoints() == 1) { if (x.IsDone() && x.NbPoints() == 1) {
p = x.Point(1); p = x.Point(1);
@@ -1532,8 +1530,7 @@ bool IfcGeom::Kernel::intersect(const Handle_Geom_Curve& a, const Handle_Geom_Su
} }
bool IfcGeom::Kernel::intersect(const Handle_Geom_Curve& a, const TopoDS_Face& b, gp_Pnt &c) { bool IfcGeom::Kernel::intersect(const Handle_Geom_Curve& a, const TopoDS_Face& b, gp_Pnt &c) {
double u,v,w; return intersect(a, BRep_Tool::Surface(b), c);
return intersect(a, BRep_Tool::Surface(b), c, u, v, w);
} }
bool IfcGeom::Kernel::intersect(const Handle_Geom_Curve& a, const TopoDS_Shape& b, std::vector<gp_Pnt>& out) { bool IfcGeom::Kernel::intersect(const Handle_Geom_Curve& a, const TopoDS_Shape& b, std::vector<gp_Pnt>& out) {
@@ -1691,10 +1688,12 @@ bool IfcGeom::Kernel::fold_layers(const IfcSchema::IfcWall* wall, const IfcRepre
continue; continue;
} }
/*
IfcSchema::IfcConnectionTypeEnum::IfcConnectionTypeEnum connection_type = idx == 1 IfcSchema::IfcConnectionTypeEnum::IfcConnectionTypeEnum connection_type = idx == 1
? IfcSchema::IfcConnectionTypeEnum::IfcConnectionType_ATSTART ? IfcSchema::IfcConnectionTypeEnum::IfcConnectionType_ATSTART
: IfcSchema::IfcConnectionTypeEnum::IfcConnectionType_ATEND; : IfcSchema::IfcConnectionTypeEnum::IfcConnectionType_ATEND;
*/
std::set<const IfcSchema::IfcProduct*> others; std::set<const IfcSchema::IfcProduct*> others;
endpoint_connections_t::iterator it = endpoint_connections.begin(); endpoint_connections_t::iterator it = endpoint_connections.begin();
while (it != endpoint_connections.end()) { while (it != endpoint_connections.end()) {
@@ -1801,8 +1800,8 @@ bool IfcGeom::Kernel::fold_layers(const IfcSchema::IfcWall* wall, const IfcRepre
exp.Next(); exp.Next();
for (; exp.More(); exp.Next()) { for (; exp.More(); exp.Next()) {
TopoDS_Edge axis_edge = TopoDS::Edge(exp.Current()); TopoDS_Edge axis_edge2 = TopoDS::Edge(exp.Current());
TopExp_Explorer exp2(axis_edge, TopAbs_VERTEX); TopExp_Explorer exp2(axis_edge2, TopAbs_VERTEX);
for (; exp2.More(); exp2.Next()) { for (; exp2.More(); exp2.Next()) {
gp_Pnt p = BRep_Tool::Pnt(TopoDS::Vertex(exp2.Current())); gp_Pnt p = BRep_Tool::Pnt(TopoDS::Vertex(exp2.Current()));
gp_Pnt pp; gp_Pnt pp;
@@ -1866,19 +1865,19 @@ bool IfcGeom::Kernel::fold_layers(const IfcSchema::IfcWall* wall, const IfcRepre
Handle_Geom_Curve layer_body_intersection; Handle_Geom_Curve layer_body_intersection;
Handle_Geom_Surface body_surface; Handle_Geom_Surface body_surface;
double mind = std::numeric_limits<double>::infinity(); double mind = std::numeric_limits<double>::infinity();
for (curves_on_surfaces_t::const_iterator it = layer_ends.begin(); it != layer_ends.end(); ++it) { for (curves_on_surfaces_t::const_iterator kt = layer_ends.begin(); kt != layer_ends.end(); ++kt) {
gp_Pnt p; gp_Pnt p;
gp_Vec v; gp_Vec v;
double u, d; double u, d;
it->second->D1(0., p, v); kt->second->D1(0., p, v);
if (ALMOST_THE_SAME(0., v.Dot(gp::DZ()))) { if (ALMOST_THE_SAME(0., v.Dot(gp::DZ()))) {
// Filter horizontal curves // Filter horizontal curves
continue; continue;
} }
if (project(it->second, own_end_point, p, u, d)) { if (project(kt->second, own_end_point, p, u, d)) {
if (d < mind) { if (d < mind) {
body_surface = it->first; body_surface = kt->first;
layer_body_intersection = it->second; layer_body_intersection = kt->second;
mind = d; mind = d;
} }
} }
@@ -1924,7 +1923,7 @@ bool IfcGeom::Kernel::fold_layers(const IfcSchema::IfcWall* wall, const IfcRepre
return folds_made; return folds_made;
} }
bool IfcGeom::Kernel::apply_folded_layerset(const IfcRepresentationShapeItems& items, const std::vector< std::vector<Handle_Geom_Surface> >& surfaces, const std::vector<const SurfaceStyle*>& styles, const std::vector<double>& thickness, IfcRepresentationShapeItems& result) { bool IfcGeom::Kernel::apply_folded_layerset(const IfcRepresentationShapeItems& items, const std::vector< std::vector<Handle_Geom_Surface> >& surfaces, const std::vector<const SurfaceStyle*>& styles, IfcRepresentationShapeItems& result) {
Bnd_Box bb; Bnd_Box bb;
TopoDS_Shape input; TopoDS_Shape input;
flatten_shape_list(items, input, false); flatten_shape_list(items, input, false);
@@ -1989,8 +1988,8 @@ bool IfcGeom::Kernel::apply_folded_layerset(const IfcRepresentationShapeItems& i
} }
BRepOffsetAPI_Sewing builder; BRepOffsetAPI_Sewing builder;
for (faces_with_mass_t::const_iterator it = solids.begin(); it != solids.end(); ++it) { for (faces_with_mass_t::const_iterator kt = solids.begin(); kt != solids.end(); ++kt) {
builder.Add(it->first); builder.Add(kt->first);
} }
builder.Perform(); builder.Perform();
@@ -2060,7 +2059,7 @@ bool IfcGeom::Kernel::apply_folded_layerset(const IfcRepresentationShapeItems& i
} }
bool IfcGeom::Kernel::apply_layerset(const IfcRepresentationShapeItems& items, const std::vector<Handle_Geom_Surface>& surfaces, const std::vector<const SurfaceStyle*>& styles, const std::vector<double>& thickness, IfcRepresentationShapeItems& result) { bool IfcGeom::Kernel::apply_layerset(const IfcRepresentationShapeItems& items, const std::vector<Handle_Geom_Surface>& surfaces, const std::vector<const SurfaceStyle*>& styles, IfcRepresentationShapeItems& result) {
if (surfaces.size() < 3) { if (surfaces.size() < 3) {
return false; return false;