Skip to content

Commit

Permalink
+ Prefer prefix ++/-- operators for non-primitive types
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Oct 6, 2015
1 parent 48bf07e commit f53a691
Show file tree
Hide file tree
Showing 26 changed files with 123 additions and 122 deletions.
4 changes: 2 additions & 2 deletions src/App/ColorModel.h
Expand Up @@ -358,7 +358,7 @@ class AppExport ColorLegend
inline Color ColorLegend::getColor (float fVal) const
{
std::deque<float>::const_iterator pI;
for (pI = _aclValues.begin(); pI != _aclValues.end(); pI++)
for (pI = _aclValues.begin(); pI != _aclValues.end(); ++pI)
{
if (fVal < *pI)
break;
Expand All @@ -383,7 +383,7 @@ inline Color ColorLegend::getColor (float fVal) const
inline unsigned short ColorLegend::getColorIndex (float fVal) const
{
std::deque<float>::const_iterator pI;
for (pI = _aclValues.begin(); pI != _aclValues.end(); pI++)
for (pI = _aclValues.begin(); pI != _aclValues.end(); ++pI)
{
if (fVal < *pI)
break;
Expand Down
4 changes: 2 additions & 2 deletions src/Base/Factory.cpp
Expand Up @@ -38,7 +38,7 @@ using namespace Base;

Factory::~Factory ()
{
for (std::map<const std::string, AbstractProducer*>::iterator pI = _mpcProducers.begin(); pI != _mpcProducers.end(); pI++)
for (std::map<const std::string, AbstractProducer*>::iterator pI = _mpcProducers.begin(); pI != _mpcProducers.end(); ++pI)
delete pI->second;
}

Expand Down Expand Up @@ -67,7 +67,7 @@ std::list<std::string> Factory::CanProduce() const
{
std::list<std::string> lObjects;

for (std::map<const std::string, AbstractProducer*>::const_iterator pI = _mpcProducers.begin(); pI != _mpcProducers.end(); pI++)
for (std::map<const std::string, AbstractProducer*>::const_iterator pI = _mpcProducers.begin(); pI != _mpcProducers.end(); ++pI)
{
lObjects.push_back(pI->first);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Base/Parameter.cpp
Expand Up @@ -864,7 +864,7 @@ void ParameterGrp::Clear(void)

// deleting the nodes
DOMNode* pcTemp;
for (std::vector<DOMNode*>::iterator It=vecNodes.begin();It!=vecNodes.end();It++) {
for (std::vector<DOMNode*>::iterator It=vecNodes.begin();It!=vecNodes.end();++It) {
pcTemp = _pGroupNode->removeChild(*It);
//delete pcTemp;
pcTemp->release();
Expand Down
2 changes: 1 addition & 1 deletion src/Base/Tools2D.cpp
Expand Up @@ -398,7 +398,7 @@ void Polygon2D::Intersect (const Polygon2D &rclPolygon, std::list<Polygon2D> &rc

if (afIntersections.size() > 0) // intersections founded
{
for (std::set<double>::iterator pF = afIntersections.begin(); pF != afIntersections.end(); pF++)
for (std::set<double>::iterator pF = afIntersections.begin(); pF != afIntersections.end(); ++pF)
{
// intersection point
Vector2D clPtIS = clLine.FromPos(*pF);
Expand Down
12 changes: 6 additions & 6 deletions src/Gui/DlgMaterialPropertiesImp.cpp
Expand Up @@ -76,7 +76,7 @@ void DlgMaterialPropertiesImp::on_ambientColor_changed()
float b = (float)col.blue()/255.0f;
App::Color ambient(r,g,b);

for (std::vector<ViewProvider*>::iterator it= Objects.begin();it!=Objects.end();it++) {
for (std::vector<ViewProvider*>::iterator it= Objects.begin();it!=Objects.end();++it) {
App::Property* prop = (*it)->getPropertyByName(material.c_str());
if (prop && prop->getTypeId().isDerivedFrom(App::PropertyMaterial::getClassTypeId())) {
App::PropertyMaterial* ShapeMaterial = (App::PropertyMaterial*)prop;
Expand All @@ -98,7 +98,7 @@ void DlgMaterialPropertiesImp::on_diffuseColor_changed()
float b = (float)col.blue()/255.0f;
App::Color diffuse(r,g,b);

for (std::vector<ViewProvider*>::iterator it= Objects.begin();it!=Objects.end();it++) {
for (std::vector<ViewProvider*>::iterator it= Objects.begin();it!=Objects.end();++it) {
App::Property* prop = (*it)->getPropertyByName(material.c_str());
if (prop && prop->getTypeId().isDerivedFrom(App::PropertyMaterial::getClassTypeId())) {
App::PropertyMaterial* ShapeMaterial = (App::PropertyMaterial*)prop;
Expand All @@ -120,7 +120,7 @@ void DlgMaterialPropertiesImp::on_emissiveColor_changed()
float b = (float)col.blue()/255.0f;
App::Color emissive(r,g,b);

for (std::vector<ViewProvider*>::iterator it= Objects.begin();it!=Objects.end();it++) {
for (std::vector<ViewProvider*>::iterator it= Objects.begin();it!=Objects.end();++it) {
App::Property* prop = (*it)->getPropertyByName(material.c_str());
if (prop && prop->getTypeId().isDerivedFrom(App::PropertyMaterial::getClassTypeId())) {
App::PropertyMaterial* ShapeMaterial = (App::PropertyMaterial*)prop;
Expand All @@ -142,7 +142,7 @@ void DlgMaterialPropertiesImp::on_specularColor_changed()
float b = (float)col.blue()/255.0f;
App::Color specular(r,g,b);

for (std::vector<ViewProvider*>::iterator it= Objects.begin();it!=Objects.end();it++) {
for (std::vector<ViewProvider*>::iterator it= Objects.begin();it!=Objects.end();++it) {
App::Property* prop = (*it)->getPropertyByName(material.c_str());
if (prop && prop->getTypeId().isDerivedFrom(App::PropertyMaterial::getClassTypeId())) {
App::PropertyMaterial* ShapeMaterial = (App::PropertyMaterial*)prop;
Expand All @@ -159,7 +159,7 @@ void DlgMaterialPropertiesImp::on_specularColor_changed()
void DlgMaterialPropertiesImp::on_shininess_valueChanged(int sh)
{
float shininess = (float)sh/100.0f;
for (std::vector<ViewProvider*>::iterator it= Objects.begin();it!=Objects.end();it++) {
for (std::vector<ViewProvider*>::iterator it= Objects.begin();it!=Objects.end();++it) {
App::Property* prop = (*it)->getPropertyByName(material.c_str());
if (prop && prop->getTypeId().isDerivedFrom(App::PropertyMaterial::getClassTypeId())) {
App::PropertyMaterial* ShapeMaterial = (App::PropertyMaterial*)prop;
Expand All @@ -177,7 +177,7 @@ void DlgMaterialPropertiesImp::setViewProviders(const std::vector<Gui::ViewProvi
{
Objects = Obj;

for (std::vector<ViewProvider*>::iterator it= Objects.begin();it!=Objects.end();it++) {
for (std::vector<ViewProvider*>::iterator it= Objects.begin();it!=Objects.end();++it) {
App::Property* prop = (*it)->getPropertyByName(material.c_str());
if (prop && prop->getTypeId().isDerivedFrom(App::PropertyMaterial::getClassTypeId())) {
App::PropertyMaterial* ShapeMaterial = (App::PropertyMaterial*)prop;
Expand Down
40 changes: 20 additions & 20 deletions src/Mod/Mesh/App/Core/Algorithm.cpp
Expand Up @@ -150,7 +150,7 @@ bool MeshAlgorithm::NearestFacetOnRay (const Base::Vector3f &rclPt, const Base::
bool bSol = false;
unsigned long ulInd = 0;

for (std::vector<unsigned long>::const_iterator pI = raulFacets.begin(); pI != raulFacets.end(); pI++) {
for (std::vector<unsigned long>::const_iterator pI = raulFacets.begin(); pI != raulFacets.end(); ++pI) {
MeshGeomFacet rclSFacet = _rclMesh.GetFacet(*pI);
if (rclSFacet.Foraminate(rclPt, rclDir, clRes) == true) {
if (bSol == false) {// erste Loesung
Expand Down Expand Up @@ -182,7 +182,7 @@ bool MeshAlgorithm::RayNearestField (const Base::Vector3f &rclPt, const Base::Ve
bool bSol = false;
unsigned long ulInd = 0;

for (std::vector<unsigned long>::const_iterator pF = raulFacets.begin(); pF != raulFacets.end(); pF++) {
for (std::vector<unsigned long>::const_iterator pF = raulFacets.begin(); pF != raulFacets.end(); ++pF) {
if (_rclMesh.GetFacet(*pF).Foraminate(rclPt, rclDir, clRes/*, fMaxAngle*/) == true) {
if (bSol == false) { // erste Loesung
bSol = true;
Expand Down Expand Up @@ -270,7 +270,7 @@ void MeshAlgorithm::GetMeshBorders (std::list<std::vector<Base::Vector3f> > &rcl
{
std::vector<unsigned long> aulAllFacets(_rclMesh.CountFacets());
unsigned long k = 0;
for (std::vector<unsigned long>::iterator pI = aulAllFacets.begin(); pI != aulAllFacets.end(); pI++)
for (std::vector<unsigned long>::iterator pI = aulAllFacets.begin(); pI != aulAllFacets.end(); ++pI)
*pI = k++;

GetFacetBorders(aulAllFacets, rclBorders);
Expand All @@ -280,7 +280,7 @@ void MeshAlgorithm::GetMeshBorders (std::list<std::vector<unsigned long> > &rclB
{
std::vector<unsigned long> aulAllFacets(_rclMesh.CountFacets());
unsigned long k = 0;
for (std::vector<unsigned long>::iterator pI = aulAllFacets.begin(); pI != aulAllFacets.end(); pI++)
for (std::vector<unsigned long>::iterator pI = aulAllFacets.begin(); pI != aulAllFacets.end(); ++pI)
*pI = k++;

GetFacetBorders(aulAllFacets, rclBorders, true);
Expand Down Expand Up @@ -798,19 +798,19 @@ void MeshAlgorithm::SetFacetsProperty(const std::vector<unsigned long> &raulInds
if (raulInds.size() != raulProps.size()) return;

std::vector<unsigned long>::const_iterator iP = raulProps.begin();
for (std::vector<unsigned long>::const_iterator i = raulInds.begin(); i != raulInds.end(); i++, iP++)
for (std::vector<unsigned long>::const_iterator i = raulInds.begin(); i != raulInds.end(); ++i, ++iP)
_rclMesh._aclFacetArray[*i].SetProperty(*iP);
}

void MeshAlgorithm::SetFacetsFlag (const std::vector<unsigned long> &raulInds, MeshFacet::TFlagType tF) const
{
for (std::vector<unsigned long>::const_iterator i = raulInds.begin(); i != raulInds.end(); i++)
for (std::vector<unsigned long>::const_iterator i = raulInds.begin(); i != raulInds.end(); ++i)
_rclMesh._aclFacetArray[*i].SetFlag(tF);
}

void MeshAlgorithm::SetPointsFlag (const std::vector<unsigned long> &raulInds, MeshPoint::TFlagType tF) const
{
for (std::vector<unsigned long>::const_iterator i = raulInds.begin(); i != raulInds.end(); i++)
for (std::vector<unsigned long>::const_iterator i = raulInds.begin(); i != raulInds.end(); ++i)
_rclMesh._aclPointArray[*i].SetFlag(tF);
}

Expand Down Expand Up @@ -838,13 +838,13 @@ void MeshAlgorithm::GetPointsFlag (std::vector<unsigned long> &raulInds, MeshPoi

void MeshAlgorithm::ResetFacetsFlag (const std::vector<unsigned long> &raulInds, MeshFacet::TFlagType tF) const
{
for (std::vector<unsigned long>::const_iterator i = raulInds.begin(); i != raulInds.end(); i++)
for (std::vector<unsigned long>::const_iterator i = raulInds.begin(); i != raulInds.end(); ++i)
_rclMesh._aclFacetArray[*i].ResetFlag(tF);
}

void MeshAlgorithm::ResetPointsFlag (const std::vector<unsigned long> &raulInds, MeshPoint::TFlagType tF) const
{
for (std::vector<unsigned long>::const_iterator i = raulInds.begin(); i != raulInds.end(); i++)
for (std::vector<unsigned long>::const_iterator i = raulInds.begin(); i != raulInds.end(); ++i)
_rclMesh._aclPointArray[*i].ResetFlag(tF);
}

Expand Down Expand Up @@ -1115,7 +1115,7 @@ void MeshAlgorithm::CheckFacets(const MeshFacetGrid& rclGrid, const Base::ViewPr

Base::SequencerLauncher seq( "Check facets", aulAllElements.size() );

for (it = aulAllElements.begin(); it != aulAllElements.end(); it++)
for (it = aulAllElements.begin(); it != aulAllElements.end(); ++it)
{
bNoPointInside = true;
clGravityOfFacet.Set(0.0f, 0.0f, 0.0f);
Expand Down Expand Up @@ -1231,7 +1231,7 @@ void MeshAlgorithm::SearchFacetsFromPolyline (const std::vector<Base::Vector3f>
return; // no polygon defined

std::set<unsigned long> aclFacets;
for (std::vector<Base::Vector3f>::const_iterator pV = rclPolyline.begin(); pV < (rclPolyline.end() - 1); pV++)
for (std::vector<Base::Vector3f>::const_iterator pV = rclPolyline.begin(); pV < (rclPolyline.end() - 1); ++pV)
{
const Base::Vector3f &rclP0 = *pV, &rclP1 = *(pV + 1);

Expand Down Expand Up @@ -1262,7 +1262,7 @@ void MeshAlgorithm::CutBorderFacets (std::vector<unsigned long> &raclFacetIndice
std::vector<unsigned long> aclResult;
std::set<unsigned long> aclTmp(aclToDelete.begin(), aclToDelete.end());

for (std::vector<unsigned long>::iterator pI = raclFacetIndices.begin(); pI != raclFacetIndices.end(); pI++)
for (std::vector<unsigned long>::iterator pI = raclFacetIndices.begin(); pI != raclFacetIndices.end(); ++pI)
{
if (aclTmp.find(*pI) == aclTmp.end())
aclResult.push_back(*pI);
Expand Down Expand Up @@ -1295,7 +1295,7 @@ void MeshAlgorithm::CheckBorderFacets (const std::vector<unsigned long> &raclFac

for (unsigned short usL = 0; usL < usLevel; usL++)
{
for (std::vector<unsigned long>::const_iterator pF = raclFacetIndices.begin(); pF != raclFacetIndices.end(); pF++)
for (std::vector<unsigned long>::const_iterator pF = raclFacetIndices.begin(); pF != raclFacetIndices.end(); ++pF)
{
for (int i = 0; i < 3; i++)
{
Expand Down Expand Up @@ -1324,7 +1324,7 @@ void MeshAlgorithm::GetBorderPoints (const std::vector<unsigned long> &raclFacet

const MeshFacetArray &rclFAry = _rclMesh._aclFacetArray;

for (std::vector<unsigned long>::const_iterator pF = raclFacetIndices.begin(); pF != raclFacetIndices.end(); pF++)
for (std::vector<unsigned long>::const_iterator pF = raclFacetIndices.begin(); pF != raclFacetIndices.end(); ++pF)
{
for (int i = 0; i < 3; i++)
{
Expand Down Expand Up @@ -1424,7 +1424,7 @@ bool MeshAlgorithm::CutWithPlane (const Base::Vector3f &clBase, const Base::Vect
// alle Facets mit Ebene schneiden
std::list<std::pair<Base::Vector3f, Base::Vector3f> > clTempPoly; // Feld mit Schnittlinien (unsortiert, nicht verkettet)

for (std::vector<unsigned long>::iterator pF = aulFacets.begin(); pF != aulFacets.end(); pF++)
for (std::vector<unsigned long>::iterator pF = aulFacets.begin(); pF != aulFacets.end(); ++pF)
{
Base::Vector3f clE1, clE2;
const MeshGeomFacet clF(_rclMesh.GetFacet(*pF));
Expand All @@ -1442,7 +1442,7 @@ bool MeshAlgorithm::CutWithPlane (const Base::Vector3f &clBase, const Base::Vect
ConnectLines(clTempPoly, tempList, fMinEps);
ConnectPolygons(tempList, clTempPoly);

for(std::list<std::pair<Base::Vector3f, Base::Vector3f> >::iterator iter = clTempPoly.begin(); iter != clTempPoly.end(); iter++)
for(std::list<std::pair<Base::Vector3f, Base::Vector3f> >::iterator iter = clTempPoly.begin(); iter != clTempPoly.end(); ++iter)
{
rclResultLines.push_front(*iter);
}
Expand Down Expand Up @@ -1573,14 +1573,14 @@ bool MeshAlgorithm::ConnectPolygons(std::list<std::vector<Base::Vector3f> > &clP
std::list<std::pair<Base::Vector3f, Base::Vector3f> > &rclLines) const
{

for(std::list< std::vector<Base::Vector3f> >::iterator OutIter = clPolyList.begin(); OutIter != clPolyList.end() ; OutIter++)
for(std::list< std::vector<Base::Vector3f> >::iterator OutIter = clPolyList.begin(); OutIter != clPolyList.end(); ++OutIter)
{
std::pair<Base::Vector3f,Base::Vector3f> currentSort;
float fDist = Base::Distance(OutIter->front(),OutIter->back());
currentSort.first = OutIter->front();
currentSort.second = OutIter->back();

for(std::list< std::vector<Base::Vector3f> >::iterator InnerIter = clPolyList.begin(); InnerIter != clPolyList.end(); InnerIter++)
for(std::list< std::vector<Base::Vector3f> >::iterator InnerIter = clPolyList.begin(); InnerIter != clPolyList.end(); ++InnerIter)
{
if(OutIter == InnerIter) continue;

Expand Down Expand Up @@ -1645,14 +1645,14 @@ void MeshAlgorithm::PointsFromFacetsIndices (const std::vector<unsigned long> &r

std::set<unsigned long> setPoints;

for (std::vector<unsigned long>::const_iterator itI = rvecIndices.begin(); itI != rvecIndices.end(); itI++)
for (std::vector<unsigned long>::const_iterator itI = rvecIndices.begin(); itI != rvecIndices.end(); ++itI)
{
for (int i = 0; i < 3; i++)
setPoints.insert(rclFAry[*itI]._aulPoints[i]);
}

rvecPoints.clear();
for (std::set<unsigned long>::iterator itP = setPoints.begin(); itP != setPoints.end(); itP++)
for (std::set<unsigned long>::iterator itP = setPoints.begin(); itP != setPoints.end(); ++itP)
rvecPoints.push_back(rclPAry[*itP]);
}

Expand Down
4 changes: 2 additions & 2 deletions src/Mod/Mesh/App/Core/Approximation.cpp
Expand Up @@ -343,7 +343,7 @@ float PlaneFit::GetSignedStdDeviation() const
float ulPtCt = (float)CountPoints();
Base::Vector3f clGravity, clPt;
std::list<Base::Vector3f>::const_iterator cIt;
for (cIt = _vPoints.begin(); cIt != _vPoints.end(); cIt++)
for (cIt = _vPoints.begin(); cIt != _vPoints.end(); ++cIt)
clGravity += *cIt;
clGravity *= (1.0f / ulPtCt);

Expand Down Expand Up @@ -623,7 +623,7 @@ double SurfaceFit::PolynomFit()
Eigen::Matrix<double,6,1> x = Eigen::Matrix<double,6,1>::Zero();
#endif

for (std::list<Base::Vector3f>::const_iterator it = _vPoints.begin(); it != _vPoints.end(); it++) {
for (std::list<Base::Vector3f>::const_iterator it = _vPoints.begin(); it != _vPoints.end(); ++it) {
Base::Vector3d clPoint(it->x,it->y,it->z);
clPoint.TransformToCoordinateSystem(bs, ex, ey);
double dU = clPoint.x;
Expand Down
10 changes: 5 additions & 5 deletions src/Mod/Mesh/App/Core/Degeneration.cpp
Expand Up @@ -167,7 +167,7 @@ std::vector<unsigned long> MeshEvalDuplicatePoints::GetIndices() const
// get first item which adjacent element has the same vertex
vt = std::adjacent_find(vt, vertices.end(), pred);
if (vt < vertices.end()) {
vt++;
++vt;
aInds.push_back(*vt - rPoints.begin());
}
}
Expand Down Expand Up @@ -200,12 +200,12 @@ bool MeshFixDuplicatePoints::Fixup()
if (next < vertices.end()) {
std::vector<VertexIterator>::iterator first = next;
unsigned long first_index = *first - rPoints.begin();
next++;
++next;
while (next < vertices.end() && pred(*first, *next)) {
unsigned long next_index = *next - rPoints.begin();
mapPointIndex[next_index] = first_index;
pointIndices.push_back(next_index);
next++;
++next;
}
}
}
Expand Down Expand Up @@ -374,7 +374,7 @@ std::vector<unsigned long> MeshEvalDuplicateFacets::GetIndices() const
// get first item which adjacent element has the same face
ft = std::adjacent_find(ft, faces.end(), pred);
if (ft < faces.end()) {
ft++;
++ft;
aInds.push_back(*ft - rFacets.begin());
}
}
Expand Down Expand Up @@ -566,7 +566,7 @@ unsigned long MeshFixDegeneratedFacets::RemoveEdgeTooSmall (float fMinEdgeLength

// remove points, fix indices
for (std::set<std::pair<unsigned long, unsigned long> >::iterator pI = aclPtDelList.begin();
pI != aclPtDelList.end(); pI++) {
pI != aclPtDelList.end(); ++pI) {
// one of the point pairs is already processed
if ((rclPAry[pI->first].IsFlag(MeshPoint::VISIT) == true) ||
(rclPAry[pI->second].IsFlag(MeshPoint::VISIT) == true))
Expand Down
10 changes: 5 additions & 5 deletions src/Mod/Mesh/App/Core/Evaluation.cpp
Expand Up @@ -289,7 +289,7 @@ bool MeshEvalSolid::Evaluate ()
{
std::vector<MeshGeomEdge> edges;
_rclMesh.GetEdges( edges );
for (std::vector<MeshGeomEdge>::iterator it = edges.begin(); it != edges.end(); it++)
for (std::vector<MeshGeomEdge>::iterator it = edges.begin(); it != edges.end(); ++it)
{
if (it->_bBorder)
return false;
Expand Down Expand Up @@ -360,7 +360,7 @@ bool MeshEvalTopology::Evaluate ()
int count = 0;
std::vector<unsigned long> facets;
std::vector<Edge_Index>::iterator pE;
for (pE = edges.begin(); pE != edges.end(); pE++) {
for (pE = edges.begin(); pE != edges.end(); ++pE) {
if (p0 == pE->p0 && p1 == pE->p1) {
count++;
facets.push_back(pE->f);
Expand Down Expand Up @@ -828,7 +828,7 @@ bool MeshEvalNeighbourhood::Evaluate ()
unsigned long f0 = ULONG_MAX, f1 = ULONG_MAX;
int count = 0;
std::vector<Edge_Index>::iterator pE;
for (pE = edges.begin(); pE != edges.end(); pE++) {
for (pE = edges.begin(); pE != edges.end(); ++pE) {
if (p0 == pE->p0 && p1 == pE->p1) {
f1 = pE->f;
count++;
Expand Down Expand Up @@ -894,7 +894,7 @@ std::vector<unsigned long> MeshEvalNeighbourhood::GetIndices() const
unsigned long f0 = ULONG_MAX, f1 = ULONG_MAX;
int count = 0;
std::vector<Edge_Index>::iterator pE;
for (pE = edges.begin(); pE != edges.end(); pE++) {
for (pE = edges.begin(); pE != edges.end(); ++pE) {
if (p0 == pE->p0 && p1 == pE->p1) {
f1 = pE->f;
count++;
Expand Down Expand Up @@ -968,7 +968,7 @@ void MeshKernel::RebuildNeighbours (unsigned long index)
unsigned long f0 = ULONG_MAX, f1 = ULONG_MAX;
int count = 0;
std::vector<Edge_Index>::iterator pE;
for (pE = edges.begin(); pE != edges.end(); pE++) {
for (pE = edges.begin(); pE != edges.end(); ++pE) {
if (p0 == pE->p0 && p1 == pE->p1) {
f1 = pE->f;
count++;
Expand Down

0 comments on commit f53a691

Please sign in to comment.