Mesh: modernize C++: use range-based for loop

This commit is contained in:
wmayer
2023-08-15 10:55:05 +02:00
committed by wwmayer
parent 452aee7c6f
commit 7f49080952
52 changed files with 1293 additions and 1329 deletions

View File

@@ -64,8 +64,8 @@ QVariant PropertyMeshKernelItem::value(const App::Property*) const
int ctF = 0;
const std::vector<App::Property*>& props = getPropertyData();
for (std::vector<App::Property*>::const_iterator pt = props.begin(); pt != props.end(); ++pt) {
Mesh::PropertyMeshKernel* pPropMesh = (Mesh::PropertyMeshKernel*)(*pt);
for (auto prop : props) {
Mesh::PropertyMeshKernel* pPropMesh = (Mesh::PropertyMeshKernel*)prop;
const MeshKernel& rMesh = pPropMesh->getValue().getKernel();
ctP += (int)rMesh.CountPoints();
ctE += (int)rMesh.CountEdges();
@@ -110,8 +110,8 @@ int PropertyMeshKernelItem::countPoints() const
{
int ctP = 0;
const std::vector<App::Property*>& props = getPropertyData();
for (std::vector<App::Property*>::const_iterator pt = props.begin(); pt != props.end(); ++pt) {
Mesh::PropertyMeshKernel* pPropMesh = (Mesh::PropertyMeshKernel*)(*pt);
for (auto prop : props) {
Mesh::PropertyMeshKernel* pPropMesh = (Mesh::PropertyMeshKernel*)prop;
const MeshKernel& rMesh = pPropMesh->getValue().getKernel();
ctP += (int)rMesh.CountPoints();
}
@@ -123,8 +123,8 @@ int PropertyMeshKernelItem::countEdges() const
{
int ctE = 0;
const std::vector<App::Property*>& props = getPropertyData();
for (std::vector<App::Property*>::const_iterator pt = props.begin(); pt != props.end(); ++pt) {
Mesh::PropertyMeshKernel* pPropMesh = (Mesh::PropertyMeshKernel*)(*pt);
for (auto prop : props) {
Mesh::PropertyMeshKernel* pPropMesh = (Mesh::PropertyMeshKernel*)prop;
const MeshKernel& rMesh = pPropMesh->getValue().getKernel();
ctE += (int)rMesh.CountEdges();
}
@@ -136,8 +136,8 @@ int PropertyMeshKernelItem::countFaces() const
{
int ctF = 0;
const std::vector<App::Property*>& props = getPropertyData();
for (std::vector<App::Property*>::const_iterator pt = props.begin(); pt != props.end(); ++pt) {
Mesh::PropertyMeshKernel* pPropMesh = (Mesh::PropertyMeshKernel*)(*pt);
for (auto prop : props) {
Mesh::PropertyMeshKernel* pPropMesh = (Mesh::PropertyMeshKernel*)prop;
const MeshKernel& rMesh = pPropMesh->getValue().getKernel();
ctF += (int)rMesh.CountFacets();
}