From 667044822bd4b8f22e94a7d2f0ec7f6b3a864b58 Mon Sep 17 00:00:00 2001 From: Thomas Fischer <thomas.fischer@ufz.de> Date: Fri, 3 Jul 2015 10:27:16 +0200 Subject: [PATCH] [MGT] size_t -> std::size_t. --- MeshGeoToolsLib/AppendLinesAlongPolyline.cpp | 6 +++--- MeshGeoToolsLib/BoundaryElementsOnSurface.cpp | 4 ++-- MeshGeoToolsLib/GeoMapper.cpp | 10 +++++----- MeshGeoToolsLib/MeshNodesAlongPolyline.cpp | 4 ++-- MeshGeoToolsLib/MeshNodesAlongSurface.cpp | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/MeshGeoToolsLib/AppendLinesAlongPolyline.cpp b/MeshGeoToolsLib/AppendLinesAlongPolyline.cpp index 24637f64618..731173f5780 100644 --- a/MeshGeoToolsLib/AppendLinesAlongPolyline.cpp +++ b/MeshGeoToolsLib/AppendLinesAlongPolyline.cpp @@ -35,9 +35,9 @@ MeshLib::Mesh* appendLinesAlongPolylines(const MeshLib::Mesh &mesh, const GeoLib for (auto e : vec_new_eles) max_matID = std::max(max_matID, e->getValue()); - const size_t n_ply (ply_vec.size()); + const std::size_t n_ply (ply_vec.size()); // for each polyline - for (size_t k(0); k < n_ply; k++) + for (std::size_t k(0); k < n_ply; k++) { const GeoLib::Polyline* ply = (*ply_vec.getVector())[k]; @@ -52,7 +52,7 @@ MeshLib::Mesh* appendLinesAlongPolylines(const MeshLib::Mesh &mesh, const GeoLib } // add line elements - for (size_t i=0; i<vec_nodes_on_ply.size()-1; i++) { + for (std::size_t i=0; i<vec_nodes_on_ply.size()-1; i++) { std::array<MeshLib::Node*, 2> element_nodes; element_nodes[0] = vec_new_nodes[vec_nodes_on_ply[i]]; element_nodes[1] = vec_new_nodes[vec_nodes_on_ply[i+1]]; diff --git a/MeshGeoToolsLib/BoundaryElementsOnSurface.cpp b/MeshGeoToolsLib/BoundaryElementsOnSurface.cpp index 4e3fdd5aca5..83c154dfb3f 100644 --- a/MeshGeoToolsLib/BoundaryElementsOnSurface.cpp +++ b/MeshGeoToolsLib/BoundaryElementsOnSurface.cpp @@ -36,8 +36,8 @@ BoundaryElementsOnSurface::BoundaryElementsOnSurface(MeshLib::Mesh const& mesh, for (unsigned i=0; i<e->getNFaces(); i++) { auto* face = e->getFace(i); // check - size_t cnt_match = 0; - for (size_t j=0; j<face->getNBaseNodes(); j++) { + std::size_t cnt_match = 0; + for (std::size_t j=0; j<face->getNBaseNodes(); j++) { if (std::find(node_ids_on_sfc.begin(), node_ids_on_sfc.end(), face->getNodeIndex(j)) != node_ids_on_sfc.end()) cnt_match++; else diff --git a/MeshGeoToolsLib/GeoMapper.cpp b/MeshGeoToolsLib/GeoMapper.cpp index 1963bbcafb9..3f7914d61ca 100644 --- a/MeshGeoToolsLib/GeoMapper.cpp +++ b/MeshGeoToolsLib/GeoMapper.cpp @@ -112,7 +112,7 @@ void GeoMapper::mapData() min_val = bounding_box.getMinPoint()[2]; max_val = bounding_box.getMaxPoint()[2]; } - size_t nPoints (points->size()); + std::size_t nPoints (points->size()); if (!is_borehole) { @@ -133,7 +133,7 @@ void GeoMapper::mapData() GeoLib::StationBorehole* borehole = static_cast<GeoLib::StationBorehole*>(pnt); const std::vector<GeoLib::Point*> layers = borehole->getProfile(); - size_t nLayers = layers.size(); + std::size_t nLayers = layers.size(); for (unsigned k=0; k<nLayers; ++k) { GeoLib::Point* layer_pnt = layers[k]; @@ -204,7 +204,7 @@ void GeoMapper::advancedMapOnMesh(const MeshLib::Mesh* mesh, const std::string & // copy geometry (and set z=0 for all points) unsigned nGeoPoints ( points->size() ); std::vector<GeoLib::Point*> *new_points = new std::vector<GeoLib::Point*>(nGeoPoints); - for (size_t i=0; i<nGeoPoints; ++i) + for (std::size_t i=0; i<nGeoPoints; ++i) (*new_points)[i] = new GeoLib::Point((*(*points)[i])[0],(*(*points)[i])[1],0.0); std::vector<GeoLib::Polyline*> *new_lines (copyPolylinesVector(this->_geo_objects.getPolylineVec(this->_geo_name), new_points)); @@ -215,7 +215,7 @@ void GeoMapper::advancedMapOnMesh(const MeshLib::Mesh* mesh, const std::string & const unsigned nMeshNodes ( mesh->getNNodes() ); std::vector<int> closest_geo_point(nMeshNodes); // index of closest geo point for each mesh node in (x,y)-plane std::vector<double> dist(nMeshNodes); // distance between geo points and mesh nodes in (x,y)-plane - for (size_t i=0; i<nMeshNodes; ++i) + for (std::size_t i=0; i<nMeshNodes; ++i) { const double zero_coords[3] = {(* mesh->getNode(i))[0], (* mesh->getNode(i))[1], 0.0}; GeoLib::Point* pnt = grid.getNearestPoint(zero_coords); @@ -224,7 +224,7 @@ void GeoMapper::advancedMapOnMesh(const MeshLib::Mesh* mesh, const std::string & } // store for each point the line segment to which it was added. - const size_t nLines (new_lines->size()); + const std::size_t nLines (new_lines->size()); std::vector< std::vector<unsigned> > line_segment_map(nLines); for (std::size_t i=0; i<nLines; ++i) { diff --git a/MeshGeoToolsLib/MeshNodesAlongPolyline.cpp b/MeshGeoToolsLib/MeshNodesAlongPolyline.cpp index 2795f044615..aab12d85138 100644 --- a/MeshGeoToolsLib/MeshNodesAlongPolyline.cpp +++ b/MeshGeoToolsLib/MeshNodesAlongPolyline.cpp @@ -33,7 +33,7 @@ MeshNodesAlongPolyline::MeshNodesAlongPolyline( const std::size_t n_nodes (search_all_nodes ? _mesh.getNNodes() : _mesh.getNBaseNodes()); auto &mesh_nodes = _mesh.getNodes(); // loop over all nodes - for (size_t i = 0; i < n_nodes; i++) { + for (std::size_t i = 0; i < n_nodes; i++) { double dist = _ply.getDistanceAlongPolyline(*mesh_nodes[i], epsilon_radius); if (dist >= 0.0) { _msh_node_ids.push_back(mesh_nodes[i]->getID()); @@ -51,7 +51,7 @@ MeshLib::Mesh const& MeshNodesAlongPolyline::getMesh () const return _mesh; } -std::vector<size_t> const& MeshNodesAlongPolyline::getNodeIDs () const +std::vector<std::size_t> const& MeshNodesAlongPolyline::getNodeIDs () const { return _msh_node_ids; } diff --git a/MeshGeoToolsLib/MeshNodesAlongSurface.cpp b/MeshGeoToolsLib/MeshNodesAlongSurface.cpp index 79b61cd03c7..bf250429436 100644 --- a/MeshGeoToolsLib/MeshNodesAlongSurface.cpp +++ b/MeshGeoToolsLib/MeshNodesAlongSurface.cpp @@ -30,7 +30,7 @@ MeshNodesAlongSurface::MeshNodesAlongSurface( auto& mesh_nodes = _mesh.getNodes(); const std::size_t n_nodes (search_all_nodes ? _mesh.getNNodes() : _mesh.getNBaseNodes()); // loop over all nodes - for (size_t i = 0; i < n_nodes; i++) { + for (std::size_t i = 0; i < n_nodes; i++) { auto* node = mesh_nodes[i]; if (!sfc.isPntInBoundingVolume(node->getCoords())) continue; -- GitLab