vmults = l->VMultiplicities();
- TColgp_Array2OfPnt Poles (0, cps->size() - 1, 0, (*cps->begin()).size() - 1);
- TColStd_Array1OfReal UKnots(0, uknots.size() - 1);
- TColStd_Array1OfReal VKnots(0, vknots.size() - 1);
- TColStd_Array1OfInteger UMults(0, umults.size() - 1);
- TColStd_Array1OfInteger VMults(0, vmults.size() - 1);
+ TColgp_Array2OfPnt Poles (0, (int)cps->size() - 1, 0, (int)(*cps->begin()).size() - 1);
+ TColStd_Array1OfReal UKnots(0, (int)uknots.size() - 1);
+ TColStd_Array1OfReal VKnots(0, (int)vknots.size() - 1);
+ TColStd_Array1OfInteger UMults(0, (int)umults.size() - 1);
+ TColStd_Array1OfInteger VMults(0, (int)vmults.size() - 1);
Standard_Integer UDegree = l->UDegree();
Standard_Integer VDegree = l->VDegree();
diff --git a/src/ifcgeom/IfcGeomFunctions.cpp b/src/ifcgeom/IfcGeomFunctions.cpp
index fe0bf7b00e..ecf9e2b3b9 100644
--- a/src/ifcgeom/IfcGeomFunctions.cpp
+++ b/src/ifcgeom/IfcGeomFunctions.cpp
@@ -213,12 +213,11 @@ bool IfcGeom::Kernel::convert_openings(const IfcSchema::IfcProduct* entity, cons
? BRepBuilderAPI_GTransform(opening_shape_unlocated,opening_shape_gtrsf,true).Shape()
: opening_shape_unlocated.Moved(opening_shape_gtrsf.Trsf());
- double opening_volume, original_shape_volume;
+ double opening_volume;
if ( Logger::Verbosity() >= Logger::LOG_WARNING ) {
opening_volume = shape_volume(opening_shape);
if ( opening_volume <= ALMOST_ZERO )
Logger::Message(Logger::LOG_WARNING,"Empty opening for:",entity->entity);
- original_shape_volume = shape_volume(entity_shape);
}
if (entity_shape.ShapeType() == TopAbs_COMPSOLID) {
@@ -240,9 +239,9 @@ bool IfcGeom::Kernel::convert_openings(const IfcSchema::IfcProduct* entity, cons
BRepCheck_Analyzer analyser(brep_cut_result);
bool is_valid = analyser.IsValid() != 0;
if (is_valid) {
- TopExp_Explorer exp(brep_cut_result, TopAbs_SOLID);
- for (; exp.More(); exp.Next()) {
- builder.Add(compound, exp.Current());
+ TopExp_Explorer exp2(brep_cut_result, TopAbs_SOLID);
+ for (; exp2.More(); exp2.Next()) {
+ builder.Add(compound, exp2.Current());
added = true;
}
}
@@ -277,7 +276,7 @@ bool IfcGeom::Kernel::convert_openings(const IfcSchema::IfcProduct* entity, cons
entity_shape = brep_cut_result;
if ( Logger::Verbosity() >= Logger::LOG_WARNING ) {
const double volume_after_subtraction = shape_volume(entity_shape);
-
+ double original_shape_volume = shape_volume(entity_shape);
if ( ALMOST_THE_SAME(original_shape_volume,volume_after_subtraction) )
Logger::Message(Logger::LOG_WARNING,"Subtraction yields unchanged volume:",entity->entity);
}
@@ -625,11 +624,11 @@ IfcSchema::IfcProductDefinitionShape* IfcGeom::tesselate(TopoDS_Shape& shape, do
IfcSchema::IfcFaceOuterBound* bound = new IfcSchema::IfcFaceOuterBound(loop, face.Orientation() != TopAbs_REVERSED);
IfcSchema::IfcFaceBound::list::ptr bounds (new IfcSchema::IfcFaceBound::list);
bounds->push(bound);
- IfcSchema::IfcFace* face = new IfcSchema::IfcFace(bounds);
+ IfcSchema::IfcFace* face2 = new IfcSchema::IfcFace(bounds);
es->push(loop);
es->push(bound);
- es->push(face);
- faces->push(face);
+ es->push(face2);
+ faces->push(face2);
}
}
}
@@ -713,7 +712,6 @@ bool IfcGeom::Kernel::fill_nonmanifold_wires_with_planar_faces(TopoDS_Shape& sha
// Now loop over all the vertices that are part of the wire(s) to be filled
for (int i = 1; i <= num_verts; ++i) {
first = current = TopoDS::Vertex(vertex_to_edges.FindKey(i));
- const bool isSame = first.IsSame(current);
// We keep track of the vertices we already used
if (visited.find(vertex_to_edges.FindIndex(current)) != visited.end()) {
continue;
@@ -721,7 +719,7 @@ bool IfcGeom::Kernel::fill_nonmanifold_wires_with_planar_faces(TopoDS_Shape& sha
// Given these vertices, try to find closed loops and create new
// wires out of them.
BRepBuilderAPI_MakeWire w;
- while (true) {
+ for (;;) {
visited.insert(vertex_to_edges.FindIndex(current));
// Find the edge that the current vertex is part of and points
// away from the previous vertex (null for the first vertex).
@@ -842,7 +840,7 @@ void IfcGeom::Kernel::remove_redundant_points_from_loop(TColgp_SequenceOfPnt& po
if (tol <= 0.) tol = getValue(GV_POINT_EQUALITY_TOLERANCE);
tol *= tol;
- while (true) {
+ for (;;) {
bool removed = false;
int n = polygon.Length() - (closed ? 0 : 1);
for (int i = 1; i <= n; ++i) {
diff --git a/src/ifcgeom/IfcGeomHelpers.cpp b/src/ifcgeom/IfcGeomHelpers.cpp
index bba462dd12..8b6ef76eac 100644
--- a/src/ifcgeom/IfcGeomHelpers.cpp
+++ b/src/ifcgeom/IfcGeomHelpers.cpp
@@ -287,7 +287,7 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcObjectPlacement* l, gp_Trsf& t
return false;
}
IfcSchema::IfcLocalPlacement* current = (IfcSchema::IfcLocalPlacement*)l;
- while (1) {
+ for (;;) {
gp_Trsf trsf2;
IfcSchema::IfcAxis2Placement* relplacement = current->RelativePlacement();
if ( relplacement->is(IfcSchema::Type::IfcAxis2Placement3D) ) {
diff --git a/src/ifcgeom/IfcGeomIterator.h b/src/ifcgeom/IfcGeomIterator.h
index a2b6cb9e34..30bf6fe9cb 100644
--- a/src/ifcgeom/IfcGeomIterator.h
+++ b/src/ifcgeom/IfcGeomIterator.h
@@ -289,7 +289,7 @@ namespace IfcGeom {
}
BRepElement* create_shape_model_for_next_entity() {
- while ( true ) {
+ for (;;) {
IfcSchema::IfcRepresentation* representation;
// Have we reached the end of our list of representations?
@@ -322,16 +322,16 @@ namespace IfcGeom {
// Filter the products based on the set of entities being included or excluded for
// processing. The set is iterated over te able to filter on subtypes.
- for ( IfcSchema::IfcProduct::list::it it = unfiltered_products->begin(); it != unfiltered_products->end(); ++it ) {
+ for ( IfcSchema::IfcProduct::list::it jt = unfiltered_products->begin(); jt != unfiltered_products->end(); ++jt ) {
bool found = false;
- for (std::set::const_iterator jt = entities_to_include_or_exclude.begin(); jt != entities_to_include_or_exclude.end(); ++jt) {
- if ((*it)->is(*jt)) {
+ for (std::set::const_iterator kt = entities_to_include_or_exclude.begin(); kt != entities_to_include_or_exclude.end(); ++kt) {
+ if ((*jt)->is(*kt)) {
found = true;
break;
}
}
if (found == include_entities_in_processing) {
- ifcproducts->push(*it);
+ ifcproducts->push(*jt);
}
}
diff --git a/src/ifcgeom/IfcGeomRepresentation.h b/src/ifcgeom/IfcGeomRepresentation.h
index bd7abee278..501ff68733 100644
--- a/src/ifcgeom/IfcGeomRepresentation.h
+++ b/src/ifcgeom/IfcGeomRepresentation.h
@@ -41,6 +41,8 @@ namespace IfcGeom {
namespace Representation {
class Representation {
+ Representation(const Representation&); //N/A
+ Representation& operator =(const Representation&); //N/A
protected:
const ElementSettings _settings;
public:
@@ -116,33 +118,33 @@ namespace IfcGeom {
: Representation(shape_model.settings())
, _id(shape_model.getId())
{
- for ( IfcGeom::IfcRepresentationShapeItems::const_iterator it = shape_model.begin(); it != shape_model.end(); ++ it ) {
+ for ( IfcGeom::IfcRepresentationShapeItems::const_iterator iit = shape_model.begin(); iit != shape_model.end(); ++ iit ) {
int surface_style_id = -1;
- if (it->hasStyle()) {
- Material adapter(&it->Style());
+ if (iit->hasStyle()) {
+ Material adapter(&iit->Style());
std::vector::const_iterator jt = std::find(_materials.begin(), _materials.end(), adapter);
if (jt == _materials.end()) {
- surface_style_id = _materials.size();
+ surface_style_id = (int)_materials.size();
_materials.push_back(adapter);
} else {
- surface_style_id = jt - _materials.begin();
+ surface_style_id = (int)(jt - _materials.begin());
}
}
if (settings().apply_default_materials() && surface_style_id == -1) {
Material material(IfcGeom::get_default_style(settings().element_type()));
- std::vector::const_iterator it = std::find(_materials.begin(), _materials.end(), material);
- if (it == _materials.end()) {
- surface_style_id = _materials.size();
+ std::vector::const_iterator mit = std::find(_materials.begin(), _materials.end(), material);
+ if (mit == _materials.end()) {
+ surface_style_id = (int)_materials.size();
_materials.push_back(material);
} else {
- surface_style_id = it - _materials.begin();
+ surface_style_id = (int)(mit - _materials.begin());
}
}
- const TopoDS_Shape& s = it->Shape();
- const gp_GTrsf& trsf = it->Placement();
+ const TopoDS_Shape& s = iit->Shape();
+ const gp_GTrsf& trsf = iit->Placement();
// Triangulate the shape
try {
@@ -233,11 +235,11 @@ namespace IfcGeom {
addEdge(dict[n2], dict[n3], edgecount, edges_temp);
addEdge(dict[n3], dict[n1], edgecount, edges_temp);
}
- for ( std::vector >::const_iterator it = edges_temp.begin(); it != edges_temp.end(); ++it ) {
- if (edgecount[*it] == 1) {
+ for ( std::vector >::const_iterator jt = edges_temp.begin(); jt != edges_temp.end(); ++jt ) {
+ if (edgecount[*jt] == 1) {
// non manifold edge, face boundary
- _edges.push_back(it->first);
- _edges.push_back(it->second);
+ _edges.push_back(jt->first);
+ _edges.push_back(jt->second);
}
}
}
@@ -247,11 +249,11 @@ namespace IfcGeom {
// Edges are only emitted if there are no faces. A mixed representation of faces
// and loose edges is discouraged by the standard. An alternative would be to use
// TopExp::MapShapesAndAncestors() to find edges that do not belong to any face.
- for (TopExp_Explorer exp(s, TopAbs_EDGE); exp.More(); exp.Next()) {
- BRepAdaptor_Curve crv(TopoDS::Edge(exp.Current()));
+ for (TopExp_Explorer texp(s, TopAbs_EDGE); texp.More(); texp.Next()) {
+ BRepAdaptor_Curve crv(TopoDS::Edge(texp.Current()));
GCPnts_QuasiUniformDeflection tessellater(crv, settings().deflection_tolerance());
int n = tessellater.NbPoints();
- int start = _verts.size() / 3;
+ int start = (int)_verts.size() / 3;
for (int i = 1; i <= n; ++i) {
gp_XYZ p = tessellater.Value(i).XYZ();
trsf.Transforms(p);
diff --git a/src/ifcgeom/IfcGeomShapes.cpp b/src/ifcgeom/IfcGeomShapes.cpp
index 2402e1319d..af74b4369f 100644
--- a/src/ifcgeom/IfcGeomShapes.cpp
+++ b/src/ifcgeom/IfcGeomShapes.cpp
@@ -404,7 +404,7 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcBooleanResult* l, TopoDS_Shape
bool IfcGeom::Kernel::convert(const IfcSchema::IfcConnectedFaceSet* l, TopoDS_Shape& shape) {
IfcSchema::IfcFace::list::ptr faces = l->CfsFaces();
bool facesAdded = false;
- const unsigned int num_faces = faces->size();
+ const unsigned int num_faces = (unsigned)faces->size();
bool valid_shell = false;
if ( num_faces < getValue(GV_MAX_FACES_TO_SEW) ) {
BRepOffsetAPI_Sewing builder;
@@ -632,9 +632,9 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcCurveBoundedPlane* l, TopoDS_S
BRepBuilderAPI_MakeFace mf (outer);
mf.Add(outer);
- IfcSchema::IfcCurve::list::ptr inner = l->InnerBoundaries();
+ IfcSchema::IfcCurve::list::ptr boundaries = l->InnerBoundaries();
- for (IfcSchema::IfcCurve::list::it it = inner->begin(); it != inner->end(); ++it) {
+ for (IfcSchema::IfcCurve::list::it it = boundaries->begin(); it != boundaries->end(); ++it) {
TopoDS_Wire inner;
convert_wire(*it, inner);
@@ -767,8 +767,8 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcSweptDiskSolid* l, TopoDS_Shap
// Subtraction of pipes with small radii is unstable.
hasInnerRadius = false;
} else {
- Handle(Geom_Circle) circle = new Geom_Circle(directrix, r2);
- section2 = BRepBuilderAPI_MakeWire(BRepBuilderAPI_MakeEdge(circle));
+ Handle(Geom_Circle) circle2 = new Geom_Circle(directrix, r2);
+ section2 = BRepBuilderAPI_MakeWire(BRepBuilderAPI_MakeEdge(circle2));
}
}
@@ -887,7 +887,7 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcTriangulatedFaceSet* l, TopoDS
if (faces.empty()) return false;
- const unsigned int num_faces = indices.size();
+ const unsigned int num_faces = (unsigned)indices.size();
bool valid_shell = false;
if (faces.size() < getValue(GV_MAX_FACES_TO_SEW)) {
diff --git a/src/ifcgeom/IfcGeomWires.cpp b/src/ifcgeom/IfcGeomWires.cpp
index a4b74f995d..058302222b 100644
--- a/src/ifcgeom/IfcGeomWires.cpp
+++ b/src/ifcgeom/IfcGeomWires.cpp
@@ -184,8 +184,6 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcTrimmedCurve* l, TopoDS_Wire&
bool trim_cartesian = l->MasterRepresentation() == IfcSchema::IfcTrimmingPreference::IfcTrimmingPreference_CARTESIAN;
IfcEntityList::ptr trims1 = l->Trim1();
IfcEntityList::ptr trims2 = l->Trim2();
- bool trimmed1 = false;
- bool trimmed2 = false;
unsigned sense_agreement = l->SenseAgreement() ? 0 : 1;
double flts[2];
gp_Pnt pnts[2];
@@ -411,9 +409,9 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcEdgeLoop* l, TopoDS_Wire& resu
TopoDS_Wire w;
if (convert_wire(*it, w)) {
if (!(*it)->Orientation()) w.Reverse();
- TopoDS_Iterator it(w, false);
- for (; it.More(); it.Next()) {
- const TopoDS_Edge& e = TopoDS::Edge(it.Value());
+ TopoDS_Iterator topoit(w, false);
+ for (; topoit.More(); topoit.Next()) {
+ const TopoDS_Edge& e = TopoDS::Edge(topoit.Value());
mw.Add(e);
}
// mw.Add(w);
diff --git a/src/ifcgeomserver/IfcGeomServer.cpp b/src/ifcgeomserver/IfcGeomServer.cpp
index 22eaca9844..fa3a356b4d 100644
--- a/src/ifcgeomserver/IfcGeomServer.cpp
+++ b/src/ifcgeomserver/IfcGeomServer.cpp
@@ -69,7 +69,7 @@ void swrite(std::ostream& s, T t) {
template <>
void swrite(std::ostream& s, std::string t) {
- int32_t len = t.size();
+ int32_t len = (int32_t)t.size();
swrite(s, len);
s.write(t.c_str(), len);
while (len++ % 4) s.put(0);
@@ -156,16 +156,16 @@ public:
class Get : public Command {
protected:
- void read_content(std::istream& s) {}
- void write_content(std::ostream& s) {}
+ void read_content(std::istream& /*s*/) {}
+ void write_content(std::ostream& /*s*/) {}
public:
Get() : Command(GET) {};
};
class GetLog : public Command {
protected:
- void read_content(std::istream& s) {}
- void write_content(std::ostream& s) {}
+ void read_content(std::istream& /*s*/) {}
+ void write_content(std::ostream& /*s*/) {}
public:
GetLog() : Command(GET_LOG) {};
};
@@ -189,7 +189,7 @@ private:
const IfcGeom::TriangulationElement* geom;
bool append_line_data;
protected:
- void read_content(std::istream& s) {}
+ void read_content(std::istream& /*s*/) {}
void write_content(std::ostream& s) {
swrite(s, geom->id());
swrite(s, geom->guid());
@@ -238,9 +238,9 @@ protected:
}
{ std::vector diffuse_color_array;
for (std::vector::const_iterator it = geom->geometry().materials().begin(); it != geom->geometry().materials().end(); ++it) {
- const IfcGeom::Material& m = *it;
- if (m.hasDiffuse()) {
- const double* color = m.diffuse();
+ const IfcGeom::Material& mat = *it;
+ if (mat.hasDiffuse()) {
+ const double* color = mat.diffuse();
diffuse_color_array.push_back(static_cast(color[0]));
diffuse_color_array.push_back(static_cast(color[1]));
diffuse_color_array.push_back(static_cast(color[2]));
@@ -249,8 +249,8 @@ protected:
diffuse_color_array.push_back(0.f);
diffuse_color_array.push_back(0.f);
}
- if (m.hasTransparency()) {
- diffuse_color_array.push_back(static_cast(1. - m.transparency()));
+ if (mat.hasTransparency()) {
+ diffuse_color_array.push_back(static_cast(1. - mat.transparency()));
} else {
diffuse_color_array.push_back(1.f);
}
@@ -268,25 +268,21 @@ public:
class Next : public Command {
protected:
- void read_content(std::istream& s) {}
- void write_content(std::ostream& s) {}
+ void read_content(std::istream& /*s*/) {}
+ void write_content(std::ostream& /*s*/) {}
public:
Next() : Command(NEXT) {};
};
class Bye : public Command {
protected:
- void read_content(std::istream& s) {}
- void write_content(std::ostream& s) {}
+ void read_content(std::istream& /*s*/) {}
+ void write_content(std::ostream& /*s*/) {}
public:
Bye() : Command(BYE) {};
};
-int main (int argc, char** argv) {
- if (sizeof(float) != 4 || sizeof(int32_t) != 4) {
- return 1;
- }
-
+int main () {
// Redirect stdout to this stream, so that involuntary
// writes to stdout do not interfere with our protocol.
std::ostringstream oss;
@@ -308,7 +304,7 @@ int main (int argc, char** argv) {
Hello().write(std::cout);
int exit_code = 0;
- while (1) {
+ for (;;) {
const int32_t msg_type = sread(std::cin);
switch (msg_type) {
case IFC_MODEL: {
@@ -323,7 +319,7 @@ int main (int argc, char** argv) {
settings.convert_back_units() = true;
settings.include_curves() = true;
- iterator = new IfcGeom::Iterator(settings, data, len);
+ iterator = new IfcGeom::Iterator(settings, data, (int)len);
has_more = iterator->initialize();
More(has_more).write(std::cout);
diff --git a/src/ifcparse/Ifc2x3-latebound.cpp b/src/ifcparse/Ifc2x3-latebound.cpp
index 289b4279c4..fcc21020e0 100644
--- a/src/ifcparse/Ifc2x3-latebound.cpp
+++ b/src/ifcparse/Ifc2x3-latebound.cpp
@@ -4247,48 +4247,48 @@ std::pair Type::GetEnumerationIndex(Enum t, const std::string&
}
std::pair Type::GetInverseAttribute(Enum t, const std::string& a) {
- if (inverse_map.empty()) ::InitInverseMap();
- inverse_map_t::const_iterator it;
- inverse_map_t::mapped_type::const_iterator jt;
- while (true) {
+ if (inverse_map.empty()) ::InitInverseMap();
+ inverse_map_t::const_iterator it;
+ inverse_map_t::mapped_type::const_iterator jt;
+ for(;;) {
it = inverse_map.find(t);
if (it != inverse_map.end()) {
- jt = it->second.find(a);
- if (jt != it->second.end()) {
- return jt->second;
- }
- }
+ jt = it->second.find(a);
+ if (jt != it->second.end()) {
+ return jt->second;
+ }
+ }
if ((t = Parent(t)) == -1) break;
}
throw IfcException("Attribute not found");
}
std::set Type::GetInverseAttributeNames(Enum t) {
- if (inverse_map.empty()) ::InitInverseMap();
- inverse_map_t::const_iterator it;
- inverse_map_t::mapped_type::const_iterator jt;
+ if (inverse_map.empty()) ::InitInverseMap();
+ inverse_map_t::const_iterator it;
+ inverse_map_t::mapped_type::const_iterator jt;
- std::set return_value;
+ std::set return_value;
- while (true) {
+ for (;;) {
it = inverse_map.find(t);
if (it != inverse_map.end()) {
- for (jt = it->second.begin(); jt != it->second.end(); ++jt) {
- return_value.insert(jt->first);
- }
- }
+ for (jt = it->second.begin(); jt != it->second.end(); ++jt) {
+ return_value.insert(jt->first);
+ }
+ }
if ((t = Parent(t)) == -1) break;
}
-
- return return_value;
+
+ return return_value;
}
void Type::PopulateDerivedFields(IfcWrite::IfcWritableEntity* e) {
std::map >::const_iterator i = derived_map.find(e->type());
- if (i != derived_map.end()) {
- for (std::set::const_iterator it = i->second.begin(); it != i->second.end(); ++it) {
- e->setArgumentDerived(*it);
- }
- }
+ if (i != derived_map.end()) {
+ for (std::set::const_iterator it = i->second.begin(); it != i->second.end(); ++it) {
+ e->setArgumentDerived(*it);
+ }
+ }
}
#endif
diff --git a/src/ifcparse/Ifc2x3.cpp b/src/ifcparse/Ifc2x3.cpp
index 5406ae5c6b..51f6f7941d 100644
--- a/src/ifcparse/Ifc2x3.cpp
+++ b/src/ifcparse/Ifc2x3.cpp
@@ -31,6 +31,8 @@
#include "../ifcparse/IfcWrite.h"
#include "../ifcparse/IfcWritableEntity.h"
+#include