diff --git a/src/Mod/Mesh/App/Core/Approximation.h b/src/Mod/Mesh/App/Core/Approximation.h index cf6ccd450e54..f494abce8dc5 100644 --- a/src/Mod/Mesh/App/Core/Approximation.h +++ b/src/Mod/Mesh/App/Core/Approximation.h @@ -267,7 +267,7 @@ class MeshExport QuadraticFit : public Approximation /** * Destruction */ - virtual ~QuadraticFit(){}; + virtual ~QuadraticFit(){} /** * Get the quadric coefficients * @param ulIndex Number of coefficient (0..9) @@ -515,7 +515,9 @@ class FunctionContainer Base::Vector3f GetGradient( double x, double y, double z ) const { Wm4::Vector3 grad = pImplSurf->GetGradient( Wm4::Vector3(x, y, z) ); - return Base::Vector3f( (float)grad.X(), (float)grad.Y(), (float)grad.Z() ); + return Base::Vector3f(static_cast(grad.X()), + static_cast(grad.Y()), + static_cast(grad.Z())); } Base::Matrix4D GetHessian( double x, double y, double z ) const @@ -535,16 +537,16 @@ class FunctionContainer double zx = - ( Fx(x,y,z) / dQuot ); double zy = - ( Fy(x,y,z) / dQuot ); - double zxx = - ( 2.0f * ( dKoeff[5] + dKoeff[6] * zx * zx + dKoeff[8] * zx ) ) / dQuot; - double zyy = - ( 2.0f * ( dKoeff[5] + dKoeff[6] * zy * zy + dKoeff[9] * zy ) ) / dQuot; + double zxx = - ( 2.0 * ( dKoeff[5] + dKoeff[6] * zx * zx + dKoeff[8] * zx ) ) / dQuot; + double zyy = - ( 2.0 * ( dKoeff[5] + dKoeff[6] * zy * zy + dKoeff[9] * zy ) ) / dQuot; double zxy = - ( dKoeff[6] * zx * zy + dKoeff[7] + dKoeff[8] * zy + dKoeff[9] * zx ) / dQuot; double dNen = 1 + zx*zx + zy*zy; - double dNenSqrt = (double)sqrt( dNen ); + double dNenSqrt = sqrt( dNen ); double K = ( zxx * zyy - zxy * zxy ) / ( dNen * dNen ); - double H = 0.5f * ( ( 1.0f+zx*zx - 2*zx*zy*zxy + (1.0f+zy*zy)*zxx ) / ( dNenSqrt * dNenSqrt * dNenSqrt ) ) ; + double H = 0.5 * ( ( 1.0+zx*zx - 2*zx*zy*zxy + (1.0+zy*zy)*zxx ) / ( dNenSqrt * dNenSqrt * dNenSqrt ) ) ; - double dDiscr = (double)sqrt(fabs(H*H-K)); + double dDiscr = sqrt(fabs(H*H-K)); rfCurv0 = H - dDiscr; rfCurv1 = H + dDiscr; @@ -562,22 +564,22 @@ class FunctionContainer //+++++++++ 1. derivations ++++++++++++++++++++++++++++++++ double Fx ( double x, double y, double z ) { - return( dKoeff[1] + 2.0f*dKoeff[4]*x + dKoeff[7]*y + dKoeff[8]*z ); + return( dKoeff[1] + 2.0*dKoeff[4]*x + dKoeff[7]*y + dKoeff[8]*z ); } double Fy ( double x, double y, double z ) { - return( dKoeff[2] + 2.0f*dKoeff[5]*y + dKoeff[7]*x + dKoeff[9]*z ); + return( dKoeff[2] + 2.0*dKoeff[5]*y + dKoeff[7]*x + dKoeff[9]*z ); } double Fz ( double x, double y, double z ) { - return( dKoeff[3] + 2.0f*dKoeff[6]*z + dKoeff[8]*x + dKoeff[9]*y ); + return( dKoeff[3] + 2.0*dKoeff[6]*z + dKoeff[8]*x + dKoeff[9]*y ); } //+++++++++ 2. derivations ++++++++++++++++++++++++++++++++ double Fxx( double x, double y, double z ) { (void)x; (void)y; (void)z; - return( 2.0f*dKoeff[4] ); + return( 2.0*dKoeff[4] ); } double Fxy( double x, double y, double z ) { @@ -592,7 +594,7 @@ class FunctionContainer double Fyy( double x, double y, double z ) { (void)x; (void)y; (void)z; - return( 2.0f*dKoeff[5] ); + return( 2.0*dKoeff[5] ); } double Fyz( double x, double y, double z ) { @@ -602,7 +604,7 @@ class FunctionContainer double Fzz( double x, double y, double z ) { (void)x; (void)y; (void)z; - return( 2.0f*dKoeff[6] ); + return( 2.0*dKoeff[6] ); } protected: @@ -613,7 +615,7 @@ class FunctionContainer /** * Private construction. */ - FunctionContainer(){}; + FunctionContainer(){} }; class MeshExport PolynomialFit : public Approximation diff --git a/src/Mod/Mesh/App/Core/Elements.cpp b/src/Mod/Mesh/App/Core/Elements.cpp index e56fe310c9e8..23765a8d7bfb 100644 --- a/src/Mod/Mesh/App/Core/Elements.cpp +++ b/src/Mod/Mesh/App/Core/Elements.cpp @@ -533,7 +533,7 @@ bool MeshGeomFacet::IsDegenerated(float epsilon) const Base::Vector3d u = p2 - p1; Base::Vector3d v = p3 - p1; - double eps = epsilon; + double eps = static_cast(epsilon); double uu = u*u; if (uu <= eps) return true; @@ -991,15 +991,15 @@ int MeshGeomFacet::IntersectWithFacet (const MeshGeomFacet& rclFacet, // Note: The algorithm delivers sometimes false-positives, i.e. it claims // that the two triangles intersect but they don't. It seems that this bad // behaviour occurs if the triangles are nearly co-planar - float mult = (float)fabs(this->GetNormal() * rclFacet.GetNormal()); + float mult = fabs(this->GetNormal() * rclFacet.GetNormal()); if (rclPt0 == rclPt1) { - if (mult < 0.995) // not co-planar, thus no test needed + if (mult < 0.995f) // not co-planar, thus no test needed return 1; if (this->IsPointOf(rclPt0) && rclFacet.IsPointOf(rclPt0)) return 1; } else { - if (mult < 0.995) // not co-planar, thus no test needed + if (mult < 0.995f) // not co-planar, thus no test needed return 2; if (this->IsPointOf(rclPt0) && rclFacet.IsPointOf(rclPt0) && this->IsPointOf(rclPt1) && rclFacet.IsPointOf(rclPt1)) @@ -1085,9 +1085,9 @@ float MeshGeomFacet::CenterOfCircumCircle(Base::Vector3f& rclCenter) const float vw = - (v * w); float uw = - (w * u); - float w0 = (float)(2 * sqrt(uu * ww - uw * uw) * uw / (uu * ww)); - float w1 = (float)(2 * sqrt(uu * vv - uv * uv) * uv / (uu * vv)); - float w2 = (float)(2 * sqrt(vv * ww - vw * vw) * vw / (vv * ww)); + float w0 = static_cast(2 * sqrt(uu * ww - uw * uw) * uw / (uu * ww)); + float w1 = static_cast(2 * sqrt(uu * vv - uv * uv) * uv / (uu * vv)); + float w2 = static_cast(2 * sqrt(vv * ww - vw * vw) * vw / (vv * ww)); // center of the circle float wx = w0 + w1 + w2; @@ -1096,7 +1096,7 @@ float MeshGeomFacet::CenterOfCircumCircle(Base::Vector3f& rclCenter) const rclCenter.z = (w0*p0.z + w1*p1.z + w2*p2.z)/wx; // radius of the circle - float fRadius = (float)(sqrt(uu * vv * ww) / (4 * Area())); + float fRadius = static_cast(sqrt(uu * vv * ww) / (4 * Area())); return fRadius; } @@ -1378,10 +1378,19 @@ float MeshGeomFacet::AspectRatio2() const float MeshGeomFacet::Roundness() const { const double FOUR_ROOT3 = 6.928203230275509; - double area = Area(); + double area = static_cast(Area()); Base::Vector3f d0 = _aclPoints[0] - _aclPoints[1]; Base::Vector3f d1 = _aclPoints[1] - _aclPoints[2]; Base::Vector3f d2 = _aclPoints[2] - _aclPoints[0]; - return (float) (FOUR_ROOT3 * area / (d0.Sqr() + d1.Sqr() + d2.Sqr())); + double sum = static_cast(d0.Sqr() + d1.Sqr() + d2.Sqr()); + return static_cast(FOUR_ROOT3 * area / sum); +} + +void MeshGeomFacet::Transform(const Base::Matrix4D& mat) +{ + mat.multVec(_aclPoints[0], _aclPoints[0]); + mat.multVec(_aclPoints[1], _aclPoints[1]); + mat.multVec(_aclPoints[2], _aclPoints[2]); + NormalInvalid(); } diff --git a/src/Mod/Mesh/App/Core/Elements.h b/src/Mod/Mesh/App/Core/Elements.h index fe3f43827af6..8d958b8a0684 100644 --- a/src/Mod/Mesh/App/Core/Elements.h +++ b/src/Mod/Mesh/App/Core/Elements.h @@ -121,11 +121,11 @@ class MeshExport MeshPoint: public Base::Vector3f */ //@{ void SetFlag (TFlagType tF) const - { const_cast(this)->_ucFlag |= (unsigned char)(tF); } + { const_cast(this)->_ucFlag |= static_cast(tF); } void ResetFlag (TFlagType tF) const - { const_cast(this)->_ucFlag &= ~(unsigned char)(tF); } + { const_cast(this)->_ucFlag &= ~static_cast(tF); } bool IsFlag (TFlagType tF) const - { return (_ucFlag & (unsigned char)(tF)) == (unsigned char)(tF); } + { return (_ucFlag & static_cast(tF)) == static_cast(tF); } void ResetInvalid (void) const { ResetFlag(INVALID); } void SetInvalid (void) const @@ -226,11 +226,11 @@ class MeshFacet */ //@{ void SetFlag (TFlagType tF) const - { const_cast(this)->_ucFlag |= (unsigned char)(tF); } + { const_cast(this)->_ucFlag |= static_cast(tF); } void ResetFlag (TFlagType tF) const - { const_cast(this)->_ucFlag &= ~(unsigned char)(tF); } + { const_cast(this)->_ucFlag &= ~static_cast(tF); } bool IsFlag (TFlagType tF) const - { return (_ucFlag & (unsigned char)(tF)) == (unsigned char)(tF); } + { return (_ucFlag & static_cast(tF)) == static_cast(tF); } void ResetInvalid (void) const { ResetFlag(INVALID); } void SetProperty(unsigned long uP) const @@ -412,17 +412,17 @@ class MeshExport MeshGeomFacet * Adjusts the facet's orientation to its normal. */ inline void AdjustCirculationDirection (void); - /** Checks if the normal is not yet calculated. */ + /** Invalidate the normal. It will be recomputed when querying it. */ void NormalInvalid (void) { _bNormalCalculated = false; } /** Query the flag state of the facet. */ bool IsFlag (MeshFacet::TFlagType tF) const - { return (_ucFlag & (unsigned char)(tF)) == (unsigned char)(tF); } + { return (_ucFlag & static_cast(tF)) == static_cast(tF); } /** Set flag state */ void SetFlag (MeshFacet::TFlagType tF) - { _ucFlag |= (unsigned char)(tF); } + { _ucFlag |= static_cast(tF); } /** Reset flag state */ void ResetFlag (MeshFacet::TFlagType tF) - { _ucFlag &= ~(unsigned char)(tF); } + { _ucFlag &= ~static_cast(tF); } /** Calculates the facet's gravity point. */ inline Base::Vector3f GetGravityPoint (void) const; /** Returns the normal of the facet. */ @@ -517,6 +517,9 @@ class MeshExport MeshGeomFacet /** The roundness is in the range between 0.0 (colinear) and 1.0 (equilateral). */ float Roundness() const; + /** Apply a transformation on the triangle. + */ + void Transform(const Base::Matrix4D&); protected: Base::Vector3f _clNormal; /**< Normal of the facet. */ diff --git a/src/Mod/Mesh/App/Core/Evaluation.h b/src/Mod/Mesh/App/Core/Evaluation.h index 47d42334bc3d..0f5573340eb0 100644 --- a/src/Mod/Mesh/App/Core/Evaluation.h +++ b/src/Mod/Mesh/App/Core/Evaluation.h @@ -239,7 +239,7 @@ class MeshExport MeshEvalPointManifolds : public MeshEvaluation void GetFacetIndices (std::vector &facets) const; const std::list >& GetFacetIndices () const { return facetsOfNonManifoldPoints; } const std::vector& GetIndices() const { return nonManifoldPoints; } - unsigned long CountManifolds() const { return nonManifoldPoints.size(); } + unsigned long CountManifolds() const { return static_cast(nonManifoldPoints.size()); } protected: std::vector nonManifoldPoints; diff --git a/src/Mod/Mesh/App/Core/Grid.h b/src/Mod/Mesh/App/Core/Grid.h index 8159c3ac5728..29b34f1c4ddf 100644 --- a/src/Mod/Mesh/App/Core/Grid.h +++ b/src/Mod/Mesh/App/Core/Grid.h @@ -125,7 +125,7 @@ class MeshExport MeshGrid bool GetPositionToIndex(unsigned long id, unsigned long& ulX, unsigned long& ulY, unsigned long& ulZ) const; /** Returns the number of elements in a given grid. */ unsigned long GetCtElements(unsigned long ulX, unsigned long ulY, unsigned long ulZ) const - { return _aulGrid[ulX][ulY][ulZ].size(); } + { return static_cast(_aulGrid[ulX][ulY][ulZ].size()); } /** Validates the grid structure and rebuilds it if needed. Must be implemented in sub-classes. */ virtual void Validate (const MeshKernel &rclM) = 0; /** Verifies the grid structure and returns false if inconsistencies are found. */ @@ -395,9 +395,9 @@ inline bool MeshGrid::CheckPos (unsigned long ulX, unsigned long ulY, unsigned l inline void MeshFacetGrid::Pos (const Base::Vector3f &rclPoint, unsigned long &rulX, unsigned long &rulY, unsigned long &rulZ) const { - rulX = (unsigned long)((rclPoint.x - _fMinX) / _fGridLenX); - rulY = (unsigned long)((rclPoint.y - _fMinY) / _fGridLenY); - rulZ = (unsigned long)((rclPoint.z - _fMinZ) / _fGridLenZ); + rulX = static_cast((rclPoint.x - _fMinX) / _fGridLenX); + rulY = static_cast((rclPoint.y - _fMinY) / _fGridLenY); + rulZ = static_cast((rclPoint.z - _fMinZ) / _fGridLenZ); assert((rulX < _ulCtGridsX) && (rulY < _ulCtGridsY) && (rulZ < _ulCtGridsZ)); } @@ -408,7 +408,7 @@ inline void MeshFacetGrid::PosWithCheck (const Base::Vector3f &rclPoint, unsigne rulX = 0; else { - rulX = (unsigned long)((rclPoint.x - _fMinX) / _fGridLenX); + rulX = static_cast((rclPoint.x - _fMinX) / _fGridLenX); if (rulX >= _ulCtGridsX) rulX = (_ulCtGridsX-1); } @@ -417,7 +417,7 @@ inline void MeshFacetGrid::PosWithCheck (const Base::Vector3f &rclPoint, unsigne rulY = 0; else { - rulY = (unsigned long)((rclPoint.y - _fMinY) / _fGridLenY); + rulY = static_cast((rclPoint.y - _fMinY) / _fGridLenY); if (rulY >= _ulCtGridsY) rulY = (_ulCtGridsY-1); } @@ -426,7 +426,7 @@ inline void MeshFacetGrid::PosWithCheck (const Base::Vector3f &rclPoint, unsigne rulZ = 0; else { - rulZ = (unsigned long)((rclPoint.z - _fMinZ) / _fGridLenZ); + rulZ = static_cast((rclPoint.z - _fMinZ) / _fGridLenZ); if (rulZ >= _ulCtGridsZ) rulZ = (_ulCtGridsZ-1); } diff --git a/src/Mod/Mesh/App/Core/Iterator.h b/src/Mod/Mesh/App/Core/Iterator.h index a8b1ebfb3ba3..6c86bf988635 100644 --- a/src/Mod/Mesh/App/Core/Iterator.h +++ b/src/Mod/Mesh/App/Core/Iterator.h @@ -43,6 +43,7 @@ class MeshHelpEdge; * The MeshFacetIterator allows to iterate over the facets that * hold the topology of the mesh and provides access to their * geometric information. + * \note This class is not thread-safe. */ class MeshFacetIterator { @@ -167,6 +168,7 @@ class MeshFacetIterator /** * The MeshPointIterator allows to iterate over the vertices of the mesh and provides access to their * geometric information. + * \note This class is not thread-safe. */ class MeshExport MeshPointIterator { diff --git a/src/Mod/Mesh/App/Core/MeshIO.cpp b/src/Mod/Mesh/App/Core/MeshIO.cpp index 2111538947b2..f5f2820bc3ba 100644 --- a/src/Mod/Mesh/App/Core/MeshIO.cpp +++ b/src/Mod/Mesh/App/Core/MeshIO.cpp @@ -719,7 +719,7 @@ bool MeshInput::LoadPLY (std::istream &inp) str >> space_format_string >> std::ws >> format_string >> space_format_version >> std::ws >> version; - if (!str || !str.eof() || + if (/*!str || !str.eof() ||*/ !std::isspace(space_format_string) || !std::isspace(space_format_version)) { return false; @@ -749,7 +749,7 @@ bool MeshInput::LoadPLY (std::istream &inp) str >> space_element_name >> std::ws >> name >> space_name_count >> std::ws >> count; - if (!str || !str.eof() || + if (/*!str || !str.eof() ||*/ !std::isspace(space_element_name) || !std::isspace(space_name_count)) { return false; diff --git a/src/Mod/Mesh/App/Core/Simplify.h b/src/Mod/Mesh/App/Core/Simplify.h index d2a929b46606..d96a582fbbab 100644 --- a/src/Mod/Mesh/App/Core/Simplify.h +++ b/src/Mod/Mesh/App/Core/Simplify.h @@ -13,7 +13,9 @@ #include #include +#ifndef _USE_MATH_DEFINES #define _USE_MATH_DEFINES +#endif typedef Base::Vector3f vec3f; diff --git a/src/Mod/Mesh/App/Core/Smoothing.cpp b/src/Mod/Mesh/App/Core/Smoothing.cpp index 55f6b580190a..5dcc3f119ea6 100644 --- a/src/Mod/Mesh/App/Core/Smoothing.cpp +++ b/src/Mod/Mesh/App/Core/Smoothing.cpp @@ -88,7 +88,7 @@ void PlaneFitSmoothing::Smooth(unsigned int iterations) center += v_beg[*cv_it]; } - float scale = 1.0f/((float)cv.size()+1.0f); + float scale = 1.0f/(static_cast(cv.size())+1.0f); center.Scale(scale,scale,scale); // get the mean plane of the current vertex with the surrounding vertices @@ -98,11 +98,11 @@ void PlaneFitSmoothing::Smooth(unsigned int iterations) // look in which direction we should move the vertex L.Set(v_it->x - center.x, v_it->y - center.y, v_it->z - center.z); - if (N*L < 0.0) + if (N*L < 0.0f) N.Scale(-1.0, -1.0, -1.0); // maximum value to move is distance to mean plane - float d = std::min((float)fabs(this->tolerance),(float)fabs(N*L)); + float d = std::min(fabs(this->tolerance),fabs(N*L)); N.Scale(d,d,d); PointArray[v_it.Position()].Set(v_it->x - N.x, v_it->y - N.y, v_it->z - N.z); @@ -142,7 +142,7 @@ void PlaneFitSmoothing::SmoothPoints(unsigned int iterations, const std::vector< center += v_beg[*cv_it]; } - float scale = 1.0f/((float)cv.size()+1.0f); + float scale = 1.0f/(static_cast(cv.size())+1.0f); center.Scale(scale,scale,scale); // get the mean plane of the current vertex with the surrounding vertices @@ -152,11 +152,11 @@ void PlaneFitSmoothing::SmoothPoints(unsigned int iterations, const std::vector< // look in which direction we should move the vertex L.Set(v_it->x - center.x, v_it->y - center.y, v_it->z - center.z); - if (N*L < 0.0) + if (N*L < 0.0f) N.Scale(-1.0, -1.0, -1.0); // maximum value to move is distance to mean plane - float d = std::min((float)fabs(this->tolerance),(float)fabs(N*L)); + float d = std::min(fabs(this->tolerance),fabs(N*L)); N.Scale(d,d,d); PointArray[v_it.Position()].Set(v_it->x - N.x, v_it->y - N.y, v_it->z - N.z); @@ -196,21 +196,21 @@ void LaplaceSmoothing::Umbrella(const MeshRefPointToPoints& vv_it, continue; } - unsigned int n_count = cv.size(); + size_t n_count = cv.size(); double w; w=1.0/double(n_count); double delx=0.0,dely=0.0,delz=0.0; std::set::const_iterator cv_it; for (cv_it = cv.begin(); cv_it !=cv.end(); ++cv_it) { - delx += w*((v_beg[*cv_it]).x-v_it->x); - dely += w*((v_beg[*cv_it]).y-v_it->y); - delz += w*((v_beg[*cv_it]).z-v_it->z); + delx += w*static_cast((v_beg[*cv_it]).x-v_it->x); + dely += w*static_cast((v_beg[*cv_it]).y-v_it->y); + delz += w*static_cast((v_beg[*cv_it]).z-v_it->z); } - float x = (float)(v_it->x+stepsize*delx); - float y = (float)(v_it->y+stepsize*dely); - float z = (float)(v_it->z+stepsize*delz); + float x = static_cast(static_cast(v_it->x)+stepsize*delx); + float y = static_cast(static_cast(v_it->y)+stepsize*dely); + float z = static_cast(static_cast(v_it->z)+stepsize*delz); kernel.SetPoint(pos,x,y,z); } } @@ -231,21 +231,21 @@ void LaplaceSmoothing::Umbrella(const MeshRefPointToPoints& vv_it, continue; } - unsigned int n_count = cv.size(); + size_t n_count = cv.size(); double w; w=1.0/double(n_count); double delx=0.0,dely=0.0,delz=0.0; std::set::const_iterator cv_it; for (cv_it = cv.begin(); cv_it !=cv.end(); ++cv_it) { - delx += w*((v_beg[*cv_it]).x-(v_beg[*pos]).x); - dely += w*((v_beg[*cv_it]).y-(v_beg[*pos]).y); - delz += w*((v_beg[*cv_it]).z-(v_beg[*pos]).z); + delx += w*static_cast((v_beg[*cv_it]).x-(v_beg[*pos]).x); + dely += w*static_cast((v_beg[*cv_it]).y-(v_beg[*pos]).y); + delz += w*static_cast((v_beg[*cv_it]).z-(v_beg[*pos]).z); } - float x = (float)((v_beg[*pos]).x+stepsize*delx); - float y = (float)((v_beg[*pos]).y+stepsize*dely); - float z = (float)((v_beg[*pos]).z+stepsize*delz); + float x = static_cast(static_cast((v_beg[*pos]).x)+stepsize*delx); + float y = static_cast(static_cast((v_beg[*pos]).y)+stepsize*dely); + float z = static_cast(static_cast((v_beg[*pos]).z)+stepsize*delz); kernel.SetPoint(*pos,x,y,z); } } diff --git a/src/Mod/Mesh/App/Core/Tools.cpp b/src/Mod/Mesh/App/Core/Tools.cpp index 77a8d1b89329..eb1d21243470 100644 --- a/src/Mod/Mesh/App/Core/Tools.cpp +++ b/src/Mod/Mesh/App/Core/Tools.cpp @@ -120,7 +120,7 @@ unsigned long MeshSearchNeighbours::NeighboursFromFacet (unsigned long ulFacetId // copy points in result container raclResultPoints.resize(_aclResult.size()); - int i = 0; + size_t i = 0; for (std::set::iterator pI = _aclResult.begin(); pI != _aclResult.end(); ++pI, i++) raclResultPoints[i] = _rclPAry[*pI]; @@ -140,7 +140,7 @@ void MeshSearchNeighbours::SampleAllFacets (void) _aclSampledFacets.resize(_rclMesh.CountFacets()); MeshFacetIterator clFIter(_rclMesh); - int i = 0; + size_t i = 0; for (clFIter.Init(); clFIter.More(); clFIter.Next(), i++) { std::vector clPoints; clFIter->SubSample(_fSampleDistance, clPoints); @@ -322,7 +322,7 @@ unsigned long MeshSearchNeighbours::NeighboursFacetFromFacet (unsigned long ulFa // copy points in result container raclResultPoints.resize(_aclResult.size()); - int i = 0; + size_t i = 0; for (std::set::iterator pI = _aclResult.begin(); pI != _aclResult.end(); ++pI, i++) raclResultPoints[i] = _rclPAry[*pI]; diff --git a/src/Mod/Mesh/App/Core/Triangulation.cpp b/src/Mod/Mesh/App/Core/Triangulation.cpp index cdd5ed0a9e13..774845e102d4 100644 --- a/src/Mod/Mesh/App/Core/Triangulation.cpp +++ b/src/Mod/Mesh/App/Core/Triangulation.cpp @@ -143,7 +143,7 @@ Base::Matrix4D AbstractPolygonTriangulator::GetTransformToFitPlane() const for (std::vector::const_iterator it = _points.begin(); it!=_points.end(); ++it) planeFit.AddPoint(*it); - if (planeFit.Fit() == FLOAT_MAX) + if (planeFit.Fit() >= FLOAT_MAX) throw Base::RuntimeError("Plane fit failed"); Base::Vector3f bs = planeFit.GetBase(); diff --git a/src/Mod/Mesh/Gui/PreCompiled.h b/src/Mod/Mesh/Gui/PreCompiled.h index 3ffe1f2d5524..b317cfee8124 100644 --- a/src/Mod/Mesh/Gui/PreCompiled.h +++ b/src/Mod/Mesh/Gui/PreCompiled.h @@ -86,7 +86,7 @@ #elif defined(FC_OS_WIN32) #define NOMINMAX -#include +#include #endif //_PreComp_ #endif // MESHGUI_PRECOMPILED_H diff --git a/src/Mod/Mesh/Gui/SoFCIndexedFaceSet.cpp b/src/Mod/Mesh/Gui/SoFCIndexedFaceSet.cpp index 11e262c808d3..325cabc3d36e 100644 --- a/src/Mod/Mesh/Gui/SoFCIndexedFaceSet.cpp +++ b/src/Mod/Mesh/Gui/SoFCIndexedFaceSet.cpp @@ -415,7 +415,7 @@ bool MeshRenderer::shouldRenderDirectly(bool direct) // ---------------------------------------------------------------------------- -SO_ENGINE_SOURCE(SoFCMaterialEngine); +SO_ENGINE_SOURCE(SoFCMaterialEngine) SoFCMaterialEngine::SoFCMaterialEngine() { @@ -446,7 +446,7 @@ void SoFCMaterialEngine::evaluate() // ---------------------------------------------------------------------------- -SO_NODE_SOURCE(SoFCIndexedFaceSet); +SO_NODE_SOURCE(SoFCIndexedFaceSet) void SoFCIndexedFaceSet::initClass() { diff --git a/src/Mod/Mesh/Gui/SoPolygon.cpp b/src/Mod/Mesh/Gui/SoPolygon.cpp index 00fbe767cf94..52de0adeb924 100644 --- a/src/Mod/Mesh/Gui/SoPolygon.cpp +++ b/src/Mod/Mesh/Gui/SoPolygon.cpp @@ -25,7 +25,7 @@ #ifndef _PreComp_ # ifdef FC_OS_WIN32 -# include +# include # endif # ifdef FC_OS_MACOSX # include @@ -55,7 +55,7 @@ using namespace MeshGui; -SO_NODE_SOURCE(SoPolygon); +SO_NODE_SOURCE(SoPolygon) void SoPolygon::initClass() { diff --git a/src/Mod/Mesh/Gui/SoPolygon.h b/src/Mod/Mesh/Gui/SoPolygon.h index 3df9d3a27db4..df418c200a9b 100644 --- a/src/Mod/Mesh/Gui/SoPolygon.h +++ b/src/Mod/Mesh/Gui/SoPolygon.h @@ -48,7 +48,7 @@ class MeshGuiExport SoPolygon : public SoShape { SoSFBool render; protected: - virtual ~SoPolygon() {}; + virtual ~SoPolygon() {} virtual void GLRender(SoGLRenderAction *action); virtual void computeBBox(SoAction *action, SbBox3f &box, SbVec3f ¢er); virtual void rayPick (SoRayPickAction *action);