diff --git a/src/Mod/Mesh/App/AppMeshPy.cpp b/src/Mod/Mesh/App/AppMeshPy.cpp index 889d2ed3ad..9c0fe83c9c 100644 --- a/src/Mod/Mesh/App/AppMeshPy.cpp +++ b/src/Mod/Mesh/App/AppMeshPy.cpp @@ -341,7 +341,7 @@ private: if (!PyArg_ParseTuple(args.ptr(), "|fff",&x,&y,&z)) throw Py::Exception(); - if (y==0) + if (y==0) y=x; float hx = x/2.0f; diff --git a/src/Mod/Mesh/App/Core/Algorithm.h b/src/Mod/Mesh/App/Core/Algorithm.h index 8298cb612e..9a5f07dbcc 100644 --- a/src/Mod/Mesh/App/Core/Algorithm.h +++ b/src/Mod/Mesh/App/Core/Algorithm.h @@ -118,7 +118,7 @@ public: */ bool FirstFacetToVertex(const Base::Vector3f &rclPt, float fMaxDistance, const MeshFacetGrid &rclGrid, FacetIndex &rulFacet) const; /** - * Checks from the viewpoint \a rcView if the vertex \a rcVertex is visible or it is hidden by a facet. + * Checks from the viewpoint \a rcView if the vertex \a rcVertex is visible or it is hidden by a facet. * If the vertex is visible true is returned, false otherwise. */ bool IsVertexVisible (const Base::Vector3f &rcVertex, const Base::Vector3f &rcView, const MeshFacetGrid &rclGrid ) const; @@ -152,7 +152,7 @@ public: */ void GetFacetBorders (const std::vector &raulInd, std::list > &rclBorders) const; /** - * Returns all boundaries of a subset the mesh defined by \a raulInd. This method does basically the same as above unless + * Returns all boundaries of a subset the mesh defined by \a raulInd. This method does basically the same as above unless * that it returns the point indices of the boundaries. * If \a ignoreOrientation is false (the default) we may get a broken boundary curve if the mesh has facets * with wrong orientation. However, if \a ignoreOrientation is true we may get a boundary curve with wrong @@ -184,15 +184,15 @@ public: * If the boundary is not a hole or the algorithm failed false is returned, otherwise true. * @note \a boundary contains the point indices of the mesh data structure. The first and last index must therefore be equal. * @note \a rPoints contains the geometric points of the triangulation. The number of points can be the same as or exceed - * the number of boundary indices but it cannot be lower. - * @note If the number of geometric points exceeds the number of boundary indices then the triangulation algorithm has + * the number of boundary indices but it cannot be lower. + * @note If the number of geometric points exceeds the number of boundary indices then the triangulation algorithm has * introduced new points which are added to the end of \a rPoints. */ bool FillupHole(const std::vector& boundary, AbstractPolygonTriangulator& cTria, MeshFacetArray& rFaces, MeshPointArray& rPoints, int level, const MeshRefPointToFacets* pP2FStructure=nullptr) const; - /** Sets to all facets in \a raulInds the properties in raulProps. + /** Sets to all facets in \a raulInds the properties in raulProps. * \note Both arrays must have the same size. */ void SetFacetsProperty(const std::vector &raulInds, const std::vector &raulProps) const; @@ -234,7 +234,7 @@ public: * Does basically the same as method above except it uses a mesh grid to speed up the computation. */ void GetFacetsFromToolMesh( const MeshKernel& rToolMesh, const Base::Vector3f& rcDir, const MeshFacetGrid& rGrid, std::vector &raclCutted ) const; - /** + /** * Checks whether the bounding box \a rBox is surrounded by the attached mesh which must be a solid. * The direction \a rcDir is used to try to foraminate the facets of the tool mesh and counts the number of foraminated facets. * 1 is returned if the box is completely inside the mesh @@ -259,7 +259,7 @@ public: /** * Determines all facets of the given array \a raclFacetIndices that lie at the edge or that * have at least neighbour facet that is not inside the array. The resulting array \a raclResultIndices - * is not be deleted before the algorithm starts. \a usLevel indicates how often the algorithm is + * is not be deleted before the algorithm starts. \a usLevel indicates how often the algorithm is * repeated. */ void CheckBorderFacets (const std::vector &raclFacetIndices, @@ -288,7 +288,7 @@ public: /** Returns only the points of the mesh without actually sampling the data. */ void SubSampleAllPoints(std::vector &rclPoints) const; /** - * Searches for all facets that intersect the "search tube" with radius \a r around the polyline. + * Searches for all facets that intersect the "search tube" with radius \a r around the polyline. */ void SearchFacetsFromPolyline (const std::vector &rclPolyline, float fRadius, const MeshFacetGrid& rclGrid, std::vector &rclResultFacetsIndices) const; @@ -303,11 +303,11 @@ public: /** Cuts the mesh with a plane. The result is a list of polylines. */ bool CutWithPlane (const Base::Vector3f &clBase, const Base::Vector3f &clNormal, const MeshFacetGrid &rclGrid, std::list > &rclResult, float fMinEps = 1.0e-2f, bool bConnectPolygons = false) const; - /** - * Gets all facets that cut the plane (N,d) and that lie between the two points left and right. + /** + * Gets all facets that cut the plane (N,d) and that lie between the two points left and right. * The plane is defined by it normalized normal and the signed distance to the origin. */ - void GetFacetsFromPlane (const MeshFacetGrid &rclGrid, const Base::Vector3f& clNormal, float dist, + void GetFacetsFromPlane (const MeshFacetGrid &rclGrid, const Base::Vector3f& clNormal, float dist, const Base::Vector3f &rclLeft, const Base::Vector3f &rclRight, std::vector &rclRes) const; /** Returns true if the distance from the \a rclPt to the facet \a ulFacetIdx is less than \a fMaxDistance. @@ -319,7 +319,7 @@ public: * built up. The minimum grid length must be at least \a fLength. */ float CalculateMinimumGridLength(float fLength, const Base::BoundBox3f& rBBox, unsigned long maxElements) const; - + protected: /** Helper method to connect the intersection points to polylines. */ bool ConnectLines (std::list > &rclLines, std::list >&rclPolylines, @@ -329,7 +329,7 @@ protected: /** Searches the nearest facet in \a raulFacets to the ray (\a rclPt, \a rclDir). */ bool RayNearestField (const Base::Vector3f &rclPt, const Base::Vector3f &rclDir, const std::vector &raulFacets, Base::Vector3f &rclRes, FacetIndex &rulFacet, float fMaxAngle = Mathf::PI) const; - /** + /** * Splits the boundary \a rBound in several loops and append this loops to the list of borders. */ void SplitBoundaryLoops(const std::vector& rBound, std::list >& aBorders); @@ -422,7 +422,7 @@ protected: }; /** - * The MeshRefFacetToFacets builds up a structure to have access to all facets sharing + * The MeshRefFacetToFacets builds up a structure to have access to all facets sharing * at least one same point. * \note If the underlying mesh kernel gets changed this structure becomes invalid and must * be rebuilt. @@ -451,7 +451,7 @@ protected: }; /** - * The MeshRefPointToPoints builds up a structure to have access to all neighbour points + * The MeshRefPointToPoints builds up a structure to have access to all neighbour points * of a point. Two points are neighbours if there is an edge indexing both points. * \note If the underlying mesh kernel gets changed this structure becomes invalid and must * be rebuilt. @@ -480,7 +480,7 @@ protected: }; /** - * The MeshRefEdgeToFacets builds up a structure to have access to all facets + * The MeshRefEdgeToFacets builds up a structure to have access to all facets * of an edge. On a manifold mesh an edge has one or two facets associated. * \note If the underlying mesh kernel gets changed this structure becomes invalid and must * be rebuilt. @@ -546,6 +546,6 @@ protected: std::vector _norm; }; -} // namespace MeshCore +} // namespace MeshCore -#endif // MESH_ALGORITHM_H +#endif // MESH_ALGORITHM_H diff --git a/src/Mod/Mesh/App/Core/Approximation.h b/src/Mod/Mesh/App/Core/Approximation.h index b295106e71..537f0b9870 100644 --- a/src/Mod/Mesh/App/Core/Approximation.h +++ b/src/Mod/Mesh/App/Core/Approximation.h @@ -60,12 +60,12 @@ public: // the function virtual Real F (const Vector3& rkP) const - { - return ( m_afCoeff[0]*rkP.X()*rkP.X() + - m_afCoeff[1]*rkP.Y()*rkP.Y() + - m_afCoeff[2]*rkP.X() + - m_afCoeff[3]*rkP.Y() + - m_afCoeff[4]*rkP.X()*rkP.Y() + + { + return ( m_afCoeff[0]*rkP.X()*rkP.X() + + m_afCoeff[1]*rkP.Y()*rkP.Y() + + m_afCoeff[2]*rkP.X() + + m_afCoeff[3]*rkP.Y() + + m_afCoeff[4]*rkP.X()*rkP.Y() + m_afCoeff[5]-rkP.Z()) ; } @@ -158,7 +158,7 @@ public: */ float GetLastResult() const; /** - * Pure virtual function to fit the geometry to the given points. This function + * Pure virtual function to fit the geometry to the given points. This function * must be implemented by every subclass. */ virtual float Fit() = 0; @@ -208,10 +208,10 @@ public: * to succeed. If the fit fails FLOAT_MAX is returned. */ float Fit() override; - /** + /** * Returns the distance from the point \a rcPoint to the fitted plane. If Fit() has not been * called FLOAT_MAX is returned. - */ + */ float GetDistanceToPlane(const Base::Vector3f &rcPoint) const; /** * Returns the standard deviation from the points to the fitted plane. If Fit() has not been @@ -255,9 +255,9 @@ protected: /** * Approximation of a quadratic surface into a given set of points. The implicit form of the surface - * is defined by F(x,y,z) = a * x^2 + b * y^2 + c * z^2 + + * is defined by F(x,y,z) = a * x^2 + b * y^2 + c * z^2 + * 2d * x * y + 2e * x * z + 2f * y * z + - * g * x + h * y + * i * z + k + * g * x + h * y + * i * z + k * = 0 * Depending on the parameters (a,..,k) this surface defines a sphere, ellipsoid, cylinder, cone * and so on. @@ -518,7 +518,7 @@ public: * of the WildMagic library */ ~FunctionContainer(){ delete pImplSurf; } - /** + /** * Access to the quadric coefficients * @param idx Index to coefficient * @return double& coefficient @@ -537,7 +537,7 @@ public: * @param dDistance Gives distances from the point to the quadric. * @return bool Success = true, otherwise false */ - bool CurvatureInfo(double x, double y, double z, + bool CurvatureInfo(double x, double y, double z, double &rfCurv0, double &rfCurv1, Wm4::Vector3 &rkDir0, Wm4::Vector3 &rkDir1, double &dDistance) { @@ -569,7 +569,7 @@ public: double dQuot = Fz(x,y,z); double zx = - ( Fx(x,y,z) / dQuot ); double zy = - ( Fy(x,y,z) / 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; @@ -587,59 +587,59 @@ public: } //+++++++++ Quadric +++++++++++++++++++++++++++++++++++++++ - double F ( double x, double y, double z ) + double F ( double x, double y, double z ) { return (dKoeff[0] + dKoeff[1]*x + dKoeff[2]*y + dKoeff[3]*z + dKoeff[4]*x*x + dKoeff[5]*y*y + dKoeff[6]*z*z + dKoeff[7]*x*y + dKoeff[8]*x*z + dKoeff[9]*y*z); } - + //+++++++++ 1. derivations ++++++++++++++++++++++++++++++++ double Fx ( double x, double y, double z ) { return( dKoeff[1] + 2.0*dKoeff[4]*x + dKoeff[7]*y + dKoeff[8]*z ); } - double Fy ( double x, double y, double z ) + double Fy ( double x, double y, double z ) { return( dKoeff[2] + 2.0*dKoeff[5]*y + dKoeff[7]*x + dKoeff[9]*z ); } - double Fz ( double x, double y, double z ) + double Fz ( double x, double y, double z ) { return( dKoeff[3] + 2.0*dKoeff[6]*z + dKoeff[8]*x + dKoeff[9]*y ); } //+++++++++ 2. derivations ++++++++++++++++++++++++++++++++ - double Fxx( double x, double y, double z ) + double Fxx( double x, double y, double z ) { (void)x; (void)y; (void)z; return( 2.0*dKoeff[4] ); } - double Fxy( double x, double y, double z ) + double Fxy( double x, double y, double z ) { (void)x; (void)y; (void)z; return( dKoeff[7] ); } - double Fxz( double x, double y, double z ) + double Fxz( double x, double y, double z ) { (void)x; (void)y; (void)z; return( dKoeff[8] ); } - double Fyy( double x, double y, double z ) + double Fyy( double x, double y, double z ) { (void)x; (void)y; (void)z; return( 2.0*dKoeff[5] ); } - double Fyz( double x, double y, double z ) + double Fyz( double x, double y, double z ) { (void)x; (void)y; (void)z; return( dKoeff[9] ); } - double Fzz( double x, double y, double z ) + double Fzz( double x, double y, double z ) { (void)x; (void)y; (void)z; return( 2.0*dKoeff[6] ); } - + protected: double dKoeff[ 10 ]; /**< Coefficients of quadric */ Wm4::ImplicitSurface *pImplSurf; /**< Access to the WildMagic library */ diff --git a/src/Mod/Mesh/App/Core/Builder.cpp b/src/Mod/Mesh/App/Core/Builder.cpp index 814b91236b..7ef68e4fbd 100644 --- a/src/Mod/Mesh/App/Core/Builder.cpp +++ b/src/Mod/Mesh/App/Core/Builder.cpp @@ -60,11 +60,11 @@ void MeshBuilder::Initialize (size_t ctFacets, bool deletion) { // Clear the mesh structure and free all memory _meshKernel.Clear(); - + // Allocate new memory that is needed later on. If AddFacet() gets called exactly ctFacets times there is no wastage of memory // otherwise the vector reallocates ~50% of its future memory usage. // Note: A feature of the std::vector implementation is that it can hold more memory (capacity) than it actually needs (size). - // This usually happens if its elements are added without specifying its final size. Later on it's a bit tricky to free the wasted + // This usually happens if its elements are added without specifying its final size. Later on it's a bit tricky to free the wasted // memory. So we're strived to avoid the wastage of memory. _meshKernel._aclFacetArray.reserve(ctFacets); diff --git a/src/Mod/Mesh/App/Core/Builder.h b/src/Mod/Mesh/App/Core/Builder.h index fc8b3aeb6e..6aec23a7e9 100644 --- a/src/Mod/Mesh/App/Core/Builder.h +++ b/src/Mod/Mesh/App/Core/Builder.h @@ -41,7 +41,7 @@ class MeshGeomFacet; /** * Class for creating the mesh structure by adding facets. Building the structure needs 3 steps: - * 1. initializing + * 1. initializing * 2. adding the facets * 3. finishing * \code @@ -110,7 +110,7 @@ private: size_t _ptIdx; void SetNeighbourhood (); - // As it's forbidden to insert a degenerated facet but insert its vertices anyway we must remove them + // As it's forbidden to insert a degenerated facet but insert its vertices anyway we must remove them void RemoveUnreferencedPoints(); public: @@ -122,8 +122,8 @@ public: */ void SetTolerance(float); - /** Initializes the class. Must be done before adding facets - * @param ctFacets count of facets. + /** Initializes the class. Must be done before adding facets + * @param ctFacets count of facets. * @param deletion if true (default) the mesh-kernel will be cleared * otherwise you can add new facets on an existing mesh-kernel * @remarks To be efficient you should add exactly \a ctFacets with @@ -168,7 +168,7 @@ private: /** * Class for creating the mesh structure by adding facets. Building the structure needs 3 steps: - * 1. initializing + * 1. initializing * 2. adding the facets * 3. finishing * \code @@ -193,7 +193,7 @@ public: explicit MeshFastBuilder(MeshKernel &rclM); ~MeshFastBuilder(); - /** Initializes the class. Must be done before adding facets + /** Initializes the class. Must be done before adding facets * @param ctFacets count of facets. */ void Initialize (size_type ctFacets); @@ -215,4 +215,4 @@ private: } // namespace MeshCore -#endif +#endif diff --git a/src/Mod/Mesh/App/Core/CylinderFit.h b/src/Mod/Mesh/App/Core/CylinderFit.h index b10c2471fb..1a7fb895bd 100644 --- a/src/Mod/Mesh/App/Core/CylinderFit.h +++ b/src/Mod/Mesh/App/Core/CylinderFit.h @@ -33,7 +33,7 @@ namespace MeshCoreFit { using Matrix5x5 = Eigen::Matrix; /** - * Best-fit cylinder for a given set of points. + * Best-fit cylinder for a given set of points. * Doesn't expect points on any top or bottom end-planes, only points on the side surface */ class MeshExport CylinderFit : public MeshCore::Approximation diff --git a/src/Mod/Mesh/App/Core/Definitions.h b/src/Mod/Mesh/App/Core/Definitions.h index 645b745fd2..7ea30444c1 100644 --- a/src/Mod/Mesh/App/Core/Definitions.h +++ b/src/Mod/Mesh/App/Core/Definitions.h @@ -40,7 +40,7 @@ /* * general constant definitions */ -#define FLOAT_EPS 1.0e-4f +#define FLOAT_EPS 1.0e-4f #ifndef FLOAT_MAX # define FLOAT_MAX 1e30f @@ -99,4 +99,4 @@ public: } // namespace MeshCore -#endif // MESH_DEFINITIONS_H +#endif // MESH_DEFINITIONS_H diff --git a/src/Mod/Mesh/App/Core/Degeneration.cpp b/src/Mod/Mesh/App/Core/Degeneration.cpp index 09106a50bc..acf787655e 100644 --- a/src/Mod/Mesh/App/Core/Degeneration.cpp +++ b/src/Mod/Mesh/App/Core/Degeneration.cpp @@ -222,7 +222,7 @@ bool MeshFixDuplicatePoints::Fixup() // remove invalid indices _rclMesh.DeletePoints(pointIndices); _rclMesh.RebuildNeighbours(); - + return true; } @@ -263,7 +263,7 @@ bool MeshFixNaNPoints::Fixup() // remove invalid indices _rclMesh.DeletePoints(aInds); _rclMesh.RebuildNeighbours(); - + return true; } @@ -277,7 +277,7 @@ using FaceIterator = MeshFacetArray::_TConstIterator; */ struct MeshFacet_Less { - bool operator()(const FaceIterator& x, + bool operator()(const FaceIterator& x, const FaceIterator& y) const { PointIndex tmp; @@ -329,7 +329,7 @@ struct MeshFacet_EqualTo { for (int i=0; i<3; i++ ) { if (x->_aulPoints[0] == y->_aulPoints[i]) { - if (x->_aulPoints[1] == y->_aulPoints[(i+1)%3] && + if (x->_aulPoints[1] == y->_aulPoints[(i+1)%3] && x->_aulPoints[2] == y->_aulPoints[(i+2)%3]) return true; else if (x->_aulPoints[1] == y->_aulPoints[(i+2)%3] && diff --git a/src/Mod/Mesh/App/Core/Elements.cpp b/src/Mod/Mesh/App/Core/Elements.cpp index f3580aeb28..0c60df21da 100644 --- a/src/Mod/Mesh/App/Core/Elements.cpp +++ b/src/Mod/Mesh/App/Core/Elements.cpp @@ -135,7 +135,7 @@ void MeshFacetArray::TransposeIndices (PointIndex ulOrig, PointIndex ulNew) while (pIter < pEnd) { pIter->Transpose(ulOrig, ulNew); - ++pIter; + ++pIter; } } @@ -146,7 +146,7 @@ void MeshFacetArray::DecrementIndices (PointIndex ulIndex) while (pIter < pEnd) { pIter->Decrement(ulIndex); - ++pIter; + ++pIter; } } @@ -453,16 +453,16 @@ bool MeshGeomEdge::IsProjectionPointOf(const Base::Vector3f& point) const // ----------------------------------------------------------------- -MeshGeomFacet::MeshGeomFacet () +MeshGeomFacet::MeshGeomFacet () : _bNormalCalculated(false), _ucFlag(0), _ulProp(0) -{ +{ } MeshGeomFacet::MeshGeomFacet (const Base::Vector3f &v1,const Base::Vector3f &v2,const Base::Vector3f &v3) - : _bNormalCalculated(false), + : _bNormalCalculated(false), _ucFlag(0), _ulProp(0) { @@ -486,10 +486,10 @@ bool MeshGeomFacet::IsPointOf (const Base::Vector3f &rclPoint, float fDistance) clNorm.Normalize(); clProjPt.ProjectToPlane(_aclPoints[0], clNorm); - + // Edge P0 --> P1 clEdge = clP1 - clP0; - fLP = clProjPt.DistanceToLine(clP0, clEdge); + fLP = clProjPt.DistanceToLine(clP0, clEdge); if (fLP > 0.0f) { fLE = clP2.DistanceToLine(clP0, clEdge); @@ -504,13 +504,13 @@ bool MeshGeomFacet::IsPointOf (const Base::Vector3f &rclPoint, float fDistance) // Edge P0 --> P2 clEdge = clP2 - clP0; - fLP = clProjPt.DistanceToLine(clP0, clEdge); + fLP = clProjPt.DistanceToLine(clP0, clEdge); if (fLP > 0.0f) { fLE = clP1.DistanceToLine(clP0, clEdge); if (fLP <= fLE) { - if (clProjPt.DistanceToLine(clP1, clEdge) > fLE) + if (clProjPt.DistanceToLine(clP1, clEdge) > fLE) return false; } else @@ -519,18 +519,18 @@ bool MeshGeomFacet::IsPointOf (const Base::Vector3f &rclPoint, float fDistance) // Edge P1 --> P2 clEdge = clP2 - clP1; - fLP = clProjPt.DistanceToLine(clP1, clEdge); + fLP = clProjPt.DistanceToLine(clP1, clEdge); if (fLP > 0.0f) { fLE = clP0.DistanceToLine(clP1, clEdge); if (fLP <= fLE) { - if (clProjPt.DistanceToLine(clP0, clEdge) > fLE) + if (clProjPt.DistanceToLine(clP0, clEdge) > fLE) return false; } else return false; - } + } return true; } @@ -625,7 +625,7 @@ bool MeshGeomFacet::IsDegenerated(float epsilon) const // The triangle has the points A,B,C where we can define the vector u and v // u = b-a and v = c-a. Then we define the line g: r = a+t*u and the plane // E: (x-c)*u=0. The intersection point of g and E is S. - // The vector to S can be computed with a+(uv)/(uu)*u. The difference of + // The vector to S can be computed with a+(uv)/(uu)*u. The difference of // C and S then is v-(u*v)/(u*u)*u. The square distance leads to the formula // (v-(u*v)/(u*u)*u)^2 < eps which means that C and S is considered equal if // the square distance is less than an epsilon and thus the triangle is de- @@ -911,7 +911,7 @@ bool MeshGeomFacet::IntersectPlaneWithLine (const Base::Vector3f &rclPt, const B if ( fabs(rclDir * GetNormal()) < 1e-3f ) return false; // line and plane are parallel - float s = ( ( GetGravityPoint() - rclPt ) * GetNormal() ) + float s = ( ( GetGravityPoint() - rclPt ) * GetNormal() ) / ( rclDir * GetNormal() ); rclRes = rclPt + s * rclDir; @@ -959,7 +959,7 @@ float MeshGeomFacet::DistanceToPoint (const Base::Vector3f &rclPt, Base::Vector3 Triangle3 akTria(akF0, akF1, akF2); DistVector3Triangle3 akDistPtTria(akPt, akTria); - + float fDist = akDistPtTria.Get(); // get nearest point of the facet @@ -1003,10 +1003,10 @@ void MeshGeomFacet::SubSample (float fStep, std::vector &rclPoin clVecABNorm.Normalize(); clVecHNorm.Normalize(); - float bx = fLenAB; + float bx = fLenAB; float cy = float(sin(clVecAB.GetAngle(clVecAC)) * fLenAC); float cx = float(sqrt(fabs(fLenAC * fLenAC - cy * cy))); - + float fDetABC = bx*cy; for (float px = (fStep / 2.0f); px < fLenAB; px += fStep) @@ -1024,7 +1024,7 @@ void MeshGeomFacet::SubSample (float fStep, std::vector &rclPoin clPoints.push_back(clV); } - else + else break; } } @@ -1073,8 +1073,8 @@ bool MeshGeomFacet::IntersectWithFacet(const MeshGeomFacet &rclFacet) const * http://www.acm.org/jgt/papers/Moller97/tritri.html * http://www.cs.lth.se/home/Tomas_Akenine_Moller/code/ */ -int MeshGeomFacet::IntersectWithFacet (const MeshGeomFacet& rclFacet, - Base::Vector3f& rclPt0, +int MeshGeomFacet::IntersectWithFacet (const MeshGeomFacet& rclFacet, + Base::Vector3f& rclPt0, Base::Vector3f& rclPt1) const { // Note: tri_tri_intersect_with_isection() does not return line of @@ -1124,7 +1124,7 @@ int MeshGeomFacet::IntersectWithFacet (const MeshGeomFacet& rclFacet, U[i][2] = rclFacet._aclPoints[i].z; } - if (tri_tri_intersect_with_isectline(V[0], V[1], V[2], U[0], U[1], U[2], + if (tri_tri_intersect_with_isectline(V[0], V[1], V[2], U[0], U[1], U[2], &coplanar, isectpt1, isectpt2) == 0) return 0; // no intersections @@ -1214,7 +1214,7 @@ float MeshGeomFacet::CenterOfInscribedCircle(Base::Vector3f& rclCenter) const // radius of the circle float fRadius = Area(); - fRadius *= 2.0f/(a + b + c); + fRadius *= 2.0f/(a + b + c); // center of the circle float w = a + b + c; @@ -1452,7 +1452,7 @@ float MeshGeomFacet::VolumeOfPrism (const MeshGeomFacet& rclF1) const float MeshGeomFacet::MaximumAngle () const { float fMaxAngle = 0.0f; - + for ( int i=0; i<3; i++ ) { Base::Vector3f dir1(_aclPoints[(i+1)%3]-_aclPoints[i]); Base::Vector3f dir2(_aclPoints[(i+2)%3]-_aclPoints[i]); diff --git a/src/Mod/Mesh/App/Core/Evaluation.cpp b/src/Mod/Mesh/App/Core/Evaluation.cpp index 3c97275700..e3e610abbc 100644 --- a/src/Mod/Mesh/App/Core/Evaluation.cpp +++ b/src/Mod/Mesh/App/Core/Evaluation.cpp @@ -109,7 +109,7 @@ MeshSameOrientationCollector::MeshSameOrientationCollector(std::vector_aulPoints[(i+1)%3] == rclFacet._aulPoints[(j+1)%3]) || (it->_aulPoints[(i+2)%3] == rclFacet._aulPoints[(j+2)%3])) { return false; // adjacent face with wrong orientation - } + } } } } @@ -159,7 +159,7 @@ bool MeshEvalOrientation::Evaluate () unsigned long MeshEvalOrientation::HasFalsePositives(const std::vector& inds) const { // All faces with wrong orientation (i.e. adjacent faces with a normal flip and their neighbours) - // build a segment and are marked as TMP0. Now we check all border faces of the segments with + // build a segment and are marked as TMP0. Now we check all border faces of the segments with // their correct neighbours if there was really a normal flip. If there is no normal flip we have // a false positive. // False-positives can occur if the mesh structure has some defects which let the region-grow @@ -519,7 +519,7 @@ bool MeshEvalSingleFacet::Evaluate () (void)MeshEvalTopology::Evaluate(); /* // for each (multiple) single linked facet there should - // exist two valid facets sharing the same edge + // exist two valid facets sharing the same edge // so make facet 1 neighbour of facet 2 and vice versa const std::vector& rclFAry = _rclMesh.GetFacets(); std::vector::const_iterator pI; @@ -557,7 +557,7 @@ bool MeshEvalSingleFacet::Evaluate () { unsigned long ulPt0 = std::min(rclF._aulPoints[i], rclF._aulPoints[(i+1)%3]); unsigned long ulPt1 = std::max(rclF._aulPoints[i], rclF._aulPoints[(i+1)%3]); - std::pair clEdge(ulPt0, ulPt1); + std::pair clEdge(ulPt0, ulPt1); // number of facets sharing this edge ulCtNeighbours += aclHits[clEdge].size(); @@ -587,7 +587,7 @@ bool MeshFixSingleFacet::Fixup () // MeshFacet& rF = raFacets[*it2]; } } - + _rclMesh.DeleteFacets(aulInvalids); return true; } @@ -596,7 +596,7 @@ bool MeshFixSingleFacet::Fixup () bool MeshEvalSelfIntersection::Evaluate () { - // Contains bounding boxes for every facet + // Contains bounding boxes for every facet std::vector boxes; // Splits the mesh using grid for speeding up the calculation @@ -632,19 +632,19 @@ bool MeshEvalSelfIntersection::Evaluate () for (std::vector::iterator jt = it; jt != aulGridElements.end(); ++jt) { if (jt == it) // the identical facet continue; - // If the facets share a common vertex we do not check for self-intersections because they + // If the facets share a common vertex we do not check for self-intersections because they // could but usually do not intersect each other and the algorithm below would detect false-positives, // otherwise const MeshFacet& rface2 = rFaces[*jt]; - if (rface1._aulPoints[0] == rface2._aulPoints[0] || + if (rface1._aulPoints[0] == rface2._aulPoints[0] || rface1._aulPoints[0] == rface2._aulPoints[1] || rface1._aulPoints[0] == rface2._aulPoints[2]) continue; // ignore facets sharing a common vertex - if (rface1._aulPoints[1] == rface2._aulPoints[0] || + if (rface1._aulPoints[1] == rface2._aulPoints[0] || rface1._aulPoints[1] == rface2._aulPoints[1] || rface1._aulPoints[1] == rface2._aulPoints[2]) continue; // ignore facets sharing a common vertex - if (rface1._aulPoints[2] == rface2._aulPoints[0] || + if (rface1._aulPoints[2] == rface2._aulPoints[0] || rface1._aulPoints[2] == rface2._aulPoints[1] || rface1._aulPoints[2] == rface2._aulPoints[2]) continue; // ignore facets sharing a common vertex @@ -692,7 +692,7 @@ void MeshEvalSelfIntersection::GetIntersections(const std::vector >& intersection) const { - // Contains bounding boxes for every facet + // Contains bounding boxes for every facet std::vector boxes; //intersection.clear(); @@ -729,19 +729,19 @@ void MeshEvalSelfIntersection::GetIntersections(std::vector::iterator jt = it; jt != aulGridElements.end(); ++jt) { if (jt == it) // the identical facet continue; - // If the facets share a common vertex we do not check for self-intersections because they + // If the facets share a common vertex we do not check for self-intersections because they // could but usually do not intersect each other and the algorithm below would detect false-positives, // otherwise const MeshFacet& rface2 = rFaces[*jt]; - if (rface1._aulPoints[0] == rface2._aulPoints[0] || + if (rface1._aulPoints[0] == rface2._aulPoints[0] || rface1._aulPoints[0] == rface2._aulPoints[1] || rface1._aulPoints[0] == rface2._aulPoints[2]) continue; // ignore facets sharing a common vertex - if (rface1._aulPoints[1] == rface2._aulPoints[0] || + if (rface1._aulPoints[1] == rface2._aulPoints[0] || rface1._aulPoints[1] == rface2._aulPoints[1] || rface1._aulPoints[1] == rface2._aulPoints[2]) continue; // ignore facets sharing a common vertex - if (rface1._aulPoints[2] == rface2._aulPoints[0] || + if (rface1._aulPoints[2] == rface2._aulPoints[0] || rface1._aulPoints[2] == rface2._aulPoints[1] || rface1._aulPoints[2] == rface2._aulPoints[2]) continue; // ignore facets sharing a common vertex @@ -800,8 +800,8 @@ bool MeshFixSelfIntersection::Fixup() bool MeshEvalNeighbourhood::Evaluate () { - // Note: If more than two facets are attached to the edge then we have a - // non-manifold edge here. + // Note: If more than two facets are attached to the edge then we have a + // non-manifold edge here. // This means that the neighbourhood cannot be valid, for sure. But we just // want to check whether the neighbourhood is valid for topologic correctly // edges and thus we ignore this case. @@ -1049,7 +1049,7 @@ Base::Matrix4D MeshEigensystem::Transform() const // // from local (x) to world (y,c) coordinates we have the equation // y = R * x + c - // <==> + // <==> // x = Q * y - Q * c Base::Matrix4D clTMat; // rotation part @@ -1083,7 +1083,7 @@ bool MeshEigensystem::Evaluate() clProj.ProjectToLine(clVect, _cU); clVect = clVect + clProj; fH = clVect.Length(); - + // point vectors in the same direction ? if ((clVect * _cU) < 0.0f) fH = -fH; @@ -1096,7 +1096,7 @@ bool MeshEigensystem::Evaluate() clProj.ProjectToLine(clVect, _cV); clVect = clVect + clProj; fH = clVect.Length(); - + // point vectors in the same direction ? if ((clVect * _cV) < 0.0f) fH = -fH; @@ -1109,7 +1109,7 @@ bool MeshEigensystem::Evaluate() clProj.ProjectToLine(clVect, _cW); clVect = clVect + clProj; fH = clVect.Length(); - + // point vectors in the same direction ? if ((clVect * _cW) < 0.0f) fH = -fH; diff --git a/src/Mod/Mesh/App/Core/Evaluation.h b/src/Mod/Mesh/App/Core/Evaluation.h index 15327e631c..ef69b19ea1 100644 --- a/src/Mod/Mesh/App/Core/Evaluation.h +++ b/src/Mod/Mesh/App/Core/Evaluation.h @@ -38,7 +38,7 @@ namespace MeshCore { * The passed mesh kernel is read-only and cannot be modified. * @see MeshEvalTopology * @see MeshEvalGeometry - * The class itself is abstract, hence the method Evaluate() must be implemented + * The class itself is abstract, hence the method Evaluate() must be implemented * by subclasses. */ class MeshExport MeshEvaluation @@ -48,9 +48,9 @@ public: virtual ~MeshEvaluation () {} /** - * Evaluates the mesh kernel with respect to certain criteria. Must be reimplemented by every + * Evaluates the mesh kernel with respect to certain criteria. Must be reimplemented by every * subclass. This pure virtual function returns false if the mesh kernel is invalid according - * to this criterion and true if the mesh kernel is correct. + * to this criterion and true if the mesh kernel is correct. */ virtual bool Evaluate () = 0; @@ -64,7 +64,7 @@ protected: * The MeshValidation class tries to make a mesh kernel valid with respect to a * certain criterion, such as manifoldness, self-intersections, etc. * The passed mesh kernel can be modified to fix the errors. - * The class itself is abstract, hence the method Fixup() must be implemented + * The class itself is abstract, hence the method Fixup() must be implemented * by subclasses. */ class MeshExport MeshValidation @@ -74,8 +74,8 @@ public: virtual ~MeshValidation () {} /** - * This function attempts to change the mesh kernel to be valid according to the checked - * criterion: True is returned if the errors could be fixed, false otherwise. + * This function attempts to change the mesh kernel to be valid according to the checked + * criterion: True is returned if the errors could be fixed, false otherwise. */ virtual bool Fixup() = 0; @@ -350,7 +350,7 @@ public: * The MeshEigensystem class actually does not try to check for or fix errors but * it provides methods to calculate the mesh's local coordinate system with the center * of gravity as origin. - * The local coordinate system is computed this way that u has minimum and w has maximum + * The local coordinate system is computed this way that u has minimum and w has maximum * expansion. The local coordinate system is right-handed. * @author Werner Mayer */ @@ -368,9 +368,9 @@ public: Base::Vector3f GetBoundings() const; bool Evaluate() override; - /** + /** * Calculates the local coordinate system defined by \a u, \a v, \a w - * and \a c. + * and \a c. */ protected: void CalculateLocalSystem(); diff --git a/src/Mod/Mesh/App/Core/Functional.h b/src/Mod/Mesh/App/Core/Functional.h index f2e5f80522..f40bc907e6 100644 --- a/src/Mod/Mesh/App/Core/Functional.h +++ b/src/Mod/Mesh/App/Core/Functional.h @@ -61,4 +61,4 @@ namespace MeshCore } // namespace MeshCore -#endif // MESH_FUNCTIONAL_H +#endif // MESH_FUNCTIONAL_H diff --git a/src/Mod/Mesh/App/Core/Grid.h b/src/Mod/Mesh/App/Core/Grid.h index 432a518c44..12b6f16c4e 100644 --- a/src/Mod/Mesh/App/Core/Grid.h +++ b/src/Mod/Mesh/App/Core/Grid.h @@ -67,7 +67,7 @@ public: virtual ~MeshGrid () { } public: - /** Attaches the mesh kernel to this grid, an already attached mesh gets detached. The grid gets rebuilt + /** Attaches the mesh kernel to this grid, an already attached mesh gets detached. The grid gets rebuilt * automatically. */ virtual void Attach (const MeshKernel &rclM); /** Rebuilds the grid structure. */ @@ -113,13 +113,13 @@ public: /** Returns an extended bounding box of the mesh object. */ inline Base::BoundBox3f GetMeshBoundBox () const; //@} - /** Returns an index for the given grid position. If the specified triple is not a valid grid position ULONG_MAX is returned. + /** Returns an index for the given grid position. If the specified triple is not a valid grid position ULONG_MAX is returned. * If the index is valid than its value is between zero and the number of grid elements. For each different grid position * a different index is returned. */ unsigned long GetIndexToPosition(unsigned long ulX, unsigned long ulY, unsigned long ulZ) const; /** Returns the grid position to the given index. If the index is equal to or higher than the number of grid elements false is returned - * and the triple is set to ULONG_MAX. + * and the triple is set to ULONG_MAX. */ bool GetPositionToIndex(unsigned long id, unsigned long& ulX, unsigned long& ulY, unsigned long& ulZ) const; /** Returns the number of elements in a given grid. */ @@ -133,7 +133,7 @@ public: * otherwise false is returned and the grid position is undefined. */ bool CheckPosition (const Base::Vector3f &rclPoint, unsigned long &rulX, unsigned long &rulY, unsigned long &rulZ) const; - /** Returns the indices of the grid this point lies in. If the point is outside the grid the indices of + /** Returns the indices of the grid this point lies in. If the point is outside the grid the indices of * the nearest grid element are taken.*/ virtual void Position (const Base::Vector3f &rclPoint, unsigned long &rulX, unsigned long &rulY, unsigned long &rulZ) const; /** Checks if this is a valid grid position. */ @@ -166,7 +166,7 @@ protected: float _fGridLenY; /**< Length of grid elements in y. */ float _fGridLenZ; /**< Length of grid elements in z. */ float _fMinX; /**< Grid null position in x. */ - float _fMinY; /**< Grid null position in y. */ + float _fMinY; /**< Grid null position in y. */ float _fMinZ; /**< Grid null position in z. */ // friends @@ -195,7 +195,7 @@ public: /// Destruction ~MeshFacetGrid () override { } //@} - + /** @name Search */ //@{ /** Searches for the nearest facet from a point. */ @@ -207,7 +207,7 @@ public: float &rfMinDist, ElementIndex &rulFacetInd) const; /** Does basically the same as the method above unless that grid neighbours up to the order of \a ulDistance * are introduced into the search. */ - void SearchNearestFacetInHull (unsigned long ulX, unsigned long ulY, unsigned long ulZ, unsigned long ulDistance, + void SearchNearestFacetInHull (unsigned long ulX, unsigned long ulY, unsigned long ulZ, unsigned long ulDistance, const Base::Vector3f &rclPt, ElementIndex &rulFacetInd, float &rfMinDist) const; //@} @@ -223,8 +223,8 @@ protected: inline void Pos (const Base::Vector3f &rclPoint, unsigned long &rulX, unsigned long &rulY, unsigned long &rulZ) const; /** Returns the grid numbers to the given point \a rclPoint. */ inline void PosWithCheck (const Base::Vector3f &rclPoint, unsigned long &rulX, unsigned long &rulY, unsigned long &rulZ) const; - /** Adds a new facet element to the grid structure. \a rclFacet is the geometric facet and \a ulFacetIndex - * the corresponding index in the mesh kernel. The facet is added to each grid element that intersects + /** Adds a new facet element to the grid structure. \a rclFacet is the geometric facet and \a ulFacetIndex + * the corresponding index in the mesh kernel. The facet is added to each grid element that intersects * the facet. */ inline void AddFacet (const MeshGeomFacet &rclFacet, ElementIndex ulFacetIndex, float fEpsilon = 0.0f); /** Returns the number of stored elements. */ @@ -267,7 +267,7 @@ public: bool Verify() const override; protected: - /** Adds a new point element to the grid structure. \a rclPt is the geometric point and \a ulPtIndex + /** Adds a new point element to the grid structure. \a rclPt is the geometric point and \a ulPtIndex * the corresponding index in the mesh kernel. */ void AddPoint (const MeshPoint &rclPt, ElementIndex ulPtIndex, float fEpsilon = 0.0f); /** Returns the grid numbers to the given point \a rclPoint. */ @@ -306,7 +306,7 @@ public: /** Sets the iterator to the first element*/ void Init () { _ulX = _ulY = _ulZ = 0; } - /** Checks if the iterator has not yet reached the end position. */ + /** Checks if the iterator has not yet reached the end position. */ bool More () const { return (_ulZ < _rclGrid._ulCtGridsZ); } /** Go to the next grid. */ @@ -326,7 +326,7 @@ public: /** Searches for facets around the ray. */ bool NextOnRay (std::vector &raulElements); //@} - + /** Returns the grid number of the current position. */ void GetGridPos (unsigned long &rulX, unsigned long &rulY, unsigned long &rulZ) const { rulX = _ulX; rulY = _ulY; rulZ = _ulZ; } @@ -335,13 +335,13 @@ protected: const MeshGrid& _rclGrid; /**< The mesh kernel. */ unsigned long _ulX; /**< Number of grids in x. */ unsigned long _ulY; /**< Number of grids in y. */ - unsigned long _ulZ; /**< Number of grids in z. */ + unsigned long _ulZ; /**< Number of grids in z. */ Base::Vector3f _clPt; /**< Base point of search ray. */ Base::Vector3f _clDir; /**< Direction of search ray. */ bool _bValidRay; /**< Search ray ok? */ float _fMaxSearchArea; /** Checks if a grid position is already visited by NextOnRay(). */ - struct GridElement + struct GridElement { GridElement( unsigned long x, unsigned long y, unsigned long z) { this->x = x; this->y = y; this->z = z; } @@ -349,7 +349,7 @@ protected: { if ( x == pos.x) { if ( y == pos.y) return z < pos.z; else return y < pos.y; } - else + else { return x < pos.x; } } private: @@ -363,7 +363,7 @@ protected: inline Base::BoundBox3f MeshGrid::GetBoundBox (unsigned long ulX, unsigned long ulY, unsigned long ulZ) const { float fX, fY, fZ; - + fX = _fMinX + (float(ulX) * _fGridLenX); fY = _fMinY + (float(ulY) * _fGridLenY); fZ = _fMinZ + (float(ulZ) * _fGridLenZ); @@ -451,12 +451,12 @@ inline void MeshFacetGrid::AddFacet (const MeshGeomFacet &rclFacet, ElementIndex Pos(Base::Vector3f(clBB.MinX,clBB.MinY,clBB.MinZ), ulX1, ulY1, ulZ1); Pos(Base::Vector3f(clBB.MaxX,clBB.MaxY,clBB.MaxZ), ulX2, ulY2, ulZ2); - + /* if (ulX1 > 0) ulX1--; if (ulY1 > 0) ulY1--; if (ulZ1 > 0) ulZ1--; - + if (ulX2 < (_ulCtGridsX-1)) ulX2++; if (ulY2 < (_ulCtGridsY-1)) ulY2++; if (ulZ2 < (_ulCtGridsZ-1)) ulZ2++; diff --git a/src/Mod/Mesh/App/Core/Helpers.h b/src/Mod/Mesh/App/Core/Helpers.h index e007e12f32..d65781f8da 100644 --- a/src/Mod/Mesh/App/Core/Helpers.h +++ b/src/Mod/Mesh/App/Core/Helpers.h @@ -76,7 +76,7 @@ struct MeshExport MeshHelpBuilderEdge inline bool operator < (const MeshHelpBuilderEdge &rclObj) const; inline bool operator == (const MeshHelpBuilderEdge &rclObj) const; - + inline bool operator != (const MeshHelpBuilderEdge &rclObj) const; @@ -130,12 +130,12 @@ inline void MeshHelpBuilderEdge::Set (PointIndex ulInd1, PointIndex ulInd2, if (ulInd1 < ulInd2) { _aulInd[0] = ulInd1; - _aulInd[1] = ulInd2; + _aulInd[1] = ulInd2; } else { _aulInd[0] = ulInd2; - _aulInd[1] = ulInd1; + _aulInd[1] = ulInd1; } _ulFIndex = (ulFInd << 2) | ulSide; } @@ -169,4 +169,4 @@ inline void MeshEdgeBuilder::Add (PointIndex ulInd1, PointIndex ulInd2, } // namespace MeshCore -#endif // MESH_HELPERS_H +#endif // MESH_HELPERS_H diff --git a/src/Mod/Mesh/App/Core/Info.cpp b/src/Mod/Mesh/App/Core/Info.cpp index 24b2ffd4d0..02577e4f9c 100644 --- a/src/Mod/Mesh/App/Core/Info.cpp +++ b/src/Mod/Mesh/App/Core/Info.cpp @@ -244,7 +244,7 @@ std::ostream& MeshInfo::TopologyInformation (std::ostream& rclStream) const unsigned long index = 0; const MeshFacetArray& rFAry = _rclMesh.GetFacets(); for (MeshFacetArray::_TConstIterator it = rFAry.begin(); it != rFAry.end(); ++it, ++index) { - rclStream << "F " << std::setw(4) << index << ": P (" + rclStream << "F " << std::setw(4) << index << ": P (" << it->_aulPoints[0] << ", " << it->_aulPoints[1] << ", " << it->_aulPoints[2] << "), N (" @@ -252,6 +252,6 @@ std::ostream& MeshInfo::TopologyInformation (std::ostream& rclStream) const << it->_aulNeighbours[1] << ", " << it->_aulNeighbours[2] << ")" << std::endl; } - + return rclStream; } diff --git a/src/Mod/Mesh/App/Core/Iterator.h b/src/Mod/Mesh/App/Core/Iterator.h index d2d79ee31e..eb0fdaa293 100644 --- a/src/Mod/Mesh/App/Core/Iterator.h +++ b/src/Mod/Mesh/App/Core/Iterator.h @@ -179,13 +179,13 @@ public: inline MeshPointIterator (const MeshKernel &rclM, PointIndex ulPos); inline MeshPointIterator (const MeshPointIterator &rclI); //@} - + /** @name Transformation */ //@{ /// Transforms the returned points with the current transformation inline void Transform( const Base::Matrix4D& rclTrf ); //@} - + /** @name Access methods */ //@{ /// Access to the element the iterator points to. @@ -410,7 +410,7 @@ inline void MeshFacetIterator::GetNeighbours (MeshFacetIterator &rclN0, MeshFace } inline void MeshFacetIterator::SetToNeighbour (unsigned short usN) -{ +{ if (_clIter->_aulNeighbours[usN] != FACET_INDEX_MAX) _clIter = _rclFAry.begin() + _clIter->_aulNeighbours[usN]; else @@ -448,7 +448,7 @@ inline const MeshPoint& MeshPointIterator::Dereference () const _clPoint = *_clIter; if ( _bApply ) _clPoint = _clTrf * _clPoint; - return _clPoint; + return _clPoint; } inline bool MeshPointIterator::Set (PointIndex ulIndex) @@ -477,4 +477,4 @@ inline MeshPointIterator& MeshPointIterator::operator = (const MeshPointIterator } // namespace MeshCore -#endif // MESH_ITERATOR_H +#endif // MESH_ITERATOR_H diff --git a/src/Mod/Mesh/App/Core/KDTree.cpp b/src/Mod/Mesh/App/Core/KDTree.cpp index 07da35e920..b957528b63 100644 --- a/src/Mod/Mesh/App/Core/KDTree.cpp +++ b/src/Mod/Mesh/App/Core/KDTree.cpp @@ -33,7 +33,7 @@ using namespace MeshCore; -struct Point3d +struct Point3d { using value_type = float; @@ -181,7 +181,7 @@ PointIndex MeshKDTree::FindNearest(const Base::Vector3f& p, float max_dist, PointIndex MeshKDTree::FindExact(const Base::Vector3f& p) const { - MyKDTree::const_iterator it = + MyKDTree::const_iterator it = d->kd_tree.find_exact(Point3d(p,0)); if (it == d->kd_tree.end()) return POINT_INDEX_MAX; diff --git a/src/Mod/Mesh/App/Core/KDTree.h b/src/Mod/Mesh/App/Core/KDTree.h index cf78a00a6f..0cc54bc95d 100644 --- a/src/Mod/Mesh/App/Core/KDTree.h +++ b/src/Mod/Mesh/App/Core/KDTree.h @@ -62,4 +62,4 @@ private: } // namespace MeshCore -#endif // MESH_KDTREE_H +#endif // MESH_KDTREE_H diff --git a/src/Mod/Mesh/App/Core/MeshKernel.cpp b/src/Mod/Mesh/App/Core/MeshKernel.cpp index d502028855..de6b80b2a1 100644 --- a/src/Mod/Mesh/App/Core/MeshKernel.cpp +++ b/src/Mod/Mesh/App/Core/MeshKernel.cpp @@ -165,7 +165,7 @@ MeshKernel& MeshKernel::operator += (const std::vector &rclFAry) void MeshKernel::AddFacets(const std::vector &rclFAry) { // Create a temp. kernel to get the topology of the passed triangles - // and merge them with this kernel. This keeps properties and flags + // and merge them with this kernel. This keeps properties and flags // of this mesh. MeshKernel tmp; tmp = rclFAry; @@ -297,7 +297,7 @@ unsigned long MeshKernel::AddFacets(const std::vector &rclFAry, } else if (pE->second.size() == 2) // normal facet with neighbour { - // we must check if both facets are part of the mesh now + // we must check if both facets are part of the mesh now FacetIndex ulF0 = pE->second.front(); if (ulF0 >= countFacets) { ulF0 -= countFacets; @@ -316,7 +316,7 @@ unsigned long MeshKernel::AddFacets(const std::vector &rclFAry, else ulF1 = FACET_INDEX_MAX; } - + if (ulF0 != FACET_INDEX_MAX) { unsigned short usSide = _aclFacetArray[ulF0].Side(ulP0, ulP1); assert(usSide != USHRT_MAX); @@ -381,7 +381,7 @@ void MeshKernel::Merge(const MeshPointArray& rPoints, const MeshFacetArray& rFac // Reserve the additional memory to append the new points PointIndex index = this->_aclPointArray.size(); this->_aclPointArray.reserve(this->_aclPointArray.size() + countNewPoints); - + // Now we can start inserting the points and adjust the point indices of the faces for (std::vector::iterator it = increments.begin(); it != increments.end(); ++it) { if (*it > 0) { @@ -433,7 +433,7 @@ bool MeshKernel::DeleteFacet (const MeshFacetIterator &rclIter) return false; // index of the facet to delete - ulInd = rclIter._clIter - _aclFacetArray.begin(); + ulInd = rclIter._clIter - _aclFacetArray.begin(); // invalidate neighbour indices of the neighbour facet to this facet for (int i = 0; i < 3; i++) { @@ -520,12 +520,12 @@ bool MeshKernel::DeletePoint (PointIndex ulInd) bool MeshKernel::DeletePoint (const MeshPointIterator &rclIter) { MeshFacetIterator pFIter(*this), pFEnd(*this); - std::vector clToDel; + std::vector clToDel; PointIndex ulInd; // index of the point to delete - ulInd = rclIter._clIter - _aclPointArray.begin(); - + ulInd = rclIter._clIter - _aclPointArray.begin(); + pFIter.Begin(); pFEnd.End(); @@ -544,7 +544,7 @@ bool MeshKernel::DeletePoint (const MeshPointIterator &rclIter) // delete each facet separately (from back to front to avoid to // invalidate the iterators) for (size_t i = clToDel.size(); i > 0; i--) - DeleteFacet(clToDel[i-1]); + DeleteFacet(clToDel[i-1]); return true; } @@ -589,7 +589,7 @@ void MeshKernel::ErasePoint (PointIndex ulIndex, FacetIndex ulFacetIndex, bool b pFIter = _aclFacetArray.begin(); pFNot = _aclFacetArray.begin() + ulFacetIndex; pFEnd = _aclFacetArray.end(); - + // check all facets while (pFIter < pFNot) { for (int i = 0; i < 3; i++) { @@ -705,7 +705,7 @@ void MeshKernel::RemoveInvalids () unsigned long ulDelFacets = std::count_if(_aclFacetArray.begin(), _aclFacetArray.end(), [](const MeshFacet& f) { return f.IsValid(); }); MeshFacetArray aclFArray(ulDelFacets); - MeshFacetArray::_TIterator pFTemp = aclFArray.begin(); + MeshFacetArray::_TIterator pFTemp = aclFArray.begin(); pFEnd = _aclFacetArray.end(); for (pFIter = _aclFacetArray.begin(); pFIter != pFEnd; ++pFIter) { if (pFIter->IsValid()) @@ -717,7 +717,7 @@ void MeshKernel::RemoveInvalids () _aclFacetArray.swap(aclFArray); } -void MeshKernel::CutFacets(const MeshFacetGrid& rclGrid, const Base::ViewProjMethod* pclProj, +void MeshKernel::CutFacets(const MeshFacetGrid& rclGrid, const Base::ViewProjMethod* pclProj, const Base::Polygon2d& rclPoly, bool bCutInner, std::vector &raclFacets) { std::vector aulFacets; @@ -817,7 +817,7 @@ MeshFacetArray MeshKernel::GetFacets(const std::vector& indices) con return ary; } -void MeshKernel::Write (std::ostream &rclOut) const +void MeshKernel::Write (std::ostream &rclOut) const { if (!rclOut || rclOut.bad()) return; @@ -897,7 +897,7 @@ void MeshKernel::Read (std::istream &rclIn) for (MeshPointArray::_TIterator it = pointArray.begin(); it != pointArray.end(); ++it) { str >> it->x >> it->y >> it->z; } - + MeshFacetArray facetArray; facetArray.resize(uCtFts); diff --git a/src/Mod/Mesh/App/Core/MeshKernel.h b/src/Mod/Mesh/App/Core/MeshKernel.h index 6c9a032060..e82c7b8dcb 100644 --- a/src/Mod/Mesh/App/Core/MeshKernel.h +++ b/src/Mod/Mesh/App/Core/MeshKernel.h @@ -51,10 +51,10 @@ class MeshPointVisitor; class MeshFacetGrid; -/** +/** * The MeshKernel class is the basic class that holds the data points, * the edges and the facets describing a mesh object. - * + * * The bounding box is calculated during the buildup of the data * structure and gets only re-caclulated after insertion of new facets * but not after removal of facets. @@ -198,10 +198,10 @@ public: //@} /** @name Facet visitors - * The MeshKernel class provides different methods to visit "topologic connected" facets - * to a given start facet. Two facets are regarded as "topologic connected" if they share + * The MeshKernel class provides different methods to visit "topologic connected" facets + * to a given start facet. Two facets are regarded as "topologic connected" if they share * a common edge or a common point. - * All methods expect a MeshFacetVisitor as argument that can decide to continue or to stop. + * All methods expect a MeshFacetVisitor as argument that can decide to continue or to stop. * If there is no topologic neighbour facet any more being not marked as "VISIT" the algorithm * stops anyway. * @see MeshFacetVisitor, MeshOrientationVisitor, MeshSearchNeighbourFacetsVisitor @@ -209,12 +209,12 @@ public: */ //@{ /** - * This method visits all neighbour facets, i.e facets that share a common edge - * starting from the facet associated to index \a ulStartFacet. All facets having set the VISIT + * This method visits all neighbour facets, i.e facets that share a common edge + * starting from the facet associated to index \a ulStartFacet. All facets having set the VISIT * flag are ignored. Therefore the user have to set or unset this flag if needed. * All facets that get visited during this algorithm are marked as VISIT and the Visit() method - * of the given MeshFacetVisitor gets invoked. - * If there are no unvisited neighbours any more the algorithms returns immediately and returns + * of the given MeshFacetVisitor gets invoked. + * If there are no unvisited neighbours any more the algorithms returns immediately and returns * the number of visited facets. * \note For the start facet \a ulStartFacet MeshFacetVisitor::Visit() does not get invoked though * the facet gets marked as VISIT. @@ -230,18 +230,18 @@ public: /** @name Point visitors * The MeshKernel class provides a method to visit neighbour points to a given start point. * Two points are regarded as neighbours if they share an edge. - * The method expects a MeshPointVisitor as argument that can decide to continue or to stop. + * The method expects a MeshPointVisitor as argument that can decide to continue or to stop. * If there is no topologic neighbour point any more being not marked as "VISIT" the algorithm * stops anyway. */ //@{ /** - * This method visits all neighbour points starting from the point associated to index \a ulStartPoint. - * All points having set the VISIT flag are ignored. Therefore the user have to set or unset this flag + * This method visits all neighbour points starting from the point associated to index \a ulStartPoint. + * All points having set the VISIT flag are ignored. Therefore the user have to set or unset this flag * if needed before the algorithm starts. * All points that get visited during this algorithm are marked as VISIT and the Visit() method - * of the given MeshPointVisitor gets invoked. - * If there are no unvisited neighbours any more the algorithms returns immediately and returns + * of the given MeshPointVisitor gets invoked. + * If there are no unvisited neighbours any more the algorithms returns immediately and returns * the number of visited points. * \note For the start facet \a ulStartPoint MeshPointVisitor::Visit() does not get invoked though * the point gets marked as VISIT. @@ -249,7 +249,7 @@ public: unsigned long VisitNeighbourPoints (MeshPointVisitor &rclPVisitor, PointIndex ulStartPoint) const; //@} - /** @name Iterators + /** @name Iterators * The iterator methods are provided for convenience. They return an iterator object that * points to the first element in the appropriate list. * \code @@ -284,11 +284,11 @@ public: * be called occasionally only. This does the same as the += operator above. */ void AddFacet(const MeshGeomFacet &rclSFacet); - /** Adds an array of facets to the data structure. This method keeps temporarily - * set properties and flags. + /** Adds an array of facets to the data structure. This method keeps temporarily + * set properties and flags. */ MeshKernel& operator += (const std::vector &rclFAry); - /** Adds an array of facets to the data structure. This method keeps temporarily + /** Adds an array of facets to the data structure. This method keeps temporarily * set properties and flags. This does the same as the += operator above. */ void AddFacets(const std::vector &rclFAry); @@ -342,7 +342,7 @@ public: * \li If there is no neighbour facet check if the points can be deleted. * True is returned if the facet could be deleted. * @note This method is very slow and should only be called occasionally. - * @note After deletion of the facet \a rclIter becomes invalid and must not + * @note After deletion of the facet \a rclIter becomes invalid and must not * be used before setting to a new position. */ bool DeleteFacet (const MeshFacetIterator &rclIter); @@ -350,7 +350,7 @@ public: * Does basically the same as the method above unless that the index of the facet is given. */ bool DeleteFacet (FacetIndex ulInd); - /** Removes several facets from the data structure. + /** Removes several facets from the data structure. * @note This method overwrites the free usable property of each mesh point. * @note This method also removes points from the structure that are no longer * referenced by the facets. @@ -362,7 +362,7 @@ public: * \li Delete these facets. * True is returned if the point could be deleted. * @note This method is very slow and should only be called occasionally. - * @note After deletion of the point \a rclIter becomes invalid and must not + * @note After deletion of the point \a rclIter becomes invalid and must not * be used before setting to a new position. */ bool DeletePoint (const MeshPointIterator &rclIter); @@ -370,7 +370,7 @@ public: * Does basically the same as the method above unless that the index of the facet is given. */ bool DeletePoint (PointIndex ulInd); - /** Removes several points from the data structure. + /** Removes several points from the data structure. * @note This method overwrites the free usable property of each mesh point. */ void DeletePoints (const std::vector &raulPoints); @@ -382,7 +382,7 @@ public: void Cleanup(); /** Clears the whole data structure. */ void Clear (); - /** Replaces the current data structure with the structure built up of the array + /** Replaces the current data structure with the structure built up of the array * of triangles given in \a rclFAry. */ MeshKernel& operator = (const std::vector &rclFAry); @@ -415,7 +415,7 @@ public: /** Smoothes the mesh kernel. */ void Smooth(int iterations, float d_max); /** - * CheckFacets() is invoked within this method and all found facets get deleted from the mesh structure. + * CheckFacets() is invoked within this method and all found facets get deleted from the mesh structure. * The facets to be deleted are returned with their geometric representation. * @see CheckFacets(). */ @@ -576,4 +576,4 @@ inline void MeshKernel::SetFacetPoints (FacetIndex ulFaIndex, PointIndex rclP0, } // namespace MeshCore -#endif // MESH_KERNEL_H +#endif // MESH_KERNEL_H diff --git a/src/Mod/Mesh/App/Core/Projection.cpp b/src/Mod/Mesh/App/Core/Projection.cpp index f634b2bb0d..0d6259c46d 100644 --- a/src/Mod/Mesh/App/Core/Projection.cpp +++ b/src/Mod/Mesh/App/Core/Projection.cpp @@ -59,7 +59,7 @@ bool MeshProjection::bboxInsideRectangle(const Base::BoundBox3f& bbox, { Base::Vector3f dir(p2 - p1); Base::Vector3f base(p1), normal(view % dir); - normal.Normalize(); + normal.Normalize(); if (bbox.IsCutPlane(base, normal)) { dir.Normalize(); @@ -132,7 +132,7 @@ bool MeshProjection::connectLines(std::list< std::pair &indices); ~MeshSurfaceVisitor () override; - bool AllowVisit (const MeshFacet& face, const MeshFacet&, + bool AllowVisit (const MeshFacet& face, const MeshFacet&, FacetIndex, unsigned long, unsigned short neighbourIndex) override; bool Visit (const MeshFacet & face, const MeshFacet &, FacetIndex ulFInd, unsigned long) override; diff --git a/src/Mod/Mesh/App/Core/SetOperations.cpp b/src/Mod/Mesh/App/Core/SetOperations.cpp index 140c50d73e..6a5dff594a 100644 --- a/src/Mod/Mesh/App/Core/SetOperations.cpp +++ b/src/Mod/Mesh/App/Core/SetOperations.cpp @@ -103,7 +103,7 @@ void SetOperations::Do () break; } } - + MeshDefinitions::SetMinPointDistance(saveMinMeshDistance); return; } @@ -179,7 +179,7 @@ void SetOperations::Cut (std::set& facetsCuttingEdge0, std::set& facetsCuttingEdge0, std::set vecFacets2; grid2.Inside(grid1.GetBoundBox(gx1, gy1, gz1), vecFacets2); - + if (!vecFacets2.empty()) { std::set vecFacets1; grid1.GetElements(gx1, gy1, gz1, vecFacets1); - + std::set::iterator it1; for (it1 = vecFacets1.begin(); it1 != vecFacets1.end(); ++it1) { FacetIndex fidx1 = *it1; MeshGeomFacet f1 = _cutMesh0.GetFacet(*it1); - + std::vector::iterator it2; for (it2 = vecFacets2.begin(); it2 != vecFacets2.end(); ++it2) { @@ -213,7 +213,7 @@ void SetOperations::Cut (std::set& facetsCuttingEdge0, std::set 0) - { + { // optimize cut line if distance to nearest point is too small float minDist1 = _minDistanceToPoint, minDist2 = _minDistanceToPoint; MeshPoint np0 = p0, np1 = p1; @@ -298,12 +298,12 @@ void SetOperations::Cut (std::set& facetsCuttingEdge0, std::set 0) } // for (gz1 = 0; gz1 < ctGz1; gz1++) } // for (gy1 = 0; gy1 < ctGy1; gy1++) - } // for (gx1 = 0; gx1 < ctGx1; gx1++) + } // for (gx1 = 0; gx1 < ctGx1; gx1++) } void SetOperations::TriangulateMesh (const MeshKernel &cutMesh, int side) { - // Triangulate Mesh + // Triangulate Mesh std::map::iterator> >::iterator it1; for (it1 = _facet2points[side].begin(); it1 != _facet2points[side].end(); ++it1) { @@ -324,7 +324,7 @@ void SetOperations::TriangulateMesh (const MeshKernel &cutMesh, int side) pointsSet.insert(f._aclPoints[i]); points.push_back(f._aclPoints[i]); } - + // triangulated facets std::list::iterator>::iterator it2; for (it2 = it1->second.begin(); it2 != it1->second.end(); ++it2) @@ -366,7 +366,7 @@ void SetOperations::TriangulateMesh (const MeshKernel &cutMesh, int side) { // two same triangle corner points continue; } - + MeshGeomFacet facet(points[it->_aulPoints[0]], points[it->_aulPoints[1]], points[it->_aulPoints[2]]); @@ -470,9 +470,9 @@ void SetOperations::CollectFacets (int side, float mult) { // Facet found, visit neighbours std::vector facets; facets.push_back(itf - rFacets.begin()); // add seed facet - CollectFacetVisitor visitor(mesh, facets, _edges, side, mult, _builder); + CollectFacetVisitor visitor(mesh, facets, _edges, side, mult, _builder); mesh.VisitNeighbourFacets(visitor, itf - rFacets.begin()); - + if (visitor._addFacets == 0) { // mark all facets to add it to the result algo.SetFacetsFlag(facets, MeshFacet::TMP0); diff --git a/src/Mod/Mesh/App/Core/Simplify.h b/src/Mod/Mesh/App/Core/Simplify.h index 74b511db05..3ae345a4f4 100644 --- a/src/Mod/Mesh/App/Core/Simplify.h +++ b/src/Mod/Mesh/App/Core/Simplify.h @@ -19,7 +19,7 @@ using vec3f = Base::Vector3f; -class SymmetricMatrix { +class SymmetricMatrix { public: @@ -27,12 +27,12 @@ public: SymmetricMatrix(double c=0) { for (std::size_t i=0;i<10;++i ) m[i] = c; } - SymmetricMatrix(double m11, double m12, double m13, double m14, + SymmetricMatrix(double m11, double m12, double m13, double m14, double m22, double m23, double m24, double m33, double m34, double m44) { - m[0] = m11; m[1] = m12; m[2] = m13; m[3] = m14; - m[4] = m22; m[5] = m23; m[6] = m24; + m[0] = m11; m[1] = m12; m[2] = m13; m[3] = m14; + m[4] = m22; m[5] = m23; m[6] = m24; m[7] = m33; m[8] = m34; m[9] = m44; } @@ -41,8 +41,8 @@ public: SymmetricMatrix(double a,double b,double c,double d) { - m[0] = a*a; m[1] = a*b; m[2] = a*c; m[3] = a*d; - m[4] = b*b; m[5] = b*c; m[6] = b*d; + m[0] = a*a; m[1] = a*b; m[2] = a*c; m[3] = a*d; + m[4] = b*b; m[5] = b*c; m[6] = b*d; m[7 ] =c*c; m[8 ] = c*d; m[9 ] = d*d; } @@ -61,7 +61,7 @@ public: } const SymmetricMatrix operator+(const SymmetricMatrix& n) const - { + { return SymmetricMatrix( m[0]+n[0], m[1]+n[1], m[2]+n[2], m[3]+n[3], m[4]+n[4], m[5]+n[5], m[6]+n[6], m[7]+n[7], m[8]+n[8], @@ -70,10 +70,10 @@ public: SymmetricMatrix& operator+=(const SymmetricMatrix& n) { - m[0]+=n[0]; m[1]+=n[1]; m[2]+=n[2]; m[3]+=n[3]; - m[4]+=n[4]; m[5]+=n[5]; m[6]+=n[6]; m[7]+=n[7]; + m[0]+=n[0]; m[1]+=n[1]; m[2]+=n[2]; m[3]+=n[3]; + m[4]+=n[4]; m[5]+=n[5]; m[6]+=n[6]; m[7]+=n[7]; m[8]+=n[8]; m[9]+=n[9]; - return *this; + return *this; } double m[10]; @@ -85,7 +85,7 @@ class Simplify public: struct Triangle { int v[3];double err[4];int deleted,dirty;vec3f n; }; struct Vertex { vec3f p;int tstart,tcount;SymmetricMatrix q;int border;}; - struct Ref { int tid,tvertex; }; + struct Ref { int tid,tvertex; }; std::vector triangles; std::vector vertices; std::vector refs; @@ -104,7 +104,7 @@ private: }; // -// Main simplification function +// Main simplification function // // target_count : target nr. of triangles // tolerance : tolerance for the quadratic errors @@ -125,9 +125,9 @@ void Simplify::simplify_mesh(int target_count, double tolerance, double aggressi for (std::size_t i=0;i deleted0,deleted1; int triangle_count=triangles.size(); @@ -139,7 +139,7 @@ void Simplify::simplify_mesh(int target_count, double tolerance, double aggressi break; // update mesh once in a while - if (iteration%5==0) + if (iteration%5==0) { update_mesh(iteration); } @@ -191,7 +191,7 @@ void Simplify::simplify_mesh(int target_count, double tolerance, double aggressi { if (t.err[j]0.999) return true; vec3f n; @@ -303,10 +303,10 @@ void Simplify::update_triangles(int i0,Vertex &v,std::vector &deleted,int & for (int k=0;k vcount,vids; @@ -504,7 +504,7 @@ double Simplify::vertex_error(const SymmetricMatrix& q, double x, double y, doub double Simplify::calculate_error(int id_v1, int id_v2, vec3f &p_result) { - // compute interpolated vertex + // compute interpolated vertex SymmetricMatrix q = vertices[id_v1].q + vertices[id_v2].q; bool border = vertices[id_v1].border & vertices[id_v2].border; @@ -514,9 +514,9 @@ double Simplify::calculate_error(int id_v1, int id_v2, vec3f &p_result) if (det != 0 && !border) { // q_delta is invertible - p_result.x = -1/det*(q.det(1, 2, 3, 4, 5, 6, 5, 7 , 8)); // vx = A41/det(q_delta) - p_result.y = 1/det*(q.det(0, 2, 3, 1, 5, 6, 2, 7 , 8)); // vy = A42/det(q_delta) - p_result.z = -1/det*(q.det(0, 1, 3, 1, 4, 6, 2, 5, 8)); // vz = A43/det(q_delta) + p_result.x = -1/det*(q.det(1, 2, 3, 4, 5, 6, 5, 7 , 8)); // vx = A41/det(q_delta) + p_result.y = 1/det*(q.det(0, 2, 3, 1, 5, 6, 2, 7 , 8)); // vy = A42/det(q_delta) + p_result.z = -1/det*(q.det(0, 1, 3, 1, 4, 6, 2, 5, 8)); // vz = A43/det(q_delta) error = vertex_error(q, p_result.x, p_result.y, p_result.z); } else diff --git a/src/Mod/Mesh/App/Core/Smoothing.h b/src/Mod/Mesh/App/Core/Smoothing.h index 7dffab3073..fe784c5797 100644 --- a/src/Mod/Mesh/App/Core/Smoothing.h +++ b/src/Mod/Mesh/App/Core/Smoothing.h @@ -38,16 +38,16 @@ class MeshRefFacetToFacets; class MeshExport AbstractSmoothing { public: - enum Component { + enum Component { Tangential, ///< Smooth tangential direction Normal, ///< Smooth normal direction TangentialNormal ///< Smooth tangential and normal direction }; - enum Continuity { - C0, - C1, - C2 + enum Continuity { + C0, + C1, + C2 }; explicit AbstractSmoothing(MeshKernel&); @@ -141,4 +141,4 @@ private: } // namespace MeshCore -#endif // MESH_SMOOTHING_H +#endif // MESH_SMOOTHING_H diff --git a/src/Mod/Mesh/App/Core/SphereFit.h b/src/Mod/Mesh/App/Core/SphereFit.h index fbea8c6e98..8d24f96083 100644 --- a/src/Mod/Mesh/App/Core/SphereFit.h +++ b/src/Mod/Mesh/App/Core/SphereFit.h @@ -33,7 +33,7 @@ namespace MeshCoreFit { using Matrix4x4 = Eigen::Matrix; /** - * Best-fit sphere for a given set of points. + * Best-fit sphere for a given set of points. */ class MeshExport SphereFit : public MeshCore::Approximation { diff --git a/src/Mod/Mesh/App/Core/Tools.cpp b/src/Mod/Mesh/App/Core/Tools.cpp index 6b8af32a99..3be59ebb6f 100644 --- a/src/Mod/Mesh/App/Core/Tools.cpp +++ b/src/Mod/Mesh/App/Core/Tools.cpp @@ -76,7 +76,7 @@ unsigned long MeshSearchNeighbours::NeighboursFromFacet (FacetIndex ulFacetIdx, bFound = ExpandRadius(ulMinPoints); } - int nCtExpandRadius = 0; + int nCtExpandRadius = 0; // search neighbours, add not marked facets, test distance, add outer points MeshFacetArray::_TConstIterator f_beg = _rclFAry.begin(); while (bFound && (nCtExpandRadius < 10)) { diff --git a/src/Mod/Mesh/App/Core/Tools.h b/src/Mod/Mesh/App/Core/Tools.h index 241efb2351..f092616fff 100644 --- a/src/Mod/Mesh/App/Core/Tools.h +++ b/src/Mod/Mesh/App/Core/Tools.h @@ -40,7 +40,7 @@ namespace MeshCore { * The MeshSearchNeighbours class provides methods to get all points * in the neighbourhood of a given facet. */ -class MeshSearchNeighbours +class MeshSearchNeighbours { public: explicit MeshSearchNeighbours ( const MeshKernel &rclM, float fSampleDistance = 1.0f); @@ -48,7 +48,7 @@ public: /** Re-initilaizes internal structures. */ void Reinit (float fSampleDistance); /** Collects all neighbour points from the facet (by index), the result are the points of the facets lying - * inside a sphere of radius \a fDistance, center \a center of the original facet. This method uses the + * inside a sphere of radius \a fDistance, center \a center of the original facet. This method uses the * MARKED flags. */ unsigned long NeighboursFromFacet (FacetIndex ulFacetIdx, float fDistance, unsigned long ulMinPoints, std::vector &raclResultPoints); @@ -79,7 +79,7 @@ protected: const MeshFacetArray &_rclFAry; const MeshPointArray &_rclPAry; MeshRefPointToFacets _clPt2Fa; - float _fMaxDistanceP2; // square distance + float _fMaxDistanceP2; // square distance Base::Vector3f _clCenter; // center points of start facet std::set _aclResult; // result container (point indices) std::set _aclOuter; // next searching points @@ -87,7 +87,7 @@ protected: std::vector > _aclSampledFacets; // sample points from each facet float _fSampleDistance; // distance between two sampled points Wm4::Sphere3 _akSphere; - bool _bTooFewPoints; + bool _bTooFewPoints; private: MeshSearchNeighbours (const MeshSearchNeighbours&); diff --git a/src/Mod/Mesh/App/Core/TopoAlgorithm.cpp b/src/Mod/Mesh/App/Core/TopoAlgorithm.cpp index 3c8f05586a..1dae82e2df 100644 --- a/src/Mod/Mesh/App/Core/TopoAlgorithm.cpp +++ b/src/Mod/Mesh/App/Core/TopoAlgorithm.cpp @@ -476,7 +476,7 @@ void MeshTopoAlgorithm::AdjustEdgesToCurvatureDirection() uPt3 = rFace1._aulPoints[(side+2)%3]; side = rFace2.Side(uPt1, uPt2); uPt4 = rFace2._aulPoints[(side+2)%3]; - + Wm4::Vector3 dir; float fActCurvature; if ( fabs(aMinCurv[uPt1]) > fabs(aMaxCurv[uPt1]) ) { @@ -491,7 +491,7 @@ void MeshTopoAlgorithm::AdjustEdgesToCurvatureDirection() Base::Vector3f cEdgeDir1 = raPts[uPt1] - raPts[uPt2]; Base::Vector3f cEdgeDir2 = raPts[uPt3] - raPts[uPt4]; cMinDir.Normalize(); cEdgeDir1.Normalize(); cEdgeDir2.Normalize(); - + // get the plane and calculate the distance to the fourth point MeshGeomFacet cPlane(raPts[uPt1], raPts[uPt2], raPts[uPt3]); // positive or negative distance @@ -588,7 +588,7 @@ bool MeshTopoAlgorithm::IsSwapEdgeLegal(FacetIndex ulFacetPos, FacetIndex ulNeig if (cT4.IsDegenerated(MeshDefinitions::_fMinPointDistanceP2)) return false; - // We must make sure that the two adjacent triangles builds a convex polygon, otherwise + // We must make sure that the two adjacent triangles builds a convex polygon, otherwise // the swap edge operation is illegal Base::Vector3f cU = cP2-cP1; Base::Vector3f cV = cP4-cP3; @@ -645,7 +645,7 @@ void MeshTopoAlgorithm::SwapEdge(FacetIndex ulFacetPos, FacetIndex ulNeighbour) unsigned short uFSide = rclF.Side(rclN); unsigned short uNSide = rclN.Side(rclF); - if (uFSide == USHRT_MAX || uNSide == USHRT_MAX) + if (uFSide == USHRT_MAX || uNSide == USHRT_MAX) return; // not neighbours // adjust the neighbourhood @@ -671,7 +671,7 @@ bool MeshTopoAlgorithm::SplitEdge(FacetIndex ulFacetPos, FacetIndex ulNeighbour, unsigned short uFSide = rclF.Side(rclN); unsigned short uNSide = rclN.Side(rclF); - if (uFSide == USHRT_MAX || uNSide == USHRT_MAX) + if (uFSide == USHRT_MAX || uNSide == USHRT_MAX) return false; // not neighbours PointIndex uPtCnt = _rclMesh._aclPointArray.size(); @@ -908,7 +908,7 @@ bool MeshTopoAlgorithm::CollapseEdge(FacetIndex ulFacetPos, FacetIndex ulNeighbo unsigned short uFSide = rclF.Side(rclN); unsigned short uNSide = rclN.Side(rclF); - if (uFSide == USHRT_MAX || uNSide == USHRT_MAX) + if (uFSide == USHRT_MAX || uNSide == USHRT_MAX) return false; // not neighbours if (!rclF.IsValid() || !rclN.IsValid()) @@ -1064,7 +1064,7 @@ bool MeshTopoAlgorithm::CollapseFacet(FacetIndex ulFacetPos) MeshFacet& rFace = _rclMesh._aclFacetArray[*it]; rFace.Transpose(ulPointInd1, ulPointInd0); } - + aRefs = GetFacetsToPoint(ulFacetPos, ulPointInd2); for (std::vector::iterator it = aRefs.begin(); it != aRefs.end(); ++it) { MeshFacet& rFace = _rclMesh._aclFacetArray[*it]; @@ -1580,10 +1580,10 @@ void MeshTopoAlgorithm::FillupHoles(int level, AbstractPolygonTriangulator& cTri addFacets.reserve(newFacets.size()); unsigned long ctPoints = _rclMesh.CountPoints(); for (MeshFacetArray::_TIterator it = newFacets.begin(); it != newFacets.end(); ++it) { - if (it->_aulPoints[0] >= ctPoints || - it->_aulPoints[1] >= ctPoints || + if (it->_aulPoints[0] >= ctPoints || + it->_aulPoints[1] >= ctPoints || it->_aulPoints[2] >= ctPoints) { - Base::Console().Log("Ignore invalid face <%d, %d, %d> (%d vertices)\n", + Base::Console().Log("Ignore invalid face <%d, %d, %d> (%d vertices)\n", it->_aulPoints[0], it->_aulPoints[1], it->_aulPoints[2], ctPoints); } else { @@ -1695,7 +1695,7 @@ void MeshComponents::SearchForComponents(TMode tMode, const std::vector >& aclT) const; /** diff --git a/src/Mod/Mesh/App/Core/Triangulation.cpp b/src/Mod/Mesh/App/Core/Triangulation.cpp index e51787b94f..f6bfd1170c 100644 --- a/src/Mod/Mesh/App/Core/Triangulation.cpp +++ b/src/Mod/Mesh/App/Core/Triangulation.cpp @@ -539,7 +539,7 @@ bool QuasiDelaunayTriangulator::Triangulate() float fMax12 = std::max(fMax1, fMax2); float fMax34 = std::max(fMax3, fMax4); - // We must make sure that the two adjacent triangles builds a convex polygon, otherwise + // We must make sure that the two adjacent triangles builds a convex polygon, otherwise // the swap edge operation is illegal Base::Vector3f cU = cP2-cP1; Base::Vector3f cV = cP4-cP3; @@ -642,7 +642,7 @@ DelaunayTriangulator::~DelaunayTriangulator() bool DelaunayTriangulator::Triangulate() { - // before starting the triangulation we must make sure that all polygon + // before starting the triangulation we must make sure that all polygon // points are different std::vector aPoints = _points; // sort the points ascending x,y coordinates @@ -715,7 +715,7 @@ FlatTriangulator::~FlatTriangulator() bool FlatTriangulator::Triangulate() { _newpoints.clear(); - // before starting the triangulation we must make sure that all polygon + // before starting the triangulation we must make sure that all polygon // points are different std::vector aPoints = ProjectToFitPlane(); std::vector tmp = aPoints; @@ -759,7 +759,7 @@ ConstraintDelaunayTriangulator::~ConstraintDelaunayTriangulator() bool ConstraintDelaunayTriangulator::Triangulate() { _newpoints.clear(); - // before starting the triangulation we must make sure that all polygon + // before starting the triangulation we must make sure that all polygon // points are different std::vector aPoints = ProjectToFitPlane(); std::vector tmp = aPoints; diff --git a/src/Mod/Mesh/App/Core/Triangulation.h b/src/Mod/Mesh/App/Core/Triangulation.h index 0c8fc4c1fa..1b2edcc022 100644 --- a/src/Mod/Mesh/App/Core/Triangulation.h +++ b/src/Mod/Mesh/App/Core/Triangulation.h @@ -160,7 +160,7 @@ private: * The original code snippet was submitted to FlipCode.com by John W. Ratcliff * (jratcliff@verant.com) on July 22, 2000. * The original vector of 2d points is replaced by a vector of 3d points where the - * z-coordinate is ignored. This is because the algorithm is often used for 3d points + * z-coordinate is ignored. This is because the algorithm is often used for 3d points * projected to a common plane. The result vector of 2d points is replaced by an * array of indices to the points of the polygon. */ diff --git a/src/Mod/Mesh/App/Core/Trim.cpp b/src/Mod/Mesh/App/Core/Trim.cpp index 08331fb9a8..8420e5907c 100644 --- a/src/Mod/Mesh/App/Core/Trim.cpp +++ b/src/Mod/Mesh/App/Core/Trim.cpp @@ -30,7 +30,7 @@ using namespace MeshCore; -MeshTrimming::MeshTrimming(MeshKernel &rclM, const Base::ViewProjMethod* pclProj, +MeshTrimming::MeshTrimming(MeshKernel &rclM, const Base::ViewProjMethod* pclProj, const Base::Polygon2d& rclPoly) : myMesh(rclM), myInner(true), myProj(pclProj), myPoly(rclPoly) { @@ -72,12 +72,12 @@ void MeshTrimming::CheckFacets(const MeshFacetGrid& rclGrid, std::vector= 0.001f) return false; @@ -214,7 +214,7 @@ bool MeshTrimming::GetIntersectionPointsOfPolygonAndFacet(FacetIndex ulIndex, in clPolyLine.clV2 = P4; for (int j=0; j<3; j++) { - Base::Vector3f clP1((*myProj)(clFac._aclPoints[j])); + Base::Vector3f clP1((*myProj)(clFac._aclPoints[j])); Base::Vector3f clP2((*myProj)(clFac._aclPoints[(j+1)%3])); Base::Vector2d P1(clP1.x, clP1.y); Base::Vector2d P2(clP2.x, clP2.y); @@ -244,7 +244,7 @@ bool MeshTrimming::GetIntersectionPointsOfPolygonAndFacet(FacetIndex ulIndex, in float r = fSP3 / fP3P4; float s = fSP4 / fP3P4; - + // is intersection point convex combination? if ((fabs(l+m-1.0f) < 0.001f) && (fabs(r+s-1.0f) < 0.001f)) { Base::Vector3f clIntersection(m*clFac._aclPoints[j]+l*clFac._aclPoints[(j+1)%3]); @@ -371,7 +371,7 @@ bool MeshTrimming::CreateFacets(FacetIndex ulFacetPos, int iSide, const std::vec // determine the edge containing the intersection point Base::Line2d clFacLine; for (int j=0; j<3; j++) { - Base::Vector3f clP1((*myProj)(clFac._aclPoints[j])); + Base::Vector3f clP1((*myProj)(clFac._aclPoints[j])); Base::Vector3f clP2((*myProj)(clFac._aclPoints[(j+1)%3])); Base::Vector2d P1(clP1.x, clP1.y); Base::Vector2d P2(clP2.x, clP2.y); @@ -403,7 +403,7 @@ bool MeshTrimming::CreateFacets(FacetIndex ulFacetPos, int iSide, const std::vec MeshFacet& facet = myMesh._aclFacetArray[ulFacetPos]; AdjustFacet(facet, iSide); Base::Vector3f clP1(raclPoints[0]), clP2(raclPoints[1]); - + if (iSide == 1) { // swap P1 and P2 clP1 = raclPoints[1]; @@ -493,48 +493,48 @@ bool MeshTrimming::CreateFacets(FacetIndex ulFacetPos, int iSide, const std::vec MeshGeomFacet clTmpFac; clTmpFac._aclPoints[0] = clFac._aclPoints[1]; clTmpFac._aclPoints[1] = clP2; clTmpFac._aclPoints[2] = clP1; if (clTmpFac.GetNormal() * clNormal > 0) { - Base::Vector3f tmp(clP1); - clP1 = clP2; + Base::Vector3f tmp(clP1); + clP1 = clP2; clP2 = tmp; } else { - Base::Vector3f tmp(clP1); - clP1 = clP4; - clP4 = clP2; - clP2 = clP3; + Base::Vector3f tmp(clP1); + clP1 = clP4; + clP4 = clP2; + clP2 = clP3; clP3 = tmp; } } else if (iSide == 1) { if ((clP2-clFac._aclPoints[1]).Length() > (clP4-clFac._aclPoints[1]).Length()) { - Base::Vector3f tmp(clP1); - clP1 = clP4; + Base::Vector3f tmp(clP1); + clP1 = clP4; clP4 = tmp; - tmp = clP2; - clP2 = clP3; + tmp = clP2; + clP2 = clP3; clP3 = tmp; } else { - Base::Vector3f tmp(clP1); - clP1 = clP2; + Base::Vector3f tmp(clP1); + clP1 = clP2; clP2 = tmp; - tmp = clP3; - clP3 = clP4; + tmp = clP3; + clP3 = clP4; clP4 = tmp; } } else { if ((clP1-clFac._aclPoints[1]).Length() > (clP3-clFac._aclPoints[1]).Length()) { - Base::Vector3f tmp(clP1); - clP1 = clP3; + Base::Vector3f tmp(clP1); + clP1 = clP3; clP3 = tmp; - tmp = clP2; - clP2 = clP4; + tmp = clP2; + clP2 = clP4; clP4 = tmp; } } } - + // now create the new facets if (iCtPts == 0) { // insert first facet diff --git a/src/Mod/Mesh/App/Core/Trim.h b/src/Mod/Mesh/App/Core/Trim.h index 3482008750..0dcce77df6 100644 --- a/src/Mod/Mesh/App/Core/Trim.h +++ b/src/Mod/Mesh/App/Core/Trim.h @@ -57,7 +57,7 @@ public: * Setter: Trimm INNER or OUTER */ void SetInnerOrOuter(TMode tMode); - + private: /** * Checks if the polygon cuts the facet @@ -85,9 +85,9 @@ private: * Checks if a polygon point lies within a facet */ bool IsPolygonPointInFacet(FacetIndex ulIndex, Base::Vector3f& clPoint); - + /** - * Calculates the two intersection points between polygonline and facet in 2D + * Calculates the two intersection points between polygonline and facet in 2D * and project the points back into 3D (not very exactly) */ bool GetIntersectionPointsOfPolygonAndFacet(FacetIndex ulIndex, int& iSide, diff --git a/src/Mod/Mesh/App/Core/Visitor.cpp b/src/Mod/Mesh/App/Core/Visitor.cpp index 6346ca7ce5..f2984672ce 100644 --- a/src/Mod/Mesh/App/Core/Visitor.cpp +++ b/src/Mod/Mesh/App/Core/Visitor.cpp @@ -55,7 +55,7 @@ unsigned long MeshKernel::VisitNeighbourFacets (MeshFacetVisitor &rclFVisitor, F if (j == FACET_INDEX_MAX) continue; // no neighbour facet - if (j >= ulCount) + if (j >= ulCount) continue; // error in data structure clNBFacet = _aclFacetArray.begin() + j; @@ -194,7 +194,7 @@ MeshPlaneVisitor::~MeshPlaneVisitor () delete fitter; } -bool MeshPlaneVisitor::AllowVisit (const MeshFacet& face, const MeshFacet&, +bool MeshPlaneVisitor::AllowVisit (const MeshFacet& face, const MeshFacet&, FacetIndex, unsigned long, unsigned short) { if (!fitter->Done()) diff --git a/src/Mod/Mesh/App/Core/Visitor.h b/src/Mod/Mesh/App/Core/Visitor.h index 2305c79f34..d90f80b3c9 100644 --- a/src/Mod/Mesh/App/Core/Visitor.h +++ b/src/Mod/Mesh/App/Core/Visitor.h @@ -37,20 +37,20 @@ class MeshPoint; class PlaneFit; /** - * Abstract base class for facet visitors. + * Abstract base class for facet visitors. * The MeshFacetVisitor class can be used for the so called * "Region growing" algorithms. */ class MeshExport MeshFacetVisitor { public: - /// Construction + /// Construction MeshFacetVisitor() { } - /// Denstruction + /// Denstruction virtual ~MeshFacetVisitor() { } /** Needs to be implemented in sub-classes. * \a rclFacet is the currently visited facet with the index \a ulFInd, \a rclFrom - * is the last visited facet and \a ulLevel indicates the ring number around the start facet. + * is the last visited facet and \a ulLevel indicates the ring number around the start facet. * If \a true is returned the next iteration is done if there are still facets to visit. * If \a false is returned the calling method stops immediately visiting further facets. */ @@ -58,9 +58,9 @@ public: unsigned long ulLevel) = 0; /** Test before a facet will be flagged as VISIT, return false means: go on with - * visiting the facets but not this one and set not the VISIT flag + * visiting the facets but not this one and set not the VISIT flag */ - virtual bool AllowVisit (const MeshFacet& rclFacet, const MeshFacet& rclFrom, + virtual bool AllowVisit (const MeshFacet& rclFacet, const MeshFacet& rclFrom, FacetIndex ulFInd, unsigned long ulLevel, unsigned short neighbourIndex) { @@ -153,7 +153,7 @@ public: float deviation, std::vector &indices); ~MeshPlaneVisitor () override; - bool AllowVisit (const MeshFacet& face, const MeshFacet&, + bool AllowVisit (const MeshFacet& face, const MeshFacet&, FacetIndex, unsigned long, unsigned short neighbourIndex) override; bool Visit (const MeshFacet & face, const MeshFacet &, FacetIndex ulFInd, unsigned long) override; @@ -170,14 +170,14 @@ protected: // ------------------------------------------------------------------------- /** - * Abstract base class for point visitors. + * Abstract base class for point visitors. */ class MeshExport MeshPointVisitor { public: - /// Construction + /// Construction MeshPointVisitor() { } - /// Denstruction + /// Denstruction virtual ~MeshPointVisitor() { } /** Needs to be implemented in sub-classes. * \a rclPoint is the currently visited point with the index \a ulPInd, \a rclFrom @@ -191,5 +191,5 @@ public: } // namespace MeshCore -#endif // VISITOR_H +#endif // VISITOR_H diff --git a/src/Mod/Mesh/App/Doxygen.cpp b/src/Mod/Mesh/App/Doxygen.cpp index 6dd2897b31..79dd0a3b89 100644 --- a/src/Mod/Mesh/App/Doxygen.cpp +++ b/src/Mod/Mesh/App/Doxygen.cpp @@ -23,11 +23,11 @@ /*! \namespace Mesh \brief The namespace of the Mesh Application layer library -*/ +*/ /*! \namespace MeshCore \brief The namespace of the Mesh Core library -*/ +*/ /*! \namespace Wm4 \brief The namespace of the WildMagic library diff --git a/src/Mod/Mesh/App/EdgePyImp.cpp b/src/Mod/Mesh/App/EdgePyImp.cpp index bd8db71541..7227374c89 100644 --- a/src/Mod/Mesh/App/EdgePyImp.cpp +++ b/src/Mod/Mesh/App/EdgePyImp.cpp @@ -43,7 +43,7 @@ std::string EdgePy::representation() const str << "(" << ptr->_aclPoints[1].x << ", " << ptr->_aclPoints[1].y << ", " << ptr->_aclPoints[1].z << ", Idx=" << ptr->PIndex[1] << "), "; str << "Idx=" << ptr->Index << ", (" << ptr->NIndex[0] << ", " << ptr->NIndex[1] << ")"; str << ")"; - + return str.str(); } @@ -189,5 +189,5 @@ PyObject *EdgePy::getCustomAttributes(const char* /*attr*/) const int EdgePy::setCustomAttributes(const char* /*attr*/, PyObject * /*obj*/) { - return 0; + return 0; } diff --git a/src/Mod/Mesh/App/FacetPy.xml b/src/Mod/Mesh/App/FacetPy.xml index 1b1295816e..dcf12f12bd 100644 --- a/src/Mod/Mesh/App/FacetPy.xml +++ b/src/Mod/Mesh/App/FacetPy.xml @@ -1,13 +1,13 @@ - @@ -34,7 +34,7 @@ work! - intersect(Facet) -> list + intersect(Facet) -> list Get a list of intersection points with another triangle. diff --git a/src/Mod/Mesh/App/FacetPyImp.cpp b/src/Mod/Mesh/App/FacetPyImp.cpp index 2aab7a77f0..eca20abc27 100644 --- a/src/Mod/Mesh/App/FacetPyImp.cpp +++ b/src/Mod/Mesh/App/FacetPyImp.cpp @@ -52,13 +52,13 @@ std::string FacetPy::representation() const str << "(" << ptr->_aclPoints[2].x << ", " << ptr->_aclPoints[2].y << ", " << ptr->_aclPoints[2].z << ")"; } str << ")"; - + return str.str(); } PyObject *FacetPy::PyMake(struct _typeobject *, PyObject *, PyObject *) // Python wrapper { - // create a new instance of FacetPy and the Twin object + // create a new instance of FacetPy and the Twin object return new FacetPy(new Facet); } @@ -309,7 +309,7 @@ PyObject *FacetPy::getCustomAttributes(const char* /*attr*/) const int FacetPy::setCustomAttributes(const char* /*attr*/, PyObject * /*obj*/) { - return 0; + return 0; } diff --git a/src/Mod/Mesh/App/FeatureMeshCurvature.cpp b/src/Mod/Mesh/App/FeatureMeshCurvature.cpp index b9cbcde7da..ee0c400df9 100644 --- a/src/Mod/Mesh/App/FeatureMeshCurvature.cpp +++ b/src/Mod/Mesh/App/FeatureMeshCurvature.cpp @@ -54,7 +54,7 @@ App::DocumentObjectExecReturn *Curvature::execute() if(!pcFeat || pcFeat->isError()) { return new App::DocumentObjectExecReturn("No mesh object attached."); } - + // get all points const MeshCore::MeshKernel& rMesh = pcFeat->Mesh.getValue().getKernel(); MeshCore::MeshCurvature meshCurv(rMesh); diff --git a/src/Mod/Mesh/App/FeatureMeshCurvature.h b/src/Mod/Mesh/App/FeatureMeshCurvature.h index ef48569285..b923950079 100644 --- a/src/Mod/Mesh/App/FeatureMeshCurvature.h +++ b/src/Mod/Mesh/App/FeatureMeshCurvature.h @@ -53,11 +53,11 @@ public: short mustExecute() const override; /// returns the type name of the ViewProvider const char* getViewProviderName() const override { - return "MeshGui::ViewProviderMeshCurvature"; + return "MeshGui::ViewProviderMeshCurvature"; } //@} }; } -#endif // Curvature_H +#endif // Curvature_H diff --git a/src/Mod/Mesh/App/FeatureMeshDefects.h b/src/Mod/Mesh/App/FeatureMeshDefects.h index 133cfda957..bdc5f22b81 100644 --- a/src/Mod/Mesh/App/FeatureMeshDefects.h +++ b/src/Mod/Mesh/App/FeatureMeshDefects.h @@ -271,4 +271,4 @@ public: } //namespace Mesh -#endif // MESH_FEATURE_MESH_DEFECTS_H +#endif // MESH_FEATURE_MESH_DEFECTS_H diff --git a/src/Mod/Mesh/App/FeatureMeshExport.h b/src/Mod/Mesh/App/FeatureMeshExport.h index e3b91fd54d..28647652ea 100644 --- a/src/Mod/Mesh/App/FeatureMeshExport.h +++ b/src/Mod/Mesh/App/FeatureMeshExport.h @@ -61,4 +61,4 @@ public: } -#endif // MESH_FEATUREMESHEXPORT_H +#endif // MESH_FEATUREMESHEXPORT_H diff --git a/src/Mod/Mesh/App/FeatureMeshImport.h b/src/Mod/Mesh/App/FeatureMeshImport.h index 94563df83e..c73dc6aa54 100644 --- a/src/Mod/Mesh/App/FeatureMeshImport.h +++ b/src/Mod/Mesh/App/FeatureMeshImport.h @@ -55,4 +55,4 @@ public: } -#endif // FEATURE_MESH_IMPORT_H +#endif // FEATURE_MESH_IMPORT_H diff --git a/src/Mod/Mesh/App/FeatureMeshSegmentByMesh.cpp b/src/Mod/Mesh/App/FeatureMeshSegmentByMesh.cpp index 43b79759ff..77cb40ef09 100644 --- a/src/Mod/Mesh/App/FeatureMeshSegmentByMesh.cpp +++ b/src/Mod/Mesh/App/FeatureMeshSegmentByMesh.cpp @@ -108,8 +108,8 @@ App::DocumentObjectExecReturn *SegmentByMesh::execute() cAlg.GetFacetsFromToolMesh(rToolMesh, Base::Vector3f(0.0, 1.0f, 0.0f), faces); // if the clipping plane was set then we want only the visible facets - if ( cNormal.Length() > 0.1f ) { // not a null vector - // now we have too many facets since we have (invisible) facets near to the back clipping plane, + if ( cNormal.Length() > 0.1f ) { // not a null vector + // now we have too many facets since we have (invisible) facets near to the back clipping plane, // so we need the nearest facet to the front clipping plane // float fDist = FLOAT_MAX; diff --git a/src/Mod/Mesh/App/FeatureMeshSegmentByMesh.h b/src/Mod/Mesh/App/FeatureMeshSegmentByMesh.h index 9d733bf17b..17cdc9ae2b 100644 --- a/src/Mod/Mesh/App/FeatureMeshSegmentByMesh.h +++ b/src/Mod/Mesh/App/FeatureMeshSegmentByMesh.h @@ -32,8 +32,8 @@ namespace Mesh { /** - * The SegmentByMesh class creates a mesh segment from two meshes whereat - * the facets of the first mesh that lie inside the second mesh build up the segment. + * The SegmentByMesh class creates a mesh segment from two meshes whereat + * the facets of the first mesh that lie inside the second mesh build up the segment. * @author Werner Mayer */ class SegmentByMesh : public Mesh::Feature @@ -59,4 +59,4 @@ public: } -#endif // FEATURE_MESH_SEGMENTBYMESH_H +#endif // FEATURE_MESH_SEGMENTBYMESH_H diff --git a/src/Mod/Mesh/App/FeatureMeshSetOperations.cpp b/src/Mod/Mesh/App/FeatureMeshSetOperations.cpp index 65fa4be42c..40ebc203db 100644 --- a/src/Mod/Mesh/App/FeatureMeshSetOperations.cpp +++ b/src/Mod/Mesh/App/FeatureMeshSetOperations.cpp @@ -82,7 +82,7 @@ App::DocumentObjectExecReturn *SetOperations::execute() throw Base::ValueError("Operation type must either be 'union' or 'intersection'" " or 'difference' or 'inner' or 'outer'"); - MeshCore::SetOperations setOp(meshKernel1.getKernel(), meshKernel2.getKernel(), + MeshCore::SetOperations setOp(meshKernel1.getKernel(), meshKernel2.getKernel(), pcKernel->getKernel(), type, 1.0e-5f); setOp.Do(); Mesh.setValuePtr(pcKernel.release()); diff --git a/src/Mod/Mesh/App/FeatureMeshSetOperations.h b/src/Mod/Mesh/App/FeatureMeshSetOperations.h index 1b3f09e82a..bd6a9a1d40 100644 --- a/src/Mod/Mesh/App/FeatureMeshSetOperations.h +++ b/src/Mod/Mesh/App/FeatureMeshSetOperations.h @@ -57,4 +57,4 @@ public: } -#endif // FEATURE_MESH_SEGMENT_H +#endif // FEATURE_MESH_SEGMENT_H diff --git a/src/Mod/Mesh/App/FeatureMeshSolid.cpp b/src/Mod/Mesh/App/FeatureMeshSolid.cpp index f23026de0a..03407d3905 100644 --- a/src/Mod/Mesh/App/FeatureMeshSolid.cpp +++ b/src/Mod/Mesh/App/FeatureMeshSolid.cpp @@ -93,8 +93,8 @@ Ellipsoid::Ellipsoid() short Ellipsoid::mustExecute() const { - if (Radius1.isTouched() || - Radius2.isTouched() || + if (Radius1.isTouched() || + Radius2.isTouched() || Sampling.isTouched()) return 1; return Feature::mustExecute(); @@ -145,7 +145,7 @@ Cylinder::Cylinder() short Cylinder::mustExecute() const { - if (Radius.isTouched() || + if (Radius.isTouched() || Length.isTouched() || EdgeLength.isTouched() || Closed.isTouched() || @@ -202,8 +202,8 @@ Cone::Cone() short Cone::mustExecute() const { - if (Radius1.isTouched() || - Radius2.isTouched() || + if (Radius1.isTouched() || + Radius2.isTouched() || Length.isTouched() || EdgeLength.isTouched() || Closed.isTouched() || @@ -255,8 +255,8 @@ Torus::Torus() short Torus::mustExecute() const { - if (Radius1.isTouched() || - Radius2.isTouched() || + if (Radius1.isTouched() || + Radius2.isTouched() || Sampling.isTouched()) return 1; return Feature::mustExecute(); @@ -304,8 +304,8 @@ Cube::Cube() short Cube::mustExecute() const { - if (Length.isTouched() || - Width.isTouched() || + if (Length.isTouched() || + Width.isTouched() || Height.isTouched()) return 1; return Feature::mustExecute(); diff --git a/src/Mod/Mesh/App/FeatureMeshSolid.h b/src/Mod/Mesh/App/FeatureMeshSolid.h index e0c3964cc4..fd01af973c 100644 --- a/src/Mod/Mesh/App/FeatureMeshSolid.h +++ b/src/Mod/Mesh/App/FeatureMeshSolid.h @@ -170,4 +170,4 @@ public: } -#endif // FEATURE_MESH_SOLID_H +#endif // FEATURE_MESH_SOLID_H diff --git a/src/Mod/Mesh/App/FeatureMeshTransform.h b/src/Mod/Mesh/App/FeatureMeshTransform.h index 8402621d52..0690e37308 100644 --- a/src/Mod/Mesh/App/FeatureMeshTransform.h +++ b/src/Mod/Mesh/App/FeatureMeshTransform.h @@ -53,11 +53,11 @@ public: App::DocumentObjectExecReturn *execute() override; /// returns the type name of the ViewProvider const char* getViewProviderName() const override { - return "MeshGui::ViewProviderMeshTransform"; + return "MeshGui::ViewProviderMeshTransform"; } //@} }; } -#endif // FEATURE_MESH_TRANSFORM_H +#endif // FEATURE_MESH_TRANSFORM_H diff --git a/src/Mod/Mesh/App/FeatureMeshTransformDemolding.h b/src/Mod/Mesh/App/FeatureMeshTransformDemolding.h index 4c63f47465..a9dccf5d72 100644 --- a/src/Mod/Mesh/App/FeatureMeshTransformDemolding.h +++ b/src/Mod/Mesh/App/FeatureMeshTransformDemolding.h @@ -58,4 +58,4 @@ public: } -#endif // FEATURE_MESH_TRANSFORM_H +#endif // FEATURE_MESH_TRANSFORM_H diff --git a/src/Mod/Mesh/App/GTSAlgos.cpp b/src/Mod/Mesh/App/GTSAlgos.cpp index b4b27aa683..90679dcd86 100644 --- a/src/Mod/Mesh/App/GTSAlgos.cpp +++ b/src/Mod/Mesh/App/GTSAlgos.cpp @@ -60,9 +60,9 @@ void GTSAlgos::coarsen(float f) gdouble fold = 3.1415 / 180.; try{ - gts_surface_coarsen (surface, - NULL, NULL, - NULL, NULL, + gts_surface_coarsen (surface, + NULL, NULL, + NULL, NULL, (GtsStopFunc)gts_coarsen_stop_number, &stop_number, fold); } catch (...) @@ -137,7 +137,7 @@ void GTSAlgos::boolean(const Mesh::MeshObject& ToolMesh, int Type) tree1 = gts_bb_tree_surface (s1); is_open1 = gts_surface_volume (s1) < 0. ? TRUE : FALSE; - // build bounding box tree for second surface + // build bounding box tree for second surface tree2 = gts_bb_tree_surface (s2); is_open2 = gts_surface_volume (s2) < 0. ? TRUE : FALSE; @@ -148,14 +148,14 @@ void GTSAlgos::boolean(const Mesh::MeshObject& ToolMesh, int Type) gts_object_destroy (GTS_OBJECT (s1)); gts_object_destroy (GTS_OBJECT (s2)); gts_bb_tree_destroy (tree1, TRUE); - gts_bb_tree_destroy (tree2, TRUE); + gts_bb_tree_destroy (tree2, TRUE); throw Base::RuntimeError("the intersection of 1 and 2 is not a closed curve\n"); } s3 = gts_surface_new (gts_surface_class (), gts_face_class (), gts_edge_class (), - gts_vertex_class ()); + gts_vertex_class ()); if (Type==0) { // union gts_surface_inter_boolean (si, s3, GTS_1_OUT_2); gts_surface_inter_boolean (si, s3, GTS_2_OUT_1); @@ -176,7 +176,7 @@ void GTSAlgos::boolean(const Mesh::MeshObject& ToolMesh, int Type) else if (Type==4) { // cut outer gts_surface_inter_boolean (si, s3, GTS_1_OUT_2); } - + // check that the resulting surface is not self-intersecting if (check_self_intersection) { GtsSurface * self_intersects; @@ -206,7 +206,7 @@ void GTSAlgos::boolean(const Mesh::MeshObject& ToolMesh, int Type) fillMeshFromGTSSurface(_Mesh,s3); - // destroy surfaces + // destroy surfaces gts_object_destroy (GTS_OBJECT (s1)); gts_object_destroy (GTS_OBJECT (s2)); gts_object_destroy (GTS_OBJECT (s3)); @@ -215,7 +215,7 @@ void GTSAlgos::boolean(const Mesh::MeshObject& ToolMesh, int Type) // destroy bounding box trees (including bounding boxes) gts_bb_tree_destroy (tree1, TRUE); gts_bb_tree_destroy (tree2, TRUE); - + } @@ -227,7 +227,7 @@ void GTSAlgos::boolean(const Mesh::MeshObject& ToolMesh, int Type) static GtsEdge * new_edge (GtsVertex * v1, GtsVertex * v2) { GtsSegment * s = gts_vertices_are_connected (v1, v2); - if( s == NULL ) + if( s == NULL ) return gts_edge_new (gts_edge_class (), v1, v2); else return GTS_EDGE (s); @@ -260,9 +260,9 @@ GtsSurface* GTSAlgos::createGTSSurface(const Mesh::MeshObject& Mesh) { // getting the three points of the facet Mesh.getKernel().GetFacetPoints(pFIter,p1,p2,p3); - + // creating the edges and add the face to the surface - gts_surface_add_face (Surf, + gts_surface_add_face (Surf, gts_face_new (Surf->face_class, new_edge (aVertex[p1],aVertex[p2]), new_edge (aVertex[p2],aVertex[p3]), diff --git a/src/Mod/Mesh/App/GTSAlgos.h b/src/Mod/Mesh/App/GTSAlgos.h index 021c3db157..75885e3076 100644 --- a/src/Mod/Mesh/App/GTSAlgos.h +++ b/src/Mod/Mesh/App/GTSAlgos.h @@ -68,4 +68,4 @@ private: } // namespace Mesh -#endif +#endif diff --git a/src/Mod/Mesh/App/Importer.cpp b/src/Mod/Mesh/App/Importer.cpp index 133b9423d5..5392bd71c8 100644 --- a/src/Mod/Mesh/App/Importer.cpp +++ b/src/Mod/Mesh/App/Importer.cpp @@ -47,13 +47,13 @@ void Importer::load(const std::string& fileName) if (segmct > 1) { createMeshFromSegments(file.fileNamePure(), mat, mesh); } - else if (mat.binding == MeshCore::MeshIO::PER_VERTEX && + else if (mat.binding == MeshCore::MeshIO::PER_VERTEX && mat.diffuseColor.size() == mesh.countPoints()) { Feature* feature = createMesh(file.fileNamePure(), mesh); addVertexColors(feature, mat.diffuseColor); feature->purgeTouched(); } - else if (mat.binding == MeshCore::MeshIO::PER_FACE && + else if (mat.binding == MeshCore::MeshIO::PER_FACE && mat.diffuseColor.size() == mesh.countFacets()) { Feature* feature = createMesh(file.fileNamePure(), mesh); addFaceColors(feature, mat.diffuseColor); diff --git a/src/Mod/Mesh/App/Mesh.cpp b/src/Mod/Mesh/App/Mesh.cpp index 84033abc0a..8b76554614 100644 --- a/src/Mod/Mesh/App/Mesh.cpp +++ b/src/Mod/Mesh/App/Mesh.cpp @@ -936,7 +936,7 @@ void MeshObject::offset(float fSize) void MeshObject::offsetSpecial2(float fSize) { - Base::Builder3D builder; + Base::Builder3D builder; std::vector PointNormals= _kernel.CalcVertexNormals(); std::vector FaceNormals; std::set fliped; @@ -968,12 +968,12 @@ void MeshObject::offsetSpecial2(float fSize) fliped.insert(it.Position()); } } - + // if there are no flipped triangles -> stop //int f =fliped.size(); if (fliped.empty()) break; - + for( std::set::iterator It= fliped.begin();It!=fliped.end();++It) alg.CollapseFacet(*It); fliped.clear(); @@ -2078,7 +2078,7 @@ bool MeshObject::const_point_iterator::operator==(const MeshObject::const_point_ return (this->_mesh == pi._mesh) && (this->_p_it == pi._p_it); } -bool MeshObject::const_point_iterator::operator!=(const MeshObject::const_point_iterator& pi) const +bool MeshObject::const_point_iterator::operator!=(const MeshObject::const_point_iterator& pi) const { return !operator==(pi); } @@ -2150,7 +2150,7 @@ bool MeshObject::const_facet_iterator::operator==(const MeshObject::const_facet_ return (this->_mesh == fi._mesh) && (this->_f_it == fi._f_it); } -bool MeshObject::const_facet_iterator::operator!=(const MeshObject::const_facet_iterator& fi) const +bool MeshObject::const_facet_iterator::operator!=(const MeshObject::const_facet_iterator& fi) const { return !operator==(fi); } diff --git a/src/Mod/Mesh/App/MeshFeature.cpp b/src/Mod/Mesh/App/MeshFeature.cpp index 0f1f9399ff..a6a5f1f80e 100644 --- a/src/Mod/Mesh/App/MeshFeature.cpp +++ b/src/Mod/Mesh/App/MeshFeature.cpp @@ -58,7 +58,7 @@ PyObject *Feature::getPyObject() // ref counter is set to 1 PythonObject = Py::Object(new MeshFeaturePy(this),true); } - return Py::new_reference_to(PythonObject); + return Py::new_reference_to(PythonObject); } void Feature::onChanged(const App::Property* prop) @@ -77,9 +77,9 @@ void Feature::onChanged(const App::Property* prop) // Note: If the Mesh property has changed the property and this object are marked as 'touched' // but no recomputation of this objects needs to be done because the Mesh property is regarded - // as output of a previous recomputation The mustExecute() method returns 0 in that case. + // as output of a previous recomputation The mustExecute() method returns 0 in that case. // However, objects that reference this object the Mesh property can be an input parameter. - // As this object and the property are touched such objects can check this and return a value 1 + // As this object and the property are touched such objects can check this and return a value 1 // (or -1) in their mustExecute() to be recomputed the next time the document recomputes itself. DocumentObject::onChanged(prop); } diff --git a/src/Mod/Mesh/App/MeshFeature.h b/src/Mod/Mesh/App/MeshFeature.h index 364f02d1c3..273352400c 100644 --- a/src/Mod/Mesh/App/MeshFeature.h +++ b/src/Mod/Mesh/App/MeshFeature.h @@ -93,4 +93,4 @@ using FeaturePython = App::FeaturePythonT; -#endif +#endif diff --git a/src/Mod/Mesh/App/MeshFeaturePy.xml b/src/Mod/Mesh/App/MeshFeaturePy.xml index 24228d2213..9af0eb0088 100644 --- a/src/Mod/Mesh/App/MeshFeaturePy.xml +++ b/src/Mod/Mesh/App/MeshFeaturePy.xml @@ -1,12 +1,12 @@  - diff --git a/src/Mod/Mesh/App/MeshFeaturePyImp.cpp b/src/Mod/Mesh/App/MeshFeaturePyImp.cpp index ab7991f89c..ad5025113f 100644 --- a/src/Mod/Mesh/App/MeshFeaturePyImp.cpp +++ b/src/Mod/Mesh/App/MeshFeaturePyImp.cpp @@ -43,12 +43,12 @@ std::string MeshFeaturePy::representation() const PyObject* MeshFeaturePy::countPoints(PyObject * /*args*/) { - return Py_BuildValue("i",getFeaturePtr()->Mesh.getValue().countPoints()); + return Py_BuildValue("i",getFeaturePtr()->Mesh.getValue().countPoints()); } PyObject* MeshFeaturePy::countFacets(PyObject * /*args*/) { - return Py_BuildValue("i",getFeaturePtr()->Mesh.getValue().countFacets()); + return Py_BuildValue("i",getFeaturePtr()->Mesh.getValue().countFacets()); } PyObject* MeshFeaturePy::harmonizeNormals(PyObject *args) @@ -62,7 +62,7 @@ PyObject* MeshFeaturePy::harmonizeNormals(PyObject *args) getFeaturePtr()->Mesh.finishEditing(); } PY_CATCH; - Py_Return; + Py_Return; } PyObject* MeshFeaturePy::smooth(PyObject *args) @@ -79,7 +79,7 @@ PyObject* MeshFeaturePy::smooth(PyObject *args) obj->Mesh.finishEditing(); } PY_CATCH; - Py_Return; + Py_Return; } PyObject* MeshFeaturePy::removeNonManifolds(PyObject *args) @@ -116,7 +116,7 @@ PyObject* MeshFeaturePy::fixIndices(PyObject *args) obj->Mesh.finishEditing(); } PY_CATCH; - Py_Return; + Py_Return; } PyObject* MeshFeaturePy::fixDegenerations(PyObject *args) @@ -132,7 +132,7 @@ PyObject* MeshFeaturePy::fixDegenerations(PyObject *args) obj->Mesh.finishEditing(); } PY_CATCH; - Py_Return; + Py_Return; } PyObject* MeshFeaturePy::removeDuplicatedFacets(PyObject *args) @@ -147,7 +147,7 @@ PyObject* MeshFeaturePy::removeDuplicatedFacets(PyObject *args) obj->Mesh.finishEditing(); } PY_CATCH; - Py_Return; + Py_Return; } PyObject* MeshFeaturePy::removeDuplicatedPoints(PyObject *args) @@ -162,7 +162,7 @@ PyObject* MeshFeaturePy::removeDuplicatedPoints(PyObject *args) obj->Mesh.finishEditing(); } PY_CATCH; - Py_Return; + Py_Return; } PyObject* MeshFeaturePy::fixSelfIntersections(PyObject *args) @@ -223,5 +223,5 @@ PyObject *MeshFeaturePy::getCustomAttributes(const char* /*attr*/) const int MeshFeaturePy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/) { - return 0; + return 0; } diff --git a/src/Mod/Mesh/App/MeshPointPy.xml b/src/Mod/Mesh/App/MeshPointPy.xml index cf08041243..a701386272 100644 --- a/src/Mod/Mesh/App/MeshPointPy.xml +++ b/src/Mod/Mesh/App/MeshPointPy.xml @@ -1,13 +1,13 @@ - @@ -16,7 +16,7 @@ Point in a Mesh Point in mesh This is a point in a MeshObject. You can get it by e.g. iterating a -mesh. The point has a connection to its mesh and allows therefore +mesh. The point has a connection to its mesh and allows therefore topological operations. It is also possible to create an unbounded mesh point e.g. to create a mesh. In this case the topological operations will fail. The same is when you cut the bound to the mesh by calling unbound(). diff --git a/src/Mod/Mesh/App/MeshProperties.cpp b/src/Mod/Mesh/App/MeshProperties.cpp index c2a0b09598..a74cf0fc01 100644 --- a/src/Mod/Mesh/App/MeshProperties.cpp +++ b/src/Mod/Mesh/App/MeshProperties.cpp @@ -301,7 +301,7 @@ void PropertyCurvatureList::transformGeometry(const Base::Matrix4D &mat) { // The principal direction is only a vector with unit length, so we only need to rotate it // (no translations or scaling) - + // Extract scale factors (assumes an orthogonal rotation matrix) // Use the fact that the length of the row vectors of R are all equal to 1 // And that scaling is applied after rotating @@ -309,7 +309,7 @@ void PropertyCurvatureList::transformGeometry(const Base::Matrix4D &mat) s[0] = sqrt(mat[0][0] * mat[0][0] + mat[0][1] * mat[0][1] + mat[0][2] * mat[0][2]); s[1] = sqrt(mat[1][0] * mat[1][0] + mat[1][1] * mat[1][1] + mat[1][2] * mat[1][2]); s[2] = sqrt(mat[2][0] * mat[2][0] + mat[2][1] * mat[2][1] + mat[2][2] * mat[2][2]); - + // Set up the rotation matrix: zero the translations and make the scale factors = 1 Base::Matrix4D rot; rot.setToUnity(); @@ -336,7 +336,7 @@ void PropertyCurvatureList::transformGeometry(const Base::Matrix4D &mat) void PropertyCurvatureList::Save (Base::Writer &writer) const { if (!writer.isForceXML()) { - writer.Stream() << writer.ind() << "" << std::endl; } } @@ -345,7 +345,7 @@ void PropertyCurvatureList::Restore(Base::XMLReader &reader) { reader.readElement("CurvatureList"); std::string file (reader.getAttribute("file") ); - + if (!file.empty()) { // initiate a file read reader.addFile(file.c_str(),this); @@ -745,14 +745,14 @@ PropertyMeshKernel::PropertyMeshKernel() { // Note: Normally this property is a member of a document object, i.e. the setValue() // method gets called in the constructor of a sublcass of DocumentObject, e.g. Mesh::Feature. - // This means that the created MeshObject here will be replaced and deleted immediately. + // This means that the created MeshObject here will be replaced and deleted immediately. // However, we anyway create this object in case we use this class in another context. } PropertyMeshKernel::~PropertyMeshKernel() { if (meshPyObject) { - // Note: Do not call setInvalid() of the Python binding + // Note: Do not call setInvalid() of the Python binding // because the mesh should still be accessible afterwards. meshPyObject->parentProperty = nullptr; Py_DECREF(meshPyObject); @@ -797,12 +797,12 @@ void PropertyMeshKernel::swapMesh(MeshCore::MeshKernel& mesh) hasSetValue(); } -const MeshObject& PropertyMeshKernel::getValue()const +const MeshObject& PropertyMeshKernel::getValue()const { return *_meshObject; } -const MeshObject* PropertyMeshKernel::getValuePtr()const +const MeshObject* PropertyMeshKernel::getValuePtr()const { return static_cast(_meshObject); } @@ -821,7 +821,7 @@ unsigned int PropertyMeshKernel::getMemSize () const { unsigned int size = 0; size += _meshObject->getMemSize(); - + return size; } @@ -905,7 +905,7 @@ void PropertyMeshKernel::Save (Base::Writer &writer) const saver.SaveXML(writer); } else { - writer.Stream() << writer.ind() << "" << std::endl; } } @@ -914,7 +914,7 @@ void PropertyMeshKernel::Restore(Base::XMLReader &reader) { reader.readElement("Mesh"); std::string file (reader.getAttribute("file") ); - + if (file.empty()) { // read XML MeshCore::MeshKernel kernel; @@ -929,7 +929,7 @@ void PropertyMeshKernel::Restore(Base::XMLReader &reader) aboutToSetValue(); _meshObject->getKernel().Adopt(points, facets); hasSetValue(); - } + } else { // initiate a file read reader.addFile(file.c_str(),this); diff --git a/src/Mod/Mesh/App/MeshProperties.h b/src/Mod/Mesh/App/MeshProperties.h index c2398d5b0a..441a5f554c 100644 --- a/src/Mod/Mesh/App/MeshProperties.h +++ b/src/Mod/Mesh/App/MeshProperties.h @@ -110,10 +110,10 @@ class MeshExport PropertyCurvatureList: public App::PropertyLists TYPESYSTEM_HEADER_WITH_OVERRIDE(); public: - enum { + enum { MeanCurvature = 0, /**< Mean curvature */ GaussCurvature = 1, /**< Gaussian curvature */ - MaxCurvature = 2, /**< Maximum curvature */ + MaxCurvature = 2, /**< Maximum curvature */ MinCurvature = 3, /**< Minimum curvature */ AbsCurvature = 4 /**< Absolute curvature */ }; @@ -242,7 +242,7 @@ public: void swapMesh(MeshObject&); /** Swaps the mesh data structure. */ void swapMesh(MeshCore::MeshKernel&); - /** Returns a the attached mesh object by reference. It cannot be modified + /** Returns a the attached mesh object by reference. It cannot be modified * from outside. */ const MeshObject &getValue() const; @@ -270,12 +270,12 @@ public: /** @name Python interface */ //@{ - /** Returns a Python wrapper for the referenced mesh object. It does NOT + /** Returns a Python wrapper for the referenced mesh object. It does NOT * create a copy. However, the Python wrapper is marked as \a immutable so * that the mesh object cannot be modified from outside. */ PyObject* getPyObject() override; - /** This method copies the content, hence creates an new mesh object + /** This method copies the content, hence creates an new mesh object * to copy the data. The passed argument can be an instance of the Python * wrapper for the mesh object or simply a list of triangles, i.e. a list * of lists of three floats. diff --git a/src/Mod/Mesh/App/MeshPy.xml b/src/Mod/Mesh/App/MeshPy.xml index 10c9e9c027..e4c5408191 100644 --- a/src/Mod/Mesh/App/MeshPy.xml +++ b/src/Mod/Mesh/App/MeshPy.xml @@ -3,11 +3,11 @@ diff --git a/src/Mod/Mesh/App/MeshPyImp.cpp b/src/Mod/Mesh/App/MeshPyImp.cpp index 511d7ee6ac..0335243bf3 100644 --- a/src/Mod/Mesh/App/MeshPyImp.cpp +++ b/src/Mod/Mesh/App/MeshPyImp.cpp @@ -116,7 +116,7 @@ std::string MeshPy::representation() const PyObject *MeshPy::PyMake(struct _typeobject *, PyObject *, PyObject *) // Python wrapper { - // create a new instance of MeshPy and the Twin object + // create a new instance of MeshPy and the Twin object return new MeshPy(new MeshObject); } @@ -964,7 +964,7 @@ PyObject* MeshPy::isSolid(PyObject *args) if (!PyArg_ParseTuple(args, "")) return nullptr; bool ok = getMeshObjectPtr()->isSolid(); - return Py_BuildValue("O", (ok ? Py_True : Py_False)); + return Py_BuildValue("O", (ok ? Py_True : Py_False)); } PyObject* MeshPy::hasNonManifolds(PyObject *args) @@ -972,7 +972,7 @@ PyObject* MeshPy::hasNonManifolds(PyObject *args) if (!PyArg_ParseTuple(args, "")) return nullptr; bool ok = getMeshObjectPtr()->hasNonManifolds(); - return Py_BuildValue("O", (ok ? Py_True : Py_False)); + return Py_BuildValue("O", (ok ? Py_True : Py_False)); } PyObject* MeshPy::hasInvalidNeighbourhood(PyObject *args) @@ -1028,7 +1028,7 @@ PyObject* MeshPy::hasSelfIntersections(PyObject *args) if (!PyArg_ParseTuple(args, "")) return nullptr; bool ok = getMeshObjectPtr()->hasSelfIntersections(); - return Py_BuildValue("O", (ok ? Py_True : Py_False)); + return Py_BuildValue("O", (ok ? Py_True : Py_False)); } PyObject* MeshPy::getSelfIntersections(PyObject *args) @@ -1090,7 +1090,7 @@ PyObject* MeshPy::hasInvalidPoints(PyObject *args) if (!PyArg_ParseTuple(args, "")) return nullptr; bool ok = getMeshObjectPtr()->hasInvalidPoints(); - return Py_BuildValue("O", (ok ? Py_True : Py_False)); + return Py_BuildValue("O", (ok ? Py_True : Py_False)); } PyObject* MeshPy::removeInvalidPoints(PyObject *args) @@ -1149,7 +1149,7 @@ PyObject* MeshPy::hasNonUniformOrientedFacets(PyObject *args) if (!PyArg_ParseTuple(args, "")) return nullptr; bool ok = getMeshObjectPtr()->countNonUniformOrientedFacets() > 0; - return Py_BuildValue("O", (ok ? Py_True : Py_False)); + return Py_BuildValue("O", (ok ? Py_True : Py_False)); } PyObject* MeshPy::countNonUniformOrientedFacets(PyObject *args) @@ -1157,7 +1157,7 @@ PyObject* MeshPy::countNonUniformOrientedFacets(PyObject *args) if (!PyArg_ParseTuple(args, "")) return nullptr; unsigned long count = getMeshObjectPtr()->countNonUniformOrientedFacets(); - return Py_BuildValue("k", count); + return Py_BuildValue("k", count); } PyObject* MeshPy::getNonUniformOrientedFacets(PyObject *args) @@ -1436,7 +1436,7 @@ PyObject* MeshPy::splitEdge(PyObject *args) PyErr_SetString(PyExc_IndexError, "No adjacent facets"); return nullptr; } - + getMeshObjectPtr()->splitEdge(facet, neighbour, v); } PY_CATCH; @@ -1448,7 +1448,7 @@ PyObject* MeshPy::splitFacet(PyObject *args) unsigned long facet; PyObject* vertex1; PyObject* vertex2; - if (!PyArg_ParseTuple(args, "kO!O!", &facet, &Base::VectorPy::Type, &vertex1, + if (!PyArg_ParseTuple(args, "kO!O!", &facet, &Base::VectorPy::Type, &vertex1, &Base::VectorPy::Type, &vertex2)) return nullptr; @@ -1466,7 +1466,7 @@ PyObject* MeshPy::splitFacet(PyObject *args) PyErr_SetString(PyExc_IndexError, "Facet index out of range"); return nullptr; } - + getMeshObjectPtr()->splitFacet(facet, v1, v2); } PY_CATCH; @@ -1489,14 +1489,14 @@ PyObject* MeshPy::swapEdge(PyObject *args) PyErr_SetString(PyExc_IndexError, "Facet index out of range"); return nullptr; } - + const MeshCore::MeshFacet& rclF = kernel.GetFacets()[facet]; if (rclF._aulNeighbours[0] != neighbour && rclF._aulNeighbours[1] != neighbour && rclF._aulNeighbours[2] != neighbour) { PyErr_SetString(PyExc_IndexError, "No adjacent facets"); return nullptr; } - + getMeshObjectPtr()->swapEdge(facet, neighbour); } PY_CATCH; @@ -1519,14 +1519,14 @@ PyObject* MeshPy::collapseEdge(PyObject *args) PyErr_SetString(PyExc_IndexError, "Facet index out of range"); return nullptr; } - + const MeshCore::MeshFacet& rclF = kernel.GetFacets()[facet]; if (rclF._aulNeighbours[0] != neighbour && rclF._aulNeighbours[1] != neighbour && rclF._aulNeighbours[2] != neighbour) { PyErr_SetString(PyExc_IndexError, "No adjacent facets"); return nullptr; } - + getMeshObjectPtr()->collapseEdge(facet, neighbour); } PY_CATCH; @@ -1544,7 +1544,7 @@ PyObject* MeshPy::collapseFacet(PyObject *args) PyErr_SetString(PyExc_IndexError, "Facet index out of range"); return nullptr; } - + getMeshObjectPtr()->collapseFacet(facet); } PY_CATCH; @@ -1567,7 +1567,7 @@ PyObject* MeshPy::insertVertex(PyObject *args) PyErr_SetString(PyExc_IndexError, "Facet index out of range"); return nullptr; } - + getMeshObjectPtr()->insertVertex(facet, v); } PY_CATCH; @@ -1590,7 +1590,7 @@ PyObject* MeshPy::snapVertex(PyObject *args) PyErr_SetString(PyExc_IndexError, "Facet index out of range"); return nullptr; } - + getMeshObjectPtr()->snapVertex(facet, v); } PY_CATCH; @@ -2016,7 +2016,7 @@ PyObject *MeshPy::getCustomAttributes(const char* /*attr*/) const int MeshPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/) { - return 0; + return 0; } Py::List MeshPy::getPoints() const diff --git a/src/Mod/Mesh/App/MeshTestsApp.py b/src/Mod/Mesh/App/MeshTestsApp.py index 57617d3298..2dd450a489 100644 --- a/src/Mod/Mesh/App/MeshTestsApp.py +++ b/src/Mod/Mesh/App/MeshTestsApp.py @@ -30,7 +30,7 @@ class MeshTopoTestCases(unittest.TestCase): self.planarMesh = [] for x in range(3): for y in range(3): - self.planarMesh.append( [0.0 + x, 0.0 + y,0.0000] ) + self.planarMesh.append( [0.0 + x, 0.0 + y,0.0000] ) self.planarMesh.append( [1.0 + x, 1.0 + y,0.0000] ) self.planarMesh.append( [0.0 + x, 1.0 + y,0.0000] ) self.planarMesh.append( [0.0 + x, 0.0 + y,0.0000] ) @@ -255,7 +255,7 @@ class MeshGeoTestCases(unittest.TestCase): def testIntersection(self): - self.planarMesh.append( [0.9961,1.5413,4.3943] ) + self.planarMesh.append( [0.9961,1.5413,4.3943] ) self.planarMesh.append( [9.4796,10.024,-3.0937] ) self.planarMesh.append( [1.4308,11.3841,2.6829] ) self.planarMesh.append( [2.6493,2.2536,3.0679] ) @@ -269,7 +269,7 @@ class MeshGeoTestCases(unittest.TestCase): def testIntersection2(self): - self.planarMesh.append( [-16.097176,-29.891157,15.987688] ) + self.planarMesh.append( [-16.097176,-29.891157,15.987688] ) self.planarMesh.append( [-16.176304,-29.859991,15.947966] ) self.planarMesh.append( [-16.071451,-29.900553,15.912505] ) self.planarMesh.append( [-16.092241,-29.893408,16.020439] ) @@ -473,7 +473,7 @@ class PivyTestCases(unittest.TestCase): def testRayPick(self): if not FreeCAD.GuiUp: return - self.planarMesh.append( [-16.097176,-29.891157,15.987688] ) + self.planarMesh.append( [-16.097176,-29.891157,15.987688] ) self.planarMesh.append( [-16.176304,-29.859991,15.947966] ) self.planarMesh.append( [-16.071451,-29.900553,15.912505] ) self.planarMesh.append( [-16.092241,-29.893408,16.020439] ) @@ -497,7 +497,7 @@ class PivyTestCases(unittest.TestCase): def testPrimitiveCount(self): if not FreeCAD.GuiUp: return - self.planarMesh.append( [-16.097176,-29.891157,15.987688] ) + self.planarMesh.append( [-16.097176,-29.891157,15.987688] ) self.planarMesh.append( [-16.176304,-29.859991,15.947966] ) self.planarMesh.append( [-16.071451,-29.900553,15.912505] ) self.planarMesh.append( [-16.092241,-29.893408,16.020439] ) diff --git a/src/Mod/Mesh/App/Segment.cpp b/src/Mod/Mesh/App/Segment.cpp index 70f6ef910a..405265acd7 100644 --- a/src/Mod/Mesh/App/Segment.cpp +++ b/src/Mod/Mesh/App/Segment.cpp @@ -67,7 +67,7 @@ void Segment::removeIndices(const std::vector& inds) std::set s2(inds.begin(), inds.end()); std::set_difference(s1.begin(), s1.end(), s2.begin(), s2.end(), std::back_insert_iterator >(result)); - + _indices = result; if (_modifykernel) _mesh->updateMesh(); @@ -161,7 +161,7 @@ bool Segment::const_facet_iterator::operator==(const Segment::const_facet_iterat return (this->_segment == fi._segment) && (this->_it == fi._it); } -bool Segment::const_facet_iterator::operator!=(const Segment::const_facet_iterator& fi) const +bool Segment::const_facet_iterator::operator!=(const Segment::const_facet_iterator& fi) const { return !operator==(fi); } diff --git a/src/Mod/Mesh/BuildRegularGeoms.py b/src/Mod/Mesh/BuildRegularGeoms.py index c00b57d7b4..0d08a7117b 100644 --- a/src/Mod/Mesh/BuildRegularGeoms.py +++ b/src/Mod/Mesh/BuildRegularGeoms.py @@ -29,11 +29,11 @@ def Ellipsoid (lenX, lenY, count): i = 0.0 while (i < math.pi + step / 10.0): x = math.cos(i) * lenX - y = math.sin(i) * lenY + y = math.sin(i) * lenY polyline.append([x, y]) i = i + step - return RotationBody(polyline, count) + return RotationBody(polyline, count) def Cylinder (radius, len, closed, edgelen, count): return Cone(radius, radius, len, closed, edgelen, count) @@ -51,7 +51,7 @@ def Cone (radius1, radius2, len, closed, edgelen, count): polyline.append([len, i]) i = i + step - ct = math.ceil(len / edgelen) + ct = math.ceil(len / edgelen) step = len / ct rstep = (radius1 - radius2) / ct i = len; @@ -73,12 +73,12 @@ def Cone (radius1, radius2, len, closed, edgelen, count): polyline.append([0.0, i]) i = i - step polyline.append([0.0, 0.0]) - + return RotationBody(polyline, count) def Toroid (radius1, radius2, count): polyline = [] - + step = math.pi * 2.0 / count i = -math.pi while (i < math.pi + step / 10.0): @@ -88,7 +88,7 @@ def Toroid (radius1, radius2, count): i = i + step return RotationBody(polyline, count) - + def RotationBody (polyline, count): """Build a rotation body from a given (closed) polyline, rotation axis is the X-Axis. @@ -105,7 +105,7 @@ def RotationBody (polyline, count): for j in range(0, len(polyline) - 1): v1 = polyline[j] v2 = polyline[j+1] - + x1 = v1[0] y1 = v1[1] * math.cos(i) z1 = v1[1] * math.sin(i) @@ -119,7 +119,7 @@ def RotationBody (polyline, count): y4 = v2[1] * math.cos(li) z4 = v2[1] * math.sin(li) - if (v1[1] != 0.0): + if (v1[1] != 0.0): facets.append([x1, y1, z1]) facets.append([x2, y2, z2]) facets.append([x3, y3, z3]) @@ -128,18 +128,18 @@ def RotationBody (polyline, count): facets.append([x2, y2, z2]) facets.append([x4, y4, z4]) facets.append([x3, y3, z3]) - + i = i + step - + return facets; def Cube (lenX, lenY, lenZ): hx = lenX / 2.0 hy = lenY / 2.0 hz = lenZ / 2.0 - + facets = [] - + facets.append([-hx, -hy, -hz]) facets.append([hx, -hy, -hz]) facets.append([hx, -hy, hz]) @@ -187,7 +187,7 @@ def Cube (lenX, lenY, lenZ): facets.append([-hx, -hy, hz]) facets.append([hx, -hy, hz]) facets.append([hx, hy, hz]) - + return facets def FineCube (lenX, lenY, lenZ, edgelen): @@ -200,7 +200,7 @@ def FineCube (lenX, lenY, lenZ, edgelen): dy = lenY / cy cz = int(max(lenZ / edgelen,1)) dz = lenZ / cz - + facets = [] # z @@ -264,7 +264,6 @@ def FineCube (lenX, lenY, lenZ, edgelen): def main (): Cylinder (10.0, 20.0, 1, 10, 10) - + if __name__ == "__main__": main() - \ No newline at end of file diff --git a/src/Mod/Mesh/Gui/AppMeshGui.cpp b/src/Mod/Mesh/Gui/AppMeshGui.cpp index 25a870952a..2e96e210ba 100644 --- a/src/Mod/Mesh/Gui/AppMeshGui.cpp +++ b/src/Mod/Mesh/Gui/AppMeshGui.cpp @@ -153,7 +153,7 @@ PyMOD_INIT_FUNC(MeshGui) if (qApp) { (void)new MeshGui::CleanupHandler; } - + // try to instantiate flat-mesh commands try{ Base::Interpreter().runString("import MeshFlatteningCommand"); diff --git a/src/Mod/Mesh/Gui/Command.cpp b/src/Mod/Mesh/Gui/Command.cpp index 210a679a1a..81a8abe0e9 100644 --- a/src/Mod/Mesh/Gui/Command.cpp +++ b/src/Mod/Mesh/Gui/Command.cpp @@ -112,8 +112,8 @@ void CmdMeshTransform::activated(int) doCommand(Doc,"App.activeDocument().addObject(\"Mesh::Transform\",\"%s\")",fName.c_str()); doCommand(Doc,"App.activeDocument().%s.Source = App.activeDocument().%s",fName.c_str(),cSel[0].FeatName); doCommand(Gui,"Gui.hide(\"%s\")",cSel[0].FeatName); - commitCommand(); - + commitCommand(); + updateActive(); } @@ -152,8 +152,8 @@ void CmdMeshDemolding::activated(int) doCommand(Doc,"App.activeDocument().addObject(\"Mesh::TransformDemolding\",\"%s\")",fName.c_str()); doCommand(Doc,"App.activeDocument().%s.Source = App.activeDocument().%s",fName.c_str(),cSel[0].FeatName); doCommand(Gui,"Gui.hide(\"%s\")",cSel[0].FeatName); - commitCommand(); - + commitCommand(); + updateActive(); } diff --git a/src/Mod/Mesh/Gui/DlgEvaluateMeshImp.cpp b/src/Mod/Mesh/Gui/DlgEvaluateMeshImp.cpp index 4c155732ab..fdb2e802d5 100644 --- a/src/Mod/Mesh/Gui/DlgEvaluateMeshImp.cpp +++ b/src/Mod/Mesh/Gui/DlgEvaluateMeshImp.cpp @@ -249,7 +249,7 @@ void DlgEvaluateMeshImp::slotDeletedDocument(const App::Document& Doc) delete it->second; } - d->vp.clear(); + d->vp.clear(); // try to attach to the active document this->detachDocument(); @@ -263,7 +263,7 @@ void DlgEvaluateMeshImp::setMesh(Mesh::Feature* m) App::Document* doc = m->getDocument(); if (doc != getDocument()) attachDocument(doc); - + refreshList(); int ct = d->ui.meshNameButton->count(); @@ -493,7 +493,7 @@ void DlgEvaluateMeshImp::on_repairOrientationButton_clicked() doc->commitCommand(); doc->getDocument()->recompute(); - + d->ui.repairOrientationButton->setEnabled(false); d->ui.checkOrientationButton->setChecked(false); removeViewProvider( "MeshGui::ViewProviderMeshOrientation" ); @@ -595,7 +595,7 @@ void DlgEvaluateMeshImp::on_repairNonmanifoldsButton_clicked() , "App.getDocument(\"%s\").getObject(\"%s\").removeNonManifoldPoints()" , docName, objName); } - } + } catch (const Base::Exception& e) { QMessageBox::warning(this, tr("Non-manifolds"), QString::fromLatin1(e.what())); } @@ -605,7 +605,7 @@ void DlgEvaluateMeshImp::on_repairNonmanifoldsButton_clicked() doc->commitCommand(); doc->getDocument()->recompute(); - + d->ui.repairNonmanifoldsButton->setEnabled(false); d->ui.checkNonmanifoldsButton->setChecked(false); removeViewProvider("MeshGui::ViewProviderMeshNonManifolds"); @@ -636,7 +636,7 @@ void DlgEvaluateMeshImp::on_analyzeIndicesButton_clicked() MeshEvalRangePoint rp(rMesh); MeshEvalCorruptedFacets cf(rMesh); MeshEvalNeighbourhood nb(rMesh); - + if (!rf.Evaluate()) { d->ui.checkIndicesButton->setText(tr("Invalid face indices")); d->ui.checkIndicesButton->setChecked(true); @@ -695,7 +695,7 @@ void DlgEvaluateMeshImp::on_repairIndicesButton_clicked() doc->commitCommand(); doc->getDocument()->recompute(); - + d->ui.repairIndicesButton->setEnabled(false); d->ui.checkIndicesButton->setChecked(false); removeViewProvider("MeshGui::ViewProviderMeshIndices"); @@ -723,7 +723,7 @@ void DlgEvaluateMeshImp::on_analyzeDegeneratedButton_clicked() const MeshKernel& rMesh = d->meshFeature->Mesh.getValue().getKernel(); MeshEvalDegeneratedFacets eval(rMesh, d->epsilonDegenerated); std::vector degen = eval.GetIndices(); - + if (degen.empty()) { d->ui.checkDegenerationButton->setText(tr("No degenerations")); d->ui.checkDegenerationButton->setChecked(false); @@ -789,7 +789,7 @@ void DlgEvaluateMeshImp::on_analyzeDuplicatedFacesButton_clicked() const MeshKernel& rMesh = d->meshFeature->Mesh.getValue().getKernel(); MeshEvalDuplicateFacets eval(rMesh); std::vector dupl = eval.GetIndices(); - + if (dupl.empty()) { d->ui.checkDuplicatedFacesButton->setText(tr("No duplicated faces")); d->ui.checkDuplicatedFacesButton->setChecked(false); @@ -828,7 +828,7 @@ void DlgEvaluateMeshImp::on_repairDuplicatedFacesButton_clicked() doc->commitCommand(); doc->getDocument()->recompute(); - + d->ui.repairDuplicatedFacesButton->setEnabled(false); d->ui.checkDuplicatedFacesButton->setChecked(false); removeViewProvider("MeshGui::ViewProviderMeshDuplicatedFaces"); @@ -855,7 +855,7 @@ void DlgEvaluateMeshImp::on_analyzeDuplicatedPointsButton_clicked() const MeshKernel& rMesh = d->meshFeature->Mesh.getValue().getKernel(); MeshEvalDuplicatePoints eval(rMesh); - + if (eval.Evaluate()) { d->ui.checkDuplicatedPointsButton->setText(tr("No duplicated points")); d->ui.checkDuplicatedPointsButton->setChecked(false); @@ -893,7 +893,7 @@ void DlgEvaluateMeshImp::on_repairDuplicatedPointsButton_clicked() doc->commitCommand(); doc->getDocument()->recompute(); - + d->ui.repairDuplicatedPointsButton->setEnabled(false); d->ui.checkDuplicatedPointsButton->setChecked(false); removeViewProvider("MeshGui::ViewProviderMeshDuplicatedPoints"); @@ -983,7 +983,7 @@ void DlgEvaluateMeshImp::on_repairSelfIntersectionButton_clicked() doc->commitCommand(); doc->getDocument()->recompute(); - + d->ui.repairSelfIntersectionButton->setEnabled(false); d->ui.checkSelfIntersectionButton->setChecked(false); removeViewProvider("MeshGui::ViewProviderMeshSelfIntersections"); @@ -1015,7 +1015,7 @@ void DlgEvaluateMeshImp::on_analyzeFoldsButton_clicked() bool ok1 = s_eval.Evaluate(); bool ok2 = b_eval.Evaluate(); bool ok3 = f_eval.Evaluate(); - + if (ok1 && ok2 && ok3) { d->ui.checkFoldsButton->setText(tr("No folds on surface")); d->ui.checkFoldsButton->setChecked(false); @@ -1032,7 +1032,7 @@ void DlgEvaluateMeshImp::on_analyzeFoldsButton_clicked() // remove duplicates std::sort(inds.begin(), inds.end()); inds.erase(std::unique(inds.begin(), inds.end()), inds.end()); - + d->ui.checkFoldsButton->setText(tr("%1 folds on surface").arg(inds.size())); d->ui.checkFoldsButton->setChecked(true); d->ui.repairFoldsButton->setEnabled(true); @@ -1064,7 +1064,7 @@ void DlgEvaluateMeshImp::on_repairFoldsButton_clicked() doc->commitCommand(); doc->getDocument()->recompute(); - + qApp->restoreOverrideCursor(); d->ui.repairFoldsButton->setEnabled(false); d->ui.checkFoldsButton->setChecked(false); diff --git a/src/Mod/Mesh/Gui/DlgEvaluateMeshImp.h b/src/Mod/Mesh/Gui/DlgEvaluateMeshImp.h index eac2b12a1d..b2a6731f16 100644 --- a/src/Mod/Mesh/Gui/DlgEvaluateMeshImp.h +++ b/src/Mod/Mesh/Gui/DlgEvaluateMeshImp.h @@ -66,7 +66,7 @@ public Q_SLOTS: * \author Werner Mayer */ class DlgEvaluateMeshImp : public QDialog, public App::DocumentObserver -{ +{ Q_OBJECT public: @@ -144,7 +144,7 @@ private: * \author Werner Mayer */ class DockEvaluateMeshImp : public DlgEvaluateMeshImp -{ +{ Q_OBJECT protected: @@ -156,7 +156,7 @@ public: static DockEvaluateMeshImp* instance(); static void destruct(); static bool hasInstance(); - + QSize sizeHint () const override; private: diff --git a/src/Mod/Mesh/Gui/DlgSettingsImportExportImp.cpp b/src/Mod/Mesh/Gui/DlgSettingsImportExportImp.cpp index af042f4ba7..a3200dcfcc 100644 --- a/src/Mod/Mesh/Gui/DlgSettingsImportExportImp.cpp +++ b/src/Mod/Mesh/Gui/DlgSettingsImportExportImp.cpp @@ -50,7 +50,7 @@ void DlgSettingsImportExport::saveSettings() ("User parameter:BaseApp/Preferences/Mod/Mesh"); double value = ui->maxDeviationExport->value().getValue(); handle->SetFloat("MaxDeviationExport", value); - + ui->exportAmfCompressed->onSave(); ParameterGrp::handle asy = handle->GetGroup("Asymptote"); @@ -68,7 +68,7 @@ void DlgSettingsImportExport::loadSettings() double value = ui->maxDeviationExport->value().getValue(); value = handle->GetFloat("MaxDeviationExport", value); ui->maxDeviationExport->setValue(value); - + ui->exportAmfCompressed->onRestore(); ParameterGrp::handle asy = handle->GetGroup("Asymptote"); diff --git a/src/Mod/Mesh/Gui/DlgSettingsMeshView.cpp b/src/Mod/Mesh/Gui/DlgSettingsMeshView.cpp index dfcc930cec..93f2a2e111 100644 --- a/src/Mod/Mesh/Gui/DlgSettingsMeshView.cpp +++ b/src/Mod/Mesh/Gui/DlgSettingsMeshView.cpp @@ -42,7 +42,7 @@ DlgSettingsMeshView::DlgSettingsMeshView(QWidget* parent) ui->buttonBackfaceColor->hide(); } -/** +/** * Destroys the object and frees any allocated resources */ DlgSettingsMeshView::~DlgSettingsMeshView() diff --git a/src/Mod/Mesh/Gui/DlgSettingsMeshView.h b/src/Mod/Mesh/Gui/DlgSettingsMeshView.h index 68f209f178..f0ec2b2bea 100644 --- a/src/Mod/Mesh/Gui/DlgSettingsMeshView.h +++ b/src/Mod/Mesh/Gui/DlgSettingsMeshView.h @@ -38,7 +38,7 @@ class Ui_DlgSettingsMeshView; * @author Werner Mayer */ class DlgSettingsMeshView : public Gui::Dialog::PreferencePage -{ +{ Q_OBJECT public: diff --git a/src/Mod/Mesh/Gui/DlgSmoothing.cpp b/src/Mod/Mesh/Gui/DlgSmoothing.cpp index afcd142420..f87c0698be 100644 --- a/src/Mod/Mesh/Gui/DlgSmoothing.cpp +++ b/src/Mod/Mesh/Gui/DlgSmoothing.cpp @@ -121,7 +121,7 @@ SmoothingDialog::SmoothingDialog(QWidget* parent, Qt::WindowFlags fl) QVBoxLayout* hboxLayout = new QVBoxLayout(this); QDialogButtonBox* buttonBox = new QDialogButtonBox(this); buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok); - + connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())); connect(buttonBox, SIGNAL(rejected()), diff --git a/src/Mod/Mesh/Gui/Doxygen.cpp b/src/Mod/Mesh/Gui/Doxygen.cpp index 8c71b41ff6..3b0465cba4 100644 --- a/src/Mod/Mesh/Gui/Doxygen.cpp +++ b/src/Mod/Mesh/Gui/Doxygen.cpp @@ -30,4 +30,4 @@ - Tree and so on...... -*/ +*/ diff --git a/src/Mod/Mesh/Gui/MeshEditor.cpp b/src/Mod/Mesh/Gui/MeshEditor.cpp index 47507f1232..200504119a 100644 --- a/src/Mod/Mesh/Gui/MeshEditor.cpp +++ b/src/Mod/Mesh/Gui/MeshEditor.cpp @@ -289,7 +289,7 @@ void MeshFaceAddition::showMarker(SoPickedPoint* pp) int face_index = fd->getFaceIndex(); if (face_index >= (int)facets.size()) return; - // is a border facet picked? + // is a border facet picked? MeshCore::MeshFacet f = facets[face_index]; if (!f.HasOpenEdge()) { // check if a neighbour facet is at the border diff --git a/src/Mod/Mesh/Gui/PreCompiled.cpp b/src/Mod/Mesh/Gui/PreCompiled.cpp index 77271b1de5..ccf2b83403 100644 --- a/src/Mod/Mesh/Gui/PreCompiled.cpp +++ b/src/Mod/Mesh/Gui/PreCompiled.cpp @@ -21,4 +21,4 @@ ***************************************************************************/ -#include "PreCompiled.h" +#include "PreCompiled.h" diff --git a/src/Mod/Mesh/Gui/PreCompiled.h b/src/Mod/Mesh/Gui/PreCompiled.h index a90d9e31f9..cfd06bee8f 100644 --- a/src/Mod/Mesh/Gui/PreCompiled.h +++ b/src/Mod/Mesh/Gui/PreCompiled.h @@ -82,4 +82,4 @@ #include #endif //_PreComp_ -#endif // MESHGUI_PRECOMPILED_H +#endif // MESHGUI_PRECOMPILED_H diff --git a/src/Mod/Mesh/Gui/RemoveComponents.cpp b/src/Mod/Mesh/Gui/RemoveComponents.cpp index fc23a0b491..bf739b2a05 100644 --- a/src/Mod/Mesh/Gui/RemoveComponents.cpp +++ b/src/Mod/Mesh/Gui/RemoveComponents.cpp @@ -175,7 +175,7 @@ RemoveComponentsDialog::RemoveComponentsDialog(QWidget* parent, Qt::WindowFlags okButton->setText(MeshGui::TaskRemoveComponents::tr("Delete")); buttonBox->addButton(MeshGui::TaskRemoveComponents::tr("Invert"), QDialogButtonBox::ActionRole); - + connect(buttonBox, SIGNAL(clicked(QAbstractButton*)), this, SLOT(clicked(QAbstractButton*))); diff --git a/src/Mod/Mesh/Gui/SoFCIndexedFaceSet.cpp b/src/Mod/Mesh/Gui/SoFCIndexedFaceSet.cpp index 43c00033f4..7759676088 100644 --- a/src/Mod/Mesh/Gui/SoFCIndexedFaceSet.cpp +++ b/src/Mod/Mesh/Gui/SoFCIndexedFaceSet.cpp @@ -386,7 +386,7 @@ void MeshRenderer::generateGLArrays(SoGLRenderAction* action, SoMaterialBindingE // ================================================ // drawCoords (every 4th vertex) | 20.0 // renderCoordsGLArray (all vertexes) | 20.0 -// +// void MeshRenderer::renderCoordsGLArray(SoGLRenderAction *action) { p->renderCoordsGLArray(action); diff --git a/src/Mod/Mesh/Gui/SoFCMeshFaceSet.cpp b/src/Mod/Mesh/Gui/SoFCMeshFaceSet.cpp index 8b43ff947a..d6100bb62e 100644 --- a/src/Mod/Mesh/Gui/SoFCMeshFaceSet.cpp +++ b/src/Mod/Mesh/Gui/SoFCMeshFaceSet.cpp @@ -173,14 +173,14 @@ SbBool SoSFMeshFacetArray::readValue(SoInput *in) MeshCore::MeshKernel mesh; // Let the mesh kernel restore the neighbourhoods of the facets for us mesh.Adopt(vertex, *value, true); - // Give us back the face data + // Give us back the face data mesh.Adopt(vertex, *value, false); // We need to trigger the notification chain here, as this function // can be used on a node in a scene graph in any state -- not only // during initial scene graph import. this->valueChanged(); - + return TRUE; } @@ -384,7 +384,7 @@ void SoFCMeshFacet::getPrimitiveCount(SoGetPrimitiveCountAction * action) * \brief The SoFCMeshNode class is designed to render huge meshes. * * The SoFCMeshNode is an Inventor shape node that is designed to render huge meshes. If the mesh exceeds a certain number of triangles - * and the user does some intersections (e.g. moving, rotating, zooming, spinning, etc.) with the mesh then the GLRender() method renders + * and the user does some intersections (e.g. moving, rotating, zooming, spinning, etc.) with the mesh then the GLRender() method renders * only the gravity points of a subset of the triangles. * If there is no user interaction with the mesh then all triangles are rendered. * The limit of maximum allowed triangles can be specified in \a MaximumTriangles, the default value is set to 100.000. @@ -397,30 +397,30 @@ void SoFCMeshFacet::getPrimitiveCount(SoGetPrimitiveCountAction * action) */ // Helper functions: draw vertices -inline void glVertex(const MeshCore::MeshPoint& _v) -{ +inline void glVertex(const MeshCore::MeshPoint& _v) +{ float v[3]; v[0]=_v.x; v[1]=_v.y;v[2]=_v.z; - glVertex3fv(v); + glVertex3fv(v); } // Helper functions: draw normal inline void glNormal(const Base::Vector3f& _n) -{ +{ float n[3]; n[0]=_n.x; n[1]=_n.y;n[2]=_n.z; - glNormal3fv(n); + glNormal3fv(n); } // Helper functions: draw normal inline void glNormal(float* n) -{ - glNormal3fv(n); +{ + glNormal3fv(n); } // Helper function: convert Vec to SbVec3f inline SbVec3f sbvec3f(const Base::Vector3f& _v) { - return SbVec3f(_v.x, _v.y, _v.z); + return SbVec3f(_v.x, _v.y, _v.z); } SO_NODE_SOURCE(SoFCMeshFaceSet); @@ -442,13 +442,13 @@ void SoFCMeshFaceSet::notify(SoNotList * node) } /** - * Creates a rough proxy mesh model from the original data attached to a grid in case \a simplest is false. The number of grids + * Creates a rough proxy mesh model from the original data attached to a grid in case \a simplest is false. The number of grids * in each direction doesn't exceed 50. * If \a simplest is true then the model is built from the bounding box instead. * - * For every move event the complete data set must be iterated to refresh internal Inventor data @see generatePrimitives(). - * Doing this very often for very huge data sets slows down the system noticeably. Using a rough model as proxy instead of the original - * data set can speed up the user interaction extremely. + * For every move event the complete data set must be iterated to refresh internal Inventor data @see generatePrimitives(). + * Doing this very often for very huge data sets slows down the system noticeably. Using a rough model as proxy instead of the original + * data set can speed up the user interaction extremely. * @note The proxy will never be displayed. It's just used for the picking mechanism. * @note The usage of the proxy might be confusing a little bit due to the fact that some details get lost. So it'll be possible * to pick the data set where no data seem to be. @@ -490,7 +490,7 @@ void SoFCMeshFaceSet::createProxyModel(const MeshCore::MeshPointArray* rPoints, // Check the boundings and the average edge length float fAvgLen = 5.0f * MeshCore::MeshAlgorithm(mesh).GetAverageEdgeLength(); - // create maximum 50 grids in each direction + // create maximum 50 grids in each direction fAvgLen = std::max(fAvgLen, (cBox.MaxX-cBox.MinX)/50.0f); fAvgLen = std::max(fAvgLen, (cBox.MaxY-cBox.MinY)/50.0f); fAvgLen = std::max(fAvgLen, (cBox.MaxZ-cBox.MinZ)/50.0f); @@ -624,9 +624,9 @@ void SoFCMeshFaceSet::GLRender(SoGLRenderAction *action) SbBool needNormals = !mb.isColorOnly()/* || tb.isFunction()*/; mb.sendFirst(); // make sure we have the correct material - + SbBool ccw = TRUE; - if (SoShapeHintsElement::getVertexOrdering(state) == SoShapeHintsElement::CLOCKWISE) + if (SoShapeHintsElement::getVertexOrdering(state) == SoShapeHintsElement::CLOCKWISE) ccw = FALSE; if ( mode == false || index->size() <= this->MaximumTriangles ) { @@ -680,7 +680,7 @@ SoFCMeshFaceSet::Binding SoFCMeshFaceSet::findMaterialBinding(SoState * const st * FIXME: Do it the same way as Coin did to have only one implementation which is controlled by defines * FIXME: Implement using different values of transparency for each vertex or face */ -void SoFCMeshFaceSet::drawFaces(const MeshCore::MeshPointArray * rPoints, const MeshCore::MeshFacetArray* rFacets, +void SoFCMeshFaceSet::drawFaces(const MeshCore::MeshPointArray * rPoints, const MeshCore::MeshFacetArray* rFacets, SoMaterialBundle* mb, Binding bind, SbBool needNormals, SbBool ccw) const { bool perVertex = (mb && bind == PER_VERTEX_INDEXED); @@ -702,7 +702,7 @@ void SoFCMeshFaceSet::drawFaces(const MeshCore::MeshPointArray * rPoints, const n[0] = (v1.y-v0.y)*(v2.z-v0.z)-(v1.z-v0.z)*(v2.y-v0.y); n[1] = (v1.z-v0.z)*(v2.x-v0.x)-(v1.x-v0.x)*(v2.z-v0.z); n[2] = (v1.x-v0.x)*(v2.y-v0.y)-(v1.y-v0.y)*(v2.x-v0.x); - + if(perFace) mb->send(it-rFacets->begin(), TRUE); glNormal(n); @@ -729,7 +729,7 @@ void SoFCMeshFaceSet::drawFaces(const MeshCore::MeshPointArray * rPoints, const n[0] = -((v1.y-v0.y)*(v2.z-v0.z)-(v1.z-v0.z)*(v2.y-v0.y)); n[1] = -((v1.z-v0.z)*(v2.x-v0.x)-(v1.x-v0.x)*(v2.z-v0.z)); n[2] = -((v1.x-v0.x)*(v2.y-v0.y)-(v1.y-v0.y)*(v2.x-v0.x)); - + glNormal(n); glVertex(v0); glVertex(v1); @@ -738,7 +738,7 @@ void SoFCMeshFaceSet::drawFaces(const MeshCore::MeshPointArray * rPoints, const } glEnd(); } - else + else { glBegin(GL_TRIANGLES); for ( MeshCore::MeshFacetArray::_TConstIterator it = rFacets->begin(); it != rFacets->end(); ++it ) @@ -754,7 +754,7 @@ void SoFCMeshFaceSet::drawFaces(const MeshCore::MeshPointArray * rPoints, const /** * Renders the gravity points of a subset of triangles. */ -void SoFCMeshFaceSet::drawPoints(const MeshCore::MeshPointArray * rPoints, +void SoFCMeshFaceSet::drawPoints(const MeshCore::MeshPointArray * rPoints, const MeshCore::MeshFacetArray* rFacets, SbBool needNormals, SbBool ccw) const { int mod = rFacets->size()/MaximumTriangles+1; @@ -779,7 +779,7 @@ void SoFCMeshFaceSet::drawPoints(const MeshCore::MeshPointArray * rPoints, n[0] = (v1.y-v0.y)*(v2.z-v0.z)-(v1.z-v0.z)*(v2.y-v0.y); n[1] = (v1.z-v0.z)*(v2.x-v0.x)-(v1.x-v0.x)*(v2.z-v0.z); n[2] = (v1.x-v0.x)*(v2.y-v0.y)-(v1.y-v0.y)*(v2.x-v0.x); - + // Calculate the center point p=(v0+v1+v2)/3 float p[3]; p[0] = (v0.x+v1.x+v2.x)/3.0f; @@ -802,7 +802,7 @@ void SoFCMeshFaceSet::drawPoints(const MeshCore::MeshPointArray * rPoints, n[0] = -((v1.y-v0.y)*(v2.z-v0.z)-(v1.z-v0.z)*(v2.y-v0.y)); n[1] = -((v1.z-v0.z)*(v2.x-v0.x)-(v1.x-v0.x)*(v2.z-v0.z)); n[2] = -((v1.x-v0.x)*(v2.y-v0.y)-(v1.y-v0.y)*(v2.x-v0.x)); - + // Calculate the center point p=(v0+v1+v2)/3 float p[3]; p[0] = (v0.x+v1.x+v2.x)/3.0f; @@ -815,7 +815,7 @@ void SoFCMeshFaceSet::drawPoints(const MeshCore::MeshPointArray * rPoints, } glEnd(); } - else + else { glBegin(GL_POINTS); int ct=0; @@ -882,7 +882,7 @@ void SoFCMeshFaceSet::generatePrimitives(SoAction* action) // In case we have too many triangles we just create a rough model of the original mesh if ( this->MaximumTriangles < rFacets->size() ) { // We notify this shape when the data has changed because just counting the number of triangles won't always work. - // + // if ( meshChanged ) { try { createProxyModel(rPoints, rFacets, FALSE); @@ -901,14 +901,14 @@ void SoFCMeshFaceSet::generatePrimitives(SoAction* action) } SoPrimitiveVertex vertex; beginShape(action, TRIANGLES, 0); - try + try { int i=0; while ( ibegin(); it != rFacets->end(); ++it ) { @@ -1107,10 +1107,10 @@ void SoFCMeshOpenEdgeSet::GLRender(SoGLRenderAction *action) /** * Renders the triangles of the complete mesh. */ -void SoFCMeshOpenEdgeSet::drawLines(const MeshCore::MeshPointArray * rPoints, +void SoFCMeshOpenEdgeSet::drawLines(const MeshCore::MeshPointArray * rPoints, const MeshCore::MeshFacetArray* rFacets) const { - // When rendering open edges use the given line width * 3 + // When rendering open edges use the given line width * 3 GLfloat lineWidth; glGetFloatv(GL_LINE_WIDTH, &lineWidth); glLineWidth(3.0f*lineWidth); @@ -1202,7 +1202,7 @@ void SoFCMeshOpenEdgeSet::getPrimitiveCount(SoGetPrimitiveCountAction * action) return; SoState* state = action->getState(); const MeshCore::MeshFacetArray * rFaces = SoFCMeshFacetElement::get(state); - + // Count number of open edges first int ctEdges=0; for ( MeshCore::MeshFacetArray::_TConstIterator jt = rFaces->begin(); jt != rFaces->end(); ++jt ) { diff --git a/src/Mod/Mesh/Gui/SoFCMeshFaceSet.h b/src/Mod/Mesh/Gui/SoFCMeshFaceSet.h index a418231b93..a27ba0bead 100644 --- a/src/Mod/Mesh/Gui/SoFCMeshFaceSet.h +++ b/src/Mod/Mesh/Gui/SoFCMeshFaceSet.h @@ -108,13 +108,13 @@ protected: /** * \brief The SoFCMeshFaceSet class renders the mesh data structure. - * It does basically the same as SoFCMeshNode by rendering directly the FreeCAD mesh structure whereas this class follows more the Inventor way. - * While SoFCMeshFaceSet has a pointer to the mesh structure as a whole for SoFCMeshFaceSet the mesh is split into two nodes: + * It does basically the same as SoFCMeshNode by rendering directly the FreeCAD mesh structure whereas this class follows more the Inventor way. + * While SoFCMeshFaceSet has a pointer to the mesh structure as a whole for SoFCMeshFaceSet the mesh is split into two nodes: * an SoFCMeshVertex has a field that holds a pointer to vertex array and SoFCMeshFacet has a field that holds a pointer to the face array. * - * The advantage of separating the mesh structure is higher flexibility. E.g. to render open edges the class SoFCMeshOpenEdgeSet just takes the - * SoFCMeshVertex and SoFCMeshFaceSet nodes from the stack and does the rendering. The client programmer just has to add the an SoFCMeshOpenEdgeSet - * instance to the Inventor tree -- nothing more. Another advantage is that memory is saved when writing the scene to a file. + * The advantage of separating the mesh structure is higher flexibility. E.g. to render open edges the class SoFCMeshOpenEdgeSet just takes the + * SoFCMeshVertex and SoFCMeshFaceSet nodes from the stack and does the rendering. The client programmer just has to add the an SoFCMeshOpenEdgeSet + * instance to the Inventor tree -- nothing more. Another advantage is that memory is saved when writing the scene to a file. * The actual data is only hold and written by SoFCMeshVertex and SoFCMeshFaceSet. Normally, no shape nodes have to save further data to the file. * @author Werner Mayer */ @@ -122,7 +122,7 @@ class MeshGuiExport SoFCMeshFaceSet : public SoShape { using inherited = SoShape; SO_NODE_HEADER(SoFCMeshFaceSet); - + public: static void initClass(); SoFCMeshFaceSet(); @@ -155,7 +155,7 @@ private: virtual void notify(SoNotList * list); Binding findMaterialBinding(SoState * const state) const; // Draw faces - void drawFaces(const MeshCore::MeshPointArray *, const MeshCore::MeshFacetArray*, SoMaterialBundle* mb, Binding bind, + void drawFaces(const MeshCore::MeshPointArray *, const MeshCore::MeshFacetArray*, SoMaterialBundle* mb, Binding bind, SbBool needNormals, SbBool ccw) const; void drawPoints(const MeshCore::MeshPointArray *, const MeshCore::MeshFacetArray*, SbBool needNormals, SbBool ccw) const; unsigned int countTriangles(SoAction * action) const; @@ -173,7 +173,7 @@ class MeshGuiExport SoFCMeshOpenEdgeSet : public SoShape { using inherited = SoShape; SO_NODE_HEADER(SoFCMeshOpenEdgeSet); - + public: static void initClass(); SoFCMeshOpenEdgeSet(); diff --git a/src/Mod/Mesh/Gui/SoFCMeshNode.cpp b/src/Mod/Mesh/Gui/SoFCMeshNode.cpp index c9ce17bd4c..7bc47fab2b 100644 --- a/src/Mod/Mesh/Gui/SoFCMeshNode.cpp +++ b/src/Mod/Mesh/Gui/SoFCMeshNode.cpp @@ -63,7 +63,7 @@ using namespace MeshGui; * \brief The SoFCMeshNode class is designed to render huge meshes. * * The SoFCMeshNode is an Inventor shape node that is designed to render huge meshes. If the mesh exceeds a certain number of triangles - * and the user does some intersections (e.g. moving, rotating, zooming, spinning, etc.) with the mesh then the GLRender() method renders + * and the user does some intersections (e.g. moving, rotating, zooming, spinning, etc.) with the mesh then the GLRender() method renders * only the gravity points of a subset of the triangles. * If there is no user interaction with the mesh then all triangles are rendered. * The limit of maximum allowed triangles can be specified in \a MaximumTriangles, the default value is set to 500.000. @@ -76,30 +76,30 @@ using namespace MeshGui; */ // Helper functions: draw vertices -inline void glVertex(const MeshCore::MeshPoint& _v) -{ +inline void glVertex(const MeshCore::MeshPoint& _v) +{ float v[3]; v[0]=_v.x; v[1]=_v.y;v[2]=_v.z; - glVertex3fv(v); + glVertex3fv(v); } // Helper functions: draw normal inline void glNormal(const Base::Vector3f& _n) -{ +{ float n[3]; n[0]=_n.x; n[1]=_n.y;n[2]=_n.z; - glNormal3fv(n); + glNormal3fv(n); } // Helper functions: draw normal inline void glNormal(float* n) -{ - glNormal3fv(n); +{ + glNormal3fv(n); } // Helper function: convert Vec to SbVec3f inline SbVec3f sbvec3f(const Base::Vector3f& _v) { - return SbVec3f(_v.x, _v.y, _v.z); + return SbVec3f(_v.x, _v.y, _v.z); } SO_NODE_SOURCE(SoFCMeshNode); @@ -125,18 +125,18 @@ void SoFCMeshNode::notify(SoNotList * node) * Sets the mesh. */ void SoFCMeshNode::setMesh(const Mesh::MeshObject* mesh) -{ - _mesh = mesh; +{ + _mesh = mesh; } /** - * Creates a rough mesh model from the original data attached to a grid in case \a simplest is false. The number of grids + * Creates a rough mesh model from the original data attached to a grid in case \a simplest is false. The number of grids * in each direction doesn't exceed 50. * If \a simplest is true then the model is built from the bounding box instead. * - * For every move event the complete data set must be iterated to refresh internal Inventor data @see generatePrimitives(). - * Doing this very often for very huge data sets slows down the system noticeably. Using a rough model as proxy instead of the original - * data set can speed up the user interaction extremely. + * For every move event the complete data set must be iterated to refresh internal Inventor data @see generatePrimitives(). + * Doing this very often for very huge data sets slows down the system noticeably. Using a rough model as proxy instead of the original + * data set can speed up the user interaction extremely. * @note The proxy will never be displayed. It's just used for the picking mechanism. * @note The usage of the proxy might be confusing a little bit due to the fact that some details get lost. So it'll be possible * to pick the data set where no data seem to be. @@ -171,7 +171,7 @@ void SoFCMeshNode::createRoughModel(bool simplest) // Check the boundings and the average edge length float fAvgLen = 5.0f * MeshCore::MeshAlgorithm(_mesh->getKernel()).GetAverageEdgeLength(); - // create maximum 50 grids in each direction + // create maximum 50 grids in each direction fAvgLen = std::max(fAvgLen, (cBox.MaxX-cBox.MinX)/50.0f); fAvgLen = std::max(fAvgLen, (cBox.MaxY-cBox.MinY)/50.0f); fAvgLen = std::max(fAvgLen, (cBox.MaxZ-cBox.MinZ)/50.0f); @@ -305,7 +305,7 @@ void SoFCMeshNode::GLRender(SoGLRenderAction *action) mb.sendFirst(); // make sure we have the correct material //SbBool ccw = TRUE; - //if (SoShapeHintsElement::getVertexOrdering(state) == SoShapeHintsElement::CLOCKWISE) + //if (SoShapeHintsElement::getVertexOrdering(state) == SoShapeHintsElement::CLOCKWISE) // ccw = FALSE; if ( mode == false || countTriangles() <= this->MaximumTriangles ) @@ -342,7 +342,7 @@ void SoFCMeshNode::drawFaces(SbBool needNormals) const n[0] = (v1.y-v0.y)*(v2.z-v0.z)-(v1.z-v0.z)*(v2.y-v0.y); n[1] = (v1.z-v0.z)*(v2.x-v0.x)-(v1.x-v0.x)*(v2.z-v0.z); n[2] = (v1.x-v0.x)*(v2.y-v0.y)-(v1.y-v0.y)*(v2.x-v0.x); - + glNormal(n); glVertex(v0); glVertex(v1); @@ -350,7 +350,7 @@ void SoFCMeshNode::drawFaces(SbBool needNormals) const } glEnd(); } - else + else { glBegin(GL_TRIANGLES); for ( MeshCore::MeshFacetArray::_TConstIterator it = rFacets.begin(); it != rFacets.end(); ++it ) @@ -393,7 +393,7 @@ void SoFCMeshNode::drawPoints(SbBool needNormals) const n[0] = (v1.y-v0.y)*(v2.z-v0.z)-(v1.z-v0.z)*(v2.y-v0.y); n[1] = (v1.z-v0.z)*(v2.x-v0.x)-(v1.x-v0.x)*(v2.z-v0.z); n[2] = (v1.x-v0.x)*(v2.y-v0.y)-(v1.y-v0.y)*(v2.x-v0.x); - + // Calculate the center point p=(v0+v1+v2)/3 float p[3]; p[0] = (v0.x+v1.x+v2.x)/3.0f; @@ -405,7 +405,7 @@ void SoFCMeshNode::drawPoints(SbBool needNormals) const } glEnd(); } - else + else { glBegin(GL_POINTS); int ct=0; @@ -454,9 +454,9 @@ void SoFCMeshNode::generatePrimitives(SoAction* action) int i=0; while ( igetOutput(); if (out->getStage() == SoOutput::COUNT_REFS) { @@ -663,8 +663,8 @@ SoFCMeshOpenEdge::SoFCMeshOpenEdge() : _mesh(0) * Sets the mesh. */ void SoFCMeshOpenEdge::setMesh(const Mesh::MeshObject* mesh) -{ - _mesh = mesh; +{ + _mesh = mesh; } /** @@ -698,7 +698,7 @@ void SoFCMeshOpenEdge::drawLines() const const MeshCore::MeshPointArray& rPoints = _mesh->getKernel().GetPoints(); const MeshCore::MeshFacetArray& rFacets = _mesh->getKernel().GetFacets(); - // When rendering open edges use the given line width * 3 + // When rendering open edges use the given line width * 3 GLfloat lineWidth; glGetFloatv(GL_LINE_WIDTH, &lineWidth); glLineWidth(3.0f*lineWidth); @@ -748,7 +748,7 @@ void SoFCMeshOpenEdge::getPrimitiveCount(SoGetPrimitiveCountAction * action) { if (!this->shouldPrimitiveCount(action)) return; - + // Count number of open edges first int ctEdges=0; diff --git a/src/Mod/Mesh/Gui/SoFCMeshNode.h b/src/Mod/Mesh/Gui/SoFCMeshNode.h index b4c57d8904..e7ecae3d1f 100644 --- a/src/Mod/Mesh/Gui/SoFCMeshNode.h +++ b/src/Mod/Mesh/Gui/SoFCMeshNode.h @@ -83,7 +83,7 @@ class MeshGuiExport SoFCMeshOpenEdge : public SoShape { using inherited = SoShape; SO_NODE_HEADER(SoFCMeshOpenEdge); - + public: static void initClass(); SoFCMeshOpenEdge(); diff --git a/src/Mod/Mesh/Gui/SoFCMeshObject.cpp b/src/Mod/Mesh/Gui/SoFCMeshObject.cpp index b5ca99e379..7a7844c929 100644 --- a/src/Mod/Mesh/Gui/SoFCMeshObject.cpp +++ b/src/Mod/Mesh/Gui/SoFCMeshObject.cpp @@ -563,11 +563,11 @@ void SoFCMeshObjectNode::getPrimitiveCount(SoGetPrimitiveCountAction * action) } // Helper functions: draw vertices -inline void glVertex(const MeshCore::MeshPoint& _v) +inline void glVertex(const MeshCore::MeshPoint& _v) { float v[3]; v[0]=_v.x; v[1]=_v.y;v[2]=_v.z; - glVertex3fv(v); + glVertex3fv(v); } // Helper functions: draw normal @@ -575,19 +575,19 @@ inline void glNormal(const Base::Vector3f& _n) { float n[3]; n[0]=_n.x; n[1]=_n.y;n[2]=_n.z; - glNormal3fv(n); + glNormal3fv(n); } // Helper functions: draw normal inline void glNormal(float* n) { - glNormal3fv(n); + glNormal3fv(n); } // Helper function: convert Vec to SbVec3f inline SbVec3f sbvec3f(const Base::Vector3f& _v) { - return SbVec3f(_v.x, _v.y, _v.z); + return SbVec3f(_v.x, _v.y, _v.z); } SO_NODE_SOURCE(SoFCMeshObjectShape) @@ -644,9 +644,9 @@ void SoFCMeshObjectShape::GLRender(SoGLRenderAction *action) SbBool needNormals = !mb.isColorOnly()/* || tb.isFunction()*/; mb.sendFirst(); // make sure we have the correct material - + SbBool ccw = true; - if (SoShapeHintsElement::getVertexOrdering(state) == SoShapeHintsElement::CLOCKWISE) + if (SoShapeHintsElement::getVertexOrdering(state) == SoShapeHintsElement::CLOCKWISE) ccw = false; if (!mode || mesh->countFacets() <= this->renderTriangleLimit) { @@ -739,7 +739,7 @@ void SoFCMeshObjectShape::drawFaces(const Mesh::MeshObject * mesh, SoMaterialBun n[0] = (v1.y-v0.y)*(v2.z-v0.z)-(v1.z-v0.z)*(v2.y-v0.y); n[1] = (v1.z-v0.z)*(v2.x-v0.x)-(v1.x-v0.x)*(v2.z-v0.z); n[2] = (v1.x-v0.x)*(v2.y-v0.y)-(v1.y-v0.y)*(v2.x-v0.x); - + if(perFace) mb->send(it-rFacets.begin(), true); glNormal(n); @@ -841,7 +841,7 @@ void SoFCMeshObjectShape::drawPoints(const Mesh::MeshObject * mesh, SbBool needN n[0] = -((v1.y-v0.y)*(v2.z-v0.z)-(v1.z-v0.z)*(v2.y-v0.y)); n[1] = -((v1.z-v0.z)*(v2.x-v0.x)-(v1.x-v0.x)*(v2.z-v0.z)); n[2] = -((v1.x-v0.x)*(v2.y-v0.y)-(v1.y-v0.y)*(v2.x-v0.x)); - + // Calculate the center point p=(v0+v1+v2)/3 float p[3]; p[0] = (v0.x+v1.x+v2.x)/3.0f; @@ -1146,7 +1146,7 @@ void SoFCMeshObjectShape::generatePrimitives(SoAction* action) vertex.setDetail(&pointDetail); beginShape(action, TRIANGLES, &faceDetail); - try + try { for (MeshCore::MeshFacetArray::_TConstIterator it = rFacets.begin(); it != rFacets.end(); ++it) { @@ -1298,9 +1298,9 @@ void SoFCMeshSegmentShape::GLRender(SoGLRenderAction *action) SbBool needNormals = !mb.isColorOnly()/* || tb.isFunction()*/; mb.sendFirst(); // make sure we have the correct material - + SbBool ccw = true; - if (SoShapeHintsElement::getVertexOrdering(state) == SoShapeHintsElement::CLOCKWISE) + if (SoShapeHintsElement::getVertexOrdering(state) == SoShapeHintsElement::CLOCKWISE) ccw = false; if (!mode || mesh->countFacets() <= this->renderTriangleLimit) { @@ -1384,7 +1384,7 @@ void SoFCMeshSegmentShape::drawFaces(const Mesh::MeshObject * mesh, SoMaterialBu n[0] = (v1.y-v0.y)*(v2.z-v0.z)-(v1.z-v0.z)*(v2.y-v0.y); n[1] = (v1.z-v0.z)*(v2.x-v0.x)-(v1.x-v0.x)*(v2.z-v0.z); n[2] = (v1.x-v0.x)*(v2.y-v0.y)-(v1.y-v0.y)*(v2.x-v0.x); - + if(perFace) mb->send(*it, true); glNormal(n); @@ -1494,7 +1494,7 @@ void SoFCMeshSegmentShape::drawPoints(const Mesh::MeshObject * mesh, SbBool need n[0] = -((v1.y-v0.y)*(v2.z-v0.z)-(v1.z-v0.z)*(v2.y-v0.y)); n[1] = -((v1.z-v0.z)*(v2.x-v0.x)-(v1.x-v0.x)*(v2.z-v0.z)); n[2] = -((v1.x-v0.x)*(v2.y-v0.y)-(v1.y-v0.y)*(v2.x-v0.x)); - + // Calculate the center point p=(v0+v1+v2)/3 float p[3]; p[0] = (v0.x+v1.x+v2.x)/3.0f; @@ -1562,7 +1562,7 @@ void SoFCMeshSegmentShape::generatePrimitives(SoAction* action) vertex.setDetail(&pointDetail); beginShape(action, TRIANGLES, &faceDetail); - try + try { for (std::vector::const_iterator it = rSegm.begin(); it != rSegm.end(); ++it) { @@ -1643,7 +1643,7 @@ void SoFCMeshSegmentShape::computeBBox(SoAction *action, SbBox3f &box, SbVec3f & cBox.Add(rPoint[face._aulPoints[1]]); cBox.Add(rPoint[face._aulPoints[2]]); } - + box.setBounds(SbVec3f(cBox.MinX,cBox.MinY,cBox.MinZ), SbVec3f(cBox.MaxX,cBox.MaxY,cBox.MaxZ)); Base::Vector3f mid = cBox.GetCenter(); @@ -1713,7 +1713,7 @@ void SoFCMeshObjectBoundary::drawLines(const Mesh::MeshObject * mesh) const const MeshCore::MeshPointArray & rPoints = mesh->getKernel().GetPoints(); const MeshCore::MeshFacetArray & rFacets = mesh->getKernel().GetFacets(); - // When rendering open edges use the given line width * 3 + // When rendering open edges use the given line width * 3 GLfloat lineWidth; glGetFloatv(GL_LINE_WIDTH, &lineWidth); glLineWidth(3.0f*lineWidth); diff --git a/src/Mod/Mesh/Gui/SoFCMeshObject.h b/src/Mod/Mesh/Gui/SoFCMeshObject.h index 7da9e6e91f..8db16d0516 100644 --- a/src/Mod/Mesh/Gui/SoFCMeshObject.h +++ b/src/Mod/Mesh/Gui/SoFCMeshObject.h @@ -201,7 +201,7 @@ private: void notify(SoNotList * list) override; Binding findMaterialBinding(SoState * const state) const; // Draw faces - void drawFaces(const Mesh::MeshObject *, SoMaterialBundle* mb, Binding bind, + void drawFaces(const Mesh::MeshObject *, SoMaterialBundle* mb, Binding bind, SbBool needNormals, SbBool ccw) const; void drawPoints(const Mesh::MeshObject *, SbBool needNormals, SbBool ccw) const; unsigned int countTriangles(SoAction * action) const; @@ -255,7 +255,7 @@ private: ~SoFCMeshSegmentShape() override {} Binding findMaterialBinding(SoState * const state) const; // Draw faces - void drawFaces(const Mesh::MeshObject *, SoMaterialBundle* mb, Binding bind, + void drawFaces(const Mesh::MeshObject *, SoMaterialBundle* mb, Binding bind, SbBool needNormals, SbBool ccw) const; void drawPoints(const Mesh::MeshObject *, SbBool needNormals, SbBool ccw) const; }; diff --git a/src/Mod/Mesh/Gui/SoFCMeshVertex.cpp b/src/Mod/Mesh/Gui/SoFCMeshVertex.cpp index 61c711d5ac..bb75f4e7e7 100644 --- a/src/Mod/Mesh/Gui/SoFCMeshVertex.cpp +++ b/src/Mod/Mesh/Gui/SoFCMeshVertex.cpp @@ -149,7 +149,7 @@ SbBool SoSFMeshPointArray::readValue(SoInput *in) // can be used on a node in a scene graph in any state -- not only // during initial scene graph import. this->valueChanged(); - + return TRUE; } diff --git a/src/Mod/Mesh/Gui/ViewProvider.cpp b/src/Mod/Mesh/Gui/ViewProvider.cpp index f3a1141764..d26493d6e6 100644 --- a/src/Mod/Mesh/Gui/ViewProvider.cpp +++ b/src/Mod/Mesh/Gui/ViewProvider.cpp @@ -1526,7 +1526,7 @@ std::vector ViewProviderMesh::getVisibleFacets(const SbViewpor #endif } -void ViewProviderMesh::cutMesh(const std::vector& picked, +void ViewProviderMesh::cutMesh(const std::vector& picked, const Base::ViewProjMethod& proj, SbBool inner) { // Get the facet indices inside the tool mesh @@ -1535,7 +1535,7 @@ void ViewProviderMesh::cutMesh(const std::vector& picked, removeFacets(indices); } -void ViewProviderMesh::trimMesh(const std::vector& polygon, +void ViewProviderMesh::trimMesh(const std::vector& polygon, const Base::ViewProjMethod& proj, SbBool inner) { Mesh::MeshObject* mesh = static_cast(pcObject)->Mesh.startEditing(); @@ -1815,8 +1815,8 @@ void ViewProviderMesh::faceInfo(Mesh::FacetIndex uFacet) MeshCore::MeshFacet face = facets[uFacet]; MeshCore::MeshGeomFacet tria = rKernel.GetFacet(face); Base::Console().Message("Mesh: %s Facet %lu: Points: <%lu, %lu, %lu>, Neighbours: <%lu, %lu, %lu>\n" - "Triangle: <[%.6f, %.6f, %.6f], [%.6f, %.6f, %.6f], [%.6f, %.6f, %.6f]>\n", fea->getNameInDocument(), uFacet, - face._aulPoints[0], face._aulPoints[1], face._aulPoints[2], + "Triangle: <[%.6f, %.6f, %.6f], [%.6f, %.6f, %.6f], [%.6f, %.6f, %.6f]>\n", fea->getNameInDocument(), uFacet, + face._aulPoints[0], face._aulPoints[1], face._aulPoints[2], face._aulNeighbours[0], face._aulNeighbours[1], face._aulNeighbours[2], tria._aclPoints[0].x, tria._aclPoints[0].y, tria._aclPoints[0].z, tria._aclPoints[1].x, tria._aclPoints[1].y, tria._aclPoints[1].z, @@ -2355,9 +2355,9 @@ ViewProviderIndexedFaceSet::~ViewProviderIndexedFaceSet() { } -/** +/** * Extracts the mesh data from the feature \a pcFeature and creates - * an Inventor node \a SoNode with these data. + * an Inventor node \a SoNode with these data. */ void ViewProviderIndexedFaceSet::attach(App::DocumentObject *pcFeat) { diff --git a/src/Mod/Mesh/Gui/ViewProviderDefects.cpp b/src/Mod/Mesh/Gui/ViewProviderDefects.cpp index f5d2418deb..3dbea45a82 100644 --- a/src/Mod/Mesh/Gui/ViewProviderDefects.cpp +++ b/src/Mod/Mesh/Gui/ViewProviderDefects.cpp @@ -477,7 +477,7 @@ void ViewProviderMeshDegenerations::showDefects(const std::vector::const_iterator it = inds.begin(); it != inds.end(); ++it) { cF.Set(*it); - const MeshCore::MeshPoint& rE0 = cF->_aclPoints[0]; + const MeshCore::MeshPoint& rE0 = cF->_aclPoints[0]; const MeshCore::MeshPoint& rE1 = cF->_aclPoints[1]; const MeshCore::MeshPoint& rE2 = cF->_aclPoints[2]; @@ -645,7 +645,7 @@ void ViewProviderMeshSelfIntersections::showDefects(const std::vector(pcObject); const MeshCore::MeshKernel & rMesh = f->Mesh.getValue().getKernel(); MeshCore::MeshEvalSelfIntersection eval(rMesh); - + std::vector > intersection; std::vector::const_iterator it; for (it = indices.begin(); it != indices.end(); ) { diff --git a/src/Mod/Mesh/Gui/ViewProviderDefects.h b/src/Mod/Mesh/Gui/ViewProviderDefects.h index 57bb64cca4..776c93d9d4 100644 --- a/src/Mod/Mesh/Gui/ViewProviderDefects.h +++ b/src/Mod/Mesh/Gui/ViewProviderDefects.h @@ -60,7 +60,7 @@ protected: SoDrawStyle * pcDrawStyle; }; -/** The ViewProviderMeshOrientation class displays wrong oriented facets (i.e. flipped normals) in orange. +/** The ViewProviderMeshOrientation class displays wrong oriented facets (i.e. flipped normals) in orange. * @author Werner Mayer */ class MeshGuiExport ViewProviderMeshOrientation : public ViewProviderMeshDefects @@ -78,7 +78,7 @@ protected: SoFaceSet* pcFaces; }; -/** The ViewProviderMeshNonManifolds class displays edges with more than two faces attached in red. +/** The ViewProviderMeshNonManifolds class displays edges with more than two faces attached in red. * @author Werner Mayer */ class MeshGuiExport ViewProviderMeshNonManifolds : public ViewProviderMeshDefects @@ -96,7 +96,7 @@ protected: SoLineSet* pcLines; }; -/** The ViewProviderMeshNonManifoldPoints class displays non-manifold vertexes in red. +/** The ViewProviderMeshNonManifoldPoints class displays non-manifold vertexes in red. * @author Werner Mayer */ class MeshGuiExport ViewProviderMeshNonManifoldPoints : public ViewProviderMeshDefects @@ -114,7 +114,7 @@ protected: SoPointSet* pcPoints; }; -/** The ViewProviderMeshDuplicatedFaces class displays duplicated faces in red. +/** The ViewProviderMeshDuplicatedFaces class displays duplicated faces in red. * @author Werner Mayer */ class MeshGuiExport ViewProviderMeshDuplicatedFaces : public ViewProviderMeshDefects @@ -132,7 +132,7 @@ protected: SoFaceSet* pcFaces; }; -/** The ViewProviderMeshDegenerations class displays degenerated faces to a line or even a point in orange. +/** The ViewProviderMeshDegenerations class displays degenerated faces to a line or even a point in orange. * @author Werner Mayer */ class MeshGuiExport ViewProviderMeshDegenerations : public ViewProviderMeshDefects @@ -180,7 +180,7 @@ protected: SoFaceSet* pcFaces; }; -/** The ViewProviderMeshSelfIntersections class displays lines of self-intersections. +/** The ViewProviderMeshSelfIntersections class displays lines of self-intersections. * @author Werner Mayer */ class MeshGuiExport ViewProviderMeshSelfIntersections : public ViewProviderMeshDefects diff --git a/src/Mod/Mesh/Gui/ViewProviderMeshNode.cpp b/src/Mod/Mesh/Gui/ViewProviderMeshNode.cpp index d0d76e478c..45849a2efa 100644 --- a/src/Mod/Mesh/Gui/ViewProviderMeshNode.cpp +++ b/src/Mod/Mesh/Gui/ViewProviderMeshNode.cpp @@ -289,8 +289,8 @@ bool ViewProviderMeshNode::handleEvent(const SoEvent * const ev,Gui::View3DInven SbVec3f b,n; Viewer.getNearPlane(b, n); Base::Vector3f cPoint(b[0],b[1],b[2]), cNormal(n[0],n[1],n[2]); - SoCamera* pCam = Viewer.getCamera(); - SbViewVolume vol = pCam->getViewVolume (); + SoCamera* pCam = Viewer.getCamera(); + SbViewVolume vol = pCam->getViewVolume (); // create a tool shape from these points std::vector aFaces; @@ -309,7 +309,7 @@ bool ViewProviderMeshNode::handleEvent(const SoEvent * const ev,Gui::View3DInven meshProp.deleteFacetIndices( indices ); // update open edge display if needed -// if ( pcOpenEdge ) +// if ( pcOpenEdge ) // { // showOpenEdges(false); // showOpenEdges(true); @@ -336,7 +336,7 @@ void ViewProviderMeshNode::showOpenEdges(bool show) MeshGui::SoFCMeshOpenEdge* mesh = new MeshGui::SoFCMeshOpenEdge(); mesh->setMesh(meshFeature->Mesh.getValuePtr()); pcOpenEdge->addChild(mesh); - + // add to the highlight node pcHighlight->addChild(pcOpenEdge); } else if (pcOpenEdge) { diff --git a/src/Mod/Mesh/Gui/ViewProviderMeshNode.h b/src/Mod/Mesh/Gui/ViewProviderMeshNode.h index 9bea244afe..674cf48e4f 100644 --- a/src/Mod/Mesh/Gui/ViewProviderMeshNode.h +++ b/src/Mod/Mesh/Gui/ViewProviderMeshNode.h @@ -49,7 +49,7 @@ class MeshGuiExport ViewProviderMeshNode : public Gui::ViewProviderGeometryObjec public: ViewProviderMeshNode(); virtual ~ViewProviderMeshNode(); - + // Display properties App::PropertyFloatConstraint LineWidth; App::PropertyFloatConstraint PointSize; diff --git a/src/Mod/Mesh/Gui/ViewProviderTransform.cpp b/src/Mod/Mesh/Gui/ViewProviderTransform.cpp index 92871cdadf..3d44df4e90 100644 --- a/src/Mod/Mesh/Gui/ViewProviderTransform.cpp +++ b/src/Mod/Mesh/Gui/ViewProviderTransform.cpp @@ -54,7 +54,7 @@ using Mesh::Feature; PROPERTY_SOURCE(MeshGui::ViewProviderMeshTransform, MeshGui::ViewProviderMesh) - + ViewProviderMeshTransform::ViewProviderMeshTransform() { pcTransformerDragger = new SoTransformerManip(); diff --git a/src/Mod/Mesh/Gui/ViewProviderTransform.h b/src/Mod/Mesh/Gui/ViewProviderTransform.h index 46808eaf70..92ba9dafb8 100644 --- a/src/Mod/Mesh/Gui/ViewProviderTransform.h +++ b/src/Mod/Mesh/Gui/ViewProviderTransform.h @@ -54,9 +54,9 @@ public: ~ViewProviderMeshTransform() override; - /** + /** * Extracts the mesh data from the feature \a pcFeature and creates - * an Inventor node \a SoNode with these data. + * an Inventor node \a SoNode with these data. */ void attach(App::DocumentObject *) override; diff --git a/src/Mod/Mesh/Gui/ViewProviderTransformDemolding.h b/src/Mod/Mesh/Gui/ViewProviderTransformDemolding.h index a33799f226..178a753bc2 100644 --- a/src/Mod/Mesh/Gui/ViewProviderTransformDemolding.h +++ b/src/Mod/Mesh/Gui/ViewProviderTransformDemolding.h @@ -59,9 +59,9 @@ public: ~ViewProviderMeshTransformDemolding() override; - /** + /** * Extracts the mesh data from the feature \a pcFeature and creates - * an Inventor node \a SoNode with these data. + * an Inventor node \a SoNode with these data. */ void attach(App::DocumentObject *) override; diff --git a/src/Mod/Mesh/Gui/Workbench.cpp b/src/Mod/Mesh/Gui/Workbench.cpp index 63ccdc29ae..645289015a 100644 --- a/src/Mod/Mesh/Gui/Workbench.cpp +++ b/src/Mod/Mesh/Gui/Workbench.cpp @@ -184,7 +184,7 @@ Gui::MenuItem* Workbench::setupMenuBar() const // analyze Gui::MenuItem* analyze = new Gui::MenuItem; analyze->setCommand("Analyze"); - *analyze << "Mesh_Evaluation" << "Mesh_EvaluateFacet" << "Mesh_CurvatureInfo" << "Separator" + *analyze << "Mesh_Evaluation" << "Mesh_EvaluateFacet" << "Mesh_CurvatureInfo" << "Separator" << "Mesh_EvaluateSolid" << "Mesh_BoundingBox"; // boolean @@ -245,17 +245,17 @@ Gui::MenuItem* Workbench::setupMenuBar() const Gui::ToolBarItem* Workbench::setupToolBars() const { Gui::ToolBarItem* root = StdWorkbench::setupToolBars(); - + Gui::ToolBarItem* mesh = new Gui::ToolBarItem(root); mesh->setCommand("Mesh tools"); - *mesh << "Mesh_Import" - << "Mesh_Export" + *mesh << "Mesh_Import" + << "Mesh_Export" << "Mesh_FromPartShape" << "Mesh_BuildRegularSolid"; - + Gui::ToolBarItem* modifying = new Gui::ToolBarItem(root); modifying->setCommand("Mesh modify"); - *modifying << "Mesh_HarmonizeNormals" + *modifying << "Mesh_HarmonizeNormals" << "Mesh_FlipNormals" << "Mesh_FillupHoles" << "Mesh_FillInteractiveHole" @@ -265,13 +265,13 @@ Gui::ToolBarItem* Workbench::setupToolBars() const << "Mesh_RemeshGmsh" << "Mesh_Decimating" << "Mesh_Scale"; - + Gui::ToolBarItem* boolean = new Gui::ToolBarItem(root); boolean->setCommand("Mesh boolean"); *boolean << "Mesh_Union" << "Mesh_Intersection" << "Mesh_Difference"; - + Gui::ToolBarItem* cutting = new Gui::ToolBarItem(root); cutting->setCommand("Mesh cutting"); *cutting << "Mesh_PolyCut" @@ -279,14 +279,14 @@ Gui::ToolBarItem* Workbench::setupToolBars() const << "Mesh_TrimByPlane" << "Mesh_SectionByPlane" << "Mesh_CrossSections"; - + Gui::ToolBarItem* compseg = new Gui::ToolBarItem(root); compseg->setCommand("Mesh segmentation"); *compseg << "Mesh_Merge" << "Mesh_SplitComponents" << "Mesh_Segmentation" << "Mesh_SegmentationBestFit"; - + Gui::ToolBarItem* analyze = new Gui::ToolBarItem(root); analyze->setCommand("Mesh analyze"); *analyze << "Mesh_Evaluation" @@ -295,8 +295,8 @@ Gui::ToolBarItem* Workbench::setupToolBars() const << "Mesh_CurvatureInfo" << "Mesh_EvaluateSolid" << "Mesh_BoundingBox"; - - + + return root; } diff --git a/src/Mod/Mesh/Gui/Workbench.h b/src/Mod/Mesh/Gui/Workbench.h index 69aed2b132..5433d6e137 100644 --- a/src/Mod/Mesh/Gui/Workbench.h +++ b/src/Mod/Mesh/Gui/Workbench.h @@ -55,4 +55,4 @@ protected: } // namespace MeshGui -#endif // MESH_WORKBENCH_H +#endif // MESH_WORKBENCH_H