Mesh: modernize C++: use default member init
This commit is contained in:
@@ -51,10 +51,7 @@
|
||||
|
||||
using namespace MeshCore;
|
||||
|
||||
Approximation::Approximation()
|
||||
: _bIsFitted(false), _fLastResult(FLOAT_MAX)
|
||||
{
|
||||
}
|
||||
Approximation::Approximation() = default;
|
||||
|
||||
Approximation::~Approximation()
|
||||
{
|
||||
@@ -567,18 +564,8 @@ void QuadraticFit::CalcZValues( double x, double y, double &dZ1, double &dZ2 ) c
|
||||
// -------------------------------------------------------------------------------
|
||||
|
||||
SurfaceFit::SurfaceFit()
|
||||
: PlaneFit()
|
||||
: _fCoeff{}
|
||||
{
|
||||
_fCoeff[0] = 0.0;
|
||||
_fCoeff[1] = 0.0;
|
||||
_fCoeff[2] = 0.0;
|
||||
_fCoeff[3] = 0.0;
|
||||
_fCoeff[4] = 0.0;
|
||||
_fCoeff[5] = 0.0;
|
||||
_fCoeff[6] = 0.0;
|
||||
_fCoeff[7] = 0.0;
|
||||
_fCoeff[8] = 0.0;
|
||||
_fCoeff[9] = 0.0;
|
||||
}
|
||||
|
||||
float SurfaceFit::Fit()
|
||||
@@ -1029,8 +1016,6 @@ struct LMCylinderFunctor
|
||||
CylinderFit::CylinderFit()
|
||||
: _vBase(0,0,0)
|
||||
, _vAxis(0,0,1)
|
||||
, _fRadius(0)
|
||||
, _initialGuess(false)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1296,7 +1281,6 @@ void CylinderFit::ProjectToCylinder()
|
||||
|
||||
SphereFit::SphereFit()
|
||||
: _vCenter(0,0,0)
|
||||
, _fRadius(0)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1417,9 +1401,8 @@ void SphereFit::ProjectToSphere()
|
||||
// -------------------------------------------------------------------------------
|
||||
|
||||
PolynomialFit::PolynomialFit()
|
||||
: _fCoeff{}
|
||||
{
|
||||
for (float & i : _fCoeff)
|
||||
i = 0.0f;
|
||||
}
|
||||
|
||||
float PolynomialFit::Fit()
|
||||
|
||||
@@ -169,9 +169,11 @@ protected:
|
||||
void GetMgcVectorArray( std::vector< Wm4::Vector3<double> >& rcPts ) const;
|
||||
|
||||
protected:
|
||||
//NOLINTBEGIN
|
||||
std::list< Base::Vector3f > _vPoints; /**< Holds the points for the fit algorithm. */
|
||||
bool _bIsFitted; /**< Flag, whether the fit has been called. */
|
||||
float _fLastResult; /**< Stores the last result of the fit */
|
||||
bool _bIsFitted{false}; /**< Flag, whether the fit has been called. */
|
||||
float _fLastResult{FLOAT_MAX}; /**< Stores the last result of the fit */
|
||||
//NOLINTEND
|
||||
};
|
||||
|
||||
// -------------------------------------------------------------------------------
|
||||
@@ -233,10 +235,12 @@ public:
|
||||
Base::BoundBox3f GetBoundings() const;
|
||||
|
||||
protected:
|
||||
//NOLINTBEGIN
|
||||
Base::Vector3f _vBase; /**< Base vector of the plane. */
|
||||
Base::Vector3f _vDirU;
|
||||
Base::Vector3f _vDirV;
|
||||
Base::Vector3f _vDirW; /**< Normal of the plane. */
|
||||
//NOLINTEND
|
||||
};
|
||||
|
||||
// -------------------------------------------------------------------------------
|
||||
@@ -398,8 +402,8 @@ public:
|
||||
protected:
|
||||
Base::Vector3f _vBase; /**< Base vector of the cylinder. */
|
||||
Base::Vector3f _vAxis; /**< Axis of the cylinder. */
|
||||
float _fRadius; /**< Radius of the cylinder. */
|
||||
bool _initialGuess;
|
||||
float _fRadius{0}; /**< Radius of the cylinder. */
|
||||
bool _initialGuess{false};
|
||||
};
|
||||
|
||||
// -------------------------------------------------------------------------------
|
||||
@@ -434,7 +438,7 @@ public:
|
||||
|
||||
protected:
|
||||
Base::Vector3f _vCenter; /**< Center of the sphere. */
|
||||
float _fRadius; /**< Radius of the cylinder. */
|
||||
float _fRadius{0}; /**< Radius of the cylinder. */
|
||||
};
|
||||
|
||||
// -------------------------------------------------------------------------------
|
||||
|
||||
@@ -38,9 +38,10 @@
|
||||
using namespace MeshCore;
|
||||
|
||||
|
||||
MeshBuilder::MeshBuilder (MeshKernel& kernel) : _meshKernel(kernel), _seq(nullptr), _ptIdx(0)
|
||||
MeshBuilder::MeshBuilder (MeshKernel& kernel)
|
||||
: _meshKernel(kernel)
|
||||
, _fSaveTolerance{MeshDefinitions::_fMinPointDistanceD1}
|
||||
{
|
||||
_fSaveTolerance = MeshDefinitions::_fMinPointDistanceD1;
|
||||
}
|
||||
|
||||
MeshBuilder::~MeshBuilder ()
|
||||
|
||||
@@ -102,12 +102,12 @@ private:
|
||||
|
||||
MeshKernel& _meshKernel;
|
||||
std::set<MeshPoint> _points;
|
||||
Base::SequencerLauncher* _seq;
|
||||
Base::SequencerLauncher* _seq{nullptr};
|
||||
|
||||
// keep an array of iterators pointing to the vertex inside the set to save memory
|
||||
using MeshPointIterator = std::pair<std::set<MeshPoint>::iterator, bool>;
|
||||
std::vector<MeshPointIterator> _pointsIterator;
|
||||
size_t _ptIdx;
|
||||
size_t _ptIdx{0};
|
||||
|
||||
void SetNeighbourhood ();
|
||||
// As it's forbidden to insert a degenerated facet but insert its vertices anyway we must remove them
|
||||
|
||||
@@ -72,12 +72,6 @@ using namespace MeshCoreFit;
|
||||
CylinderFit::CylinderFit()
|
||||
: _vBase(0,0,0)
|
||||
, _vAxis(0,0,1)
|
||||
, _dRadius(0)
|
||||
, _numIter(0)
|
||||
, _posConvLimit(0.0001)
|
||||
, _dirConvLimit(0.000001)
|
||||
, _vConvLimit(0.001)
|
||||
, _maxIter(50)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -146,15 +146,15 @@ protected:
|
||||
*/
|
||||
bool updateParameters(SolutionD solDir, const Eigen::VectorXd &x);
|
||||
|
||||
protected:
|
||||
private:
|
||||
Base::Vector3d _vBase; /**< Base vector of the cylinder (point on axis). */
|
||||
Base::Vector3d _vAxis; /**< Axis of the cylinder. */
|
||||
double _dRadius; /**< Radius of the cylinder. */
|
||||
int _numIter; /**< Number of iterations for solution to converge. */
|
||||
double _posConvLimit; /**< Position and radius parameter convergence threshold. */
|
||||
double _dirConvLimit; /**< Direction parameter convergence threshold. */
|
||||
double _vConvLimit; /**< Residual convergence threshold. */
|
||||
int _maxIter; /**< Maximum number of iterations. */
|
||||
double _dRadius{0}; /**< Radius of the cylinder. */
|
||||
int _numIter{0}; /**< Number of iterations for solution to converge. */
|
||||
double _posConvLimit{0.0001}; /**< Position and radius parameter convergence threshold. */
|
||||
double _dirConvLimit{0.000001}; /**< Direction parameter convergence threshold. */
|
||||
double _vConvLimit{0.001}; /**< Residual convergence threshold. */
|
||||
int _maxIter{50}; /**< Maximum number of iterations. */
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -157,7 +157,7 @@ public:
|
||||
class MeshExport MeshGeomEdge
|
||||
{
|
||||
public:
|
||||
MeshGeomEdge () : _bBorder(false) {}
|
||||
MeshGeomEdge () = default;
|
||||
|
||||
/** Checks if the edge is inside the bounding box or intersects with it. */
|
||||
bool ContainedByOrIntersectBoundingBox (const Base::BoundBox3f &rclBB ) const;
|
||||
@@ -212,7 +212,7 @@ public:
|
||||
|
||||
public:
|
||||
Base::Vector3f _aclPoints[2]; /**< Corner points */
|
||||
bool _bBorder; /**< Set to true if border edge */
|
||||
bool _bBorder{false}; /**< Set to true if border edge */
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -42,9 +42,7 @@
|
||||
using namespace MeshCore;
|
||||
|
||||
|
||||
MeshOrientationVisitor::MeshOrientationVisitor() : _nonuniformOrientation(false)
|
||||
{
|
||||
}
|
||||
MeshOrientationVisitor::MeshOrientationVisitor() = default;
|
||||
|
||||
bool MeshOrientationVisitor::Visit (const MeshFacet &rclFacet, const MeshFacet &rclFrom,
|
||||
FacetIndex ulFInd, unsigned long ulLevel)
|
||||
|
||||
@@ -99,7 +99,7 @@ public:
|
||||
bool HasNonUnifomOrientedFacets() const;
|
||||
|
||||
private:
|
||||
bool _nonuniformOrientation;
|
||||
bool _nonuniformOrientation{false};
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -1142,12 +1142,9 @@ unsigned long MeshPointGrid::FindElements (const Base::Vector3f &rclPoint, std::
|
||||
// ----------------------------------------------------------------
|
||||
|
||||
MeshGridIterator::MeshGridIterator (const MeshGrid &rclG)
|
||||
: _rclGrid(rclG),
|
||||
_ulX(0), _ulY(0), _ulZ(0),
|
||||
_clPt(0.0f, 0.0f, 0.0f), _clDir(0.0f, 0.0f, 0.0f),
|
||||
_bValidRay(false),
|
||||
_fMaxSearchArea (FLOAT_MAX)
|
||||
|
||||
: _rclGrid(rclG)
|
||||
, _clPt(0.0f, 0.0f, 0.0f)
|
||||
, _clDir(0.0f, 0.0f, 0.0f)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -333,13 +333,13 @@ public:
|
||||
|
||||
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 _ulX{0}; /**< Number of grids in x. */
|
||||
unsigned long _ulY{0}; /**< Number of grids in y. */
|
||||
unsigned long _ulZ{0}; /**< 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;
|
||||
bool _bValidRay{false}; /**< Search ray ok? */
|
||||
float _fMaxSearchArea{FLOAT_MAX};
|
||||
/** Checks if a grid position is already visited by NextOnRay(). */
|
||||
struct GridElement
|
||||
{
|
||||
|
||||
@@ -185,7 +185,6 @@ public:
|
||||
WriterInventor::WriterInventor(const MeshKernel& kernel, const Material* material)
|
||||
: _kernel(kernel)
|
||||
, _material(material)
|
||||
, apply_transform(false)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ private:
|
||||
const MeshKernel& _kernel;
|
||||
const Material* _material;
|
||||
Base::Matrix4D _transform;
|
||||
bool apply_transform;
|
||||
bool apply_transform{false};
|
||||
};
|
||||
|
||||
} // namespace MeshCore
|
||||
|
||||
@@ -50,7 +50,6 @@ struct WriterOBJ::Color_Less
|
||||
WriterOBJ::WriterOBJ(const MeshKernel& kernel, const Material* material)
|
||||
: _kernel(kernel)
|
||||
, _material(material)
|
||||
, apply_transform(false)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ private:
|
||||
const MeshKernel& _kernel;
|
||||
const Material* _material;
|
||||
Base::Matrix4D _transform;
|
||||
bool apply_transform;
|
||||
bool apply_transform{false};
|
||||
std::vector<Group> _groups;
|
||||
};
|
||||
|
||||
|
||||
@@ -3094,7 +3094,6 @@ bool MeshOutput::SaveVRML (std::ostream &rstrOut) const
|
||||
MeshCleanup::MeshCleanup(MeshPointArray& p, MeshFacetArray& f)
|
||||
: pointArray(p)
|
||||
, facetArray(f)
|
||||
, materialArray(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -289,7 +289,7 @@ private:
|
||||
private:
|
||||
MeshPointArray& pointArray;
|
||||
MeshFacetArray& facetArray;
|
||||
Material* materialArray;
|
||||
Material* materialArray{nullptr};
|
||||
};
|
||||
|
||||
/*!
|
||||
|
||||
@@ -44,8 +44,7 @@
|
||||
|
||||
using namespace MeshCore;
|
||||
|
||||
MeshKernel::MeshKernel ()
|
||||
: _bValid(true)
|
||||
MeshKernel::MeshKernel()
|
||||
{
|
||||
_clBoundBox.SetVoid();
|
||||
}
|
||||
|
||||
@@ -448,7 +448,7 @@ protected:
|
||||
MeshPointArray _aclPointArray; /**< Holds the array of geometric points. */
|
||||
MeshFacetArray _aclFacetArray; /**< Holds the array of facets. */
|
||||
mutable Base::BoundBox3f _clBoundBox; /**< The current calculated bounding box. */
|
||||
bool _bValid; /**< Current state of validality. */
|
||||
bool _bValid{true}; /**< Current state of validality. */
|
||||
|
||||
// friends
|
||||
friend class MeshPointIterator;
|
||||
|
||||
@@ -491,8 +491,7 @@ SetOperations::CollectFacetVisitor::CollectFacetVisitor (const MeshKernel& mesh,
|
||||
, _edges(edges)
|
||||
, _side(side)
|
||||
, _mult(mult)
|
||||
, _addFacets(-1)
|
||||
,_builder(builder)
|
||||
, _builder(builder)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -146,7 +146,7 @@ private:
|
||||
std::map<Edge, EdgeInfo> &_edges;
|
||||
int _side;
|
||||
float _mult;
|
||||
int _addFacets; // 0: add facets to the result 1: do not add facets to the result
|
||||
int _addFacets{-1}; // 0: add facets to the result 1: do not add facets to the result
|
||||
Base::Builder3D& _builder;
|
||||
|
||||
CollectFacetVisitor (const MeshKernel& mesh, std::vector<FacetIndex>& facets, std::map<Edge, EdgeInfo>& edges, int side, float mult, Base::Builder3D& builder);
|
||||
|
||||
@@ -36,8 +36,6 @@ using namespace MeshCore;
|
||||
|
||||
AbstractSmoothing::AbstractSmoothing(MeshKernel& m)
|
||||
: kernel(m)
|
||||
, component(Normal)
|
||||
, continuity(C0)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -51,7 +49,6 @@ void AbstractSmoothing::initialize(Component comp, Continuity cont)
|
||||
|
||||
PlaneFitSmoothing::PlaneFitSmoothing(MeshKernel& m)
|
||||
: AbstractSmoothing(m)
|
||||
, maximum(FLT_MAX)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -163,7 +160,7 @@ void PlaneFitSmoothing::SmoothPoints(unsigned int iterations, const std::vector<
|
||||
}
|
||||
|
||||
LaplaceSmoothing::LaplaceSmoothing(MeshKernel& m)
|
||||
: AbstractSmoothing(m), lambda(0.6307)
|
||||
: AbstractSmoothing(m)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -259,7 +256,7 @@ void LaplaceSmoothing::SmoothPoints(unsigned int iterations, const std::vector<P
|
||||
}
|
||||
|
||||
TaubinSmoothing::TaubinSmoothing(MeshKernel& m)
|
||||
: LaplaceSmoothing(m), micro(0.0424)
|
||||
: LaplaceSmoothing(m)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -313,7 +310,7 @@ inline Base::Vector3d find_median(std::vector<AngleNormal> &container)
|
||||
}
|
||||
|
||||
MedianFilterSmoothing::MedianFilterSmoothing(MeshKernel& m)
|
||||
: AbstractSmoothing(m), weights(1)
|
||||
: AbstractSmoothing(m)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#ifndef MESH_SMOOTHING_H
|
||||
#define MESH_SMOOTHING_H
|
||||
|
||||
#include <cfloat>
|
||||
#include <vector>
|
||||
|
||||
#include "Definitions.h"
|
||||
@@ -62,8 +63,8 @@ public:
|
||||
protected:
|
||||
MeshKernel& kernel;
|
||||
|
||||
Component component;
|
||||
Continuity continuity;
|
||||
Component component{Normal};
|
||||
Continuity continuity{C0};
|
||||
};
|
||||
|
||||
class MeshExport PlaneFitSmoothing : public AbstractSmoothing
|
||||
@@ -77,7 +78,7 @@ public:
|
||||
void SmoothPoints(unsigned int, const std::vector<PointIndex>&) override;
|
||||
|
||||
private:
|
||||
float maximum;
|
||||
float maximum{FLT_MAX};
|
||||
};
|
||||
|
||||
class MeshExport LaplaceSmoothing : public AbstractSmoothing
|
||||
@@ -96,7 +97,7 @@ protected:
|
||||
const std::vector<PointIndex>&);
|
||||
|
||||
protected:
|
||||
double lambda;
|
||||
double lambda{0.6307};
|
||||
};
|
||||
|
||||
class MeshExport TaubinSmoothing : public LaplaceSmoothing
|
||||
@@ -108,7 +109,7 @@ public:
|
||||
void SetMicro(double m) { micro = m;}
|
||||
|
||||
protected:
|
||||
double micro;
|
||||
double micro{0.0424};
|
||||
};
|
||||
|
||||
/*!
|
||||
@@ -132,7 +133,7 @@ private:
|
||||
const std::vector<PointIndex>&);
|
||||
|
||||
private:
|
||||
int weights;
|
||||
int weights{1};
|
||||
};
|
||||
|
||||
} // namespace MeshCore
|
||||
|
||||
@@ -34,12 +34,7 @@
|
||||
using namespace MeshCoreFit;
|
||||
|
||||
SphereFit::SphereFit()
|
||||
: _vCenter(0, 0, 0),
|
||||
_dRadius(0),
|
||||
_numIter(0),
|
||||
_posConvLimit(0.0001),
|
||||
_vConvLimit(0.001),
|
||||
_maxIter(50)
|
||||
: _vCenter(0, 0, 0)
|
||||
{}
|
||||
|
||||
// Set approximations before calling the fitting
|
||||
|
||||
@@ -112,11 +112,11 @@ protected:
|
||||
|
||||
protected:
|
||||
Base::Vector3d _vCenter;/**< Center of sphere. */
|
||||
double _dRadius; /**< Radius of the sphere. */
|
||||
int _numIter; /**< Number of iterations for solution to converge. */
|
||||
double _posConvLimit; /**< Position and radius parameter convergence threshold. */
|
||||
double _vConvLimit; /**< Residual convergence threshold. */
|
||||
int _maxIter; /**< Maximum number of iterations. */
|
||||
double _dRadius{0}; /**< Radius of the sphere. */
|
||||
int _numIter{0}; /**< Number of iterations for solution to converge. */
|
||||
double _posConvLimit{0.0001}; /**< Position and radius parameter convergence threshold. */
|
||||
double _vConvLimit{0.001}; /**< Residual convergence threshold. */
|
||||
int _maxIter{50}; /**< Maximum number of iterations. */
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -36,9 +36,7 @@ MeshSearchNeighbours::MeshSearchNeighbours (const MeshKernel &rclM, float fSampl
|
||||
, _rclFAry(rclM.GetFacets())
|
||||
, _rclPAry(rclM.GetPoints())
|
||||
, _clPt2Fa(rclM)
|
||||
, _fMaxDistanceP2(0)
|
||||
, _fSampleDistance(fSampleDistance)
|
||||
, _bTooFewPoints(false)
|
||||
{
|
||||
MeshAlgorithm(_rclMesh).ResetFacetFlag(MeshFacet::MARKED);
|
||||
MeshAlgorithm(_rclMesh).ResetPointFlag(MeshPoint::MARKED);
|
||||
|
||||
@@ -78,7 +78,7 @@ protected:
|
||||
const MeshFacetArray &_rclFAry;
|
||||
const MeshPointArray &_rclPAry;
|
||||
MeshRefPointToFacets _clPt2Fa;
|
||||
float _fMaxDistanceP2; // square distance
|
||||
float _fMaxDistanceP2{0}; // square distance
|
||||
Base::Vector3f _clCenter; // center points of start facet
|
||||
std::set<PointIndex> _aclResult; // result container (point indices)
|
||||
std::set<PointIndex> _aclOuter; // next searching points
|
||||
@@ -86,7 +86,7 @@ protected:
|
||||
std::vector<std::vector<Base::Vector3f> > _aclSampledFacets; // sample points from each facet
|
||||
float _fSampleDistance; // distance between two sampled points
|
||||
Wm4::Sphere3<float> _akSphere;
|
||||
bool _bTooFewPoints;
|
||||
bool _bTooFewPoints{false};
|
||||
|
||||
public:
|
||||
MeshSearchNeighbours (const MeshSearchNeighbours&) = delete;
|
||||
@@ -175,7 +175,7 @@ class MeshNearestIndexToPlane
|
||||
public:
|
||||
using Index = typename T::Index;
|
||||
MeshNearestIndexToPlane(const MeshKernel& mesh, const Base::Vector3f& b, const Base::Vector3f& n)
|
||||
: nearest_index(-1),nearest_dist(FLOAT_MAX), it(mesh), base(b), normal(n) {}
|
||||
: nearest_index(-1), it(mesh), base(b), normal(n) {}
|
||||
void operator() (Index index)
|
||||
{
|
||||
float dist = (float)fabs(it(index).DistanceToPlane(base, normal));
|
||||
@@ -186,7 +186,7 @@ public:
|
||||
}
|
||||
|
||||
Index nearest_index;
|
||||
float nearest_dist;
|
||||
float nearest_dist{FLOAT_MAX};
|
||||
|
||||
private:
|
||||
T it;
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
using namespace MeshCore;
|
||||
|
||||
MeshTopoAlgorithm::MeshTopoAlgorithm (MeshKernel &rclM)
|
||||
: _rclMesh(rclM), _needsCleanup(false), _cache(nullptr)
|
||||
: _rclMesh(rclM)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -307,7 +307,7 @@ private:
|
||||
|
||||
private:
|
||||
MeshKernel& _rclMesh;
|
||||
bool _needsCleanup;
|
||||
bool _needsCleanup{false};
|
||||
|
||||
struct Vertex_Less
|
||||
{
|
||||
@@ -316,7 +316,7 @@ private:
|
||||
|
||||
// cache
|
||||
using tCache = std::map<Base::Vector3f,PointIndex,Vertex_Less>;
|
||||
tCache* _cache;
|
||||
tCache* _cache{nullptr};
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -36,7 +36,7 @@ using namespace MeshCore;
|
||||
|
||||
MeshTrimming::MeshTrimming(MeshKernel &rclM, const Base::ViewProjMethod* pclProj,
|
||||
const Base::Polygon2d& rclPoly)
|
||||
: myMesh(rclM), myInner(true), myProj(pclProj), myPoly(rclPoly)
|
||||
: myMesh(rclM), myProj(pclProj), myPoly(rclPoly)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -448,7 +448,6 @@ bool MeshTrimming::CreateFacets(FacetIndex ulFacetPos, int iSide, const std::vec
|
||||
MeshFacet& facet = myMesh._aclFacetArray[ulFacetPos];
|
||||
AdjustFacet(facet, iSide);
|
||||
|
||||
MeshFacet clOrg(myMesh._aclFacetArray[ulFacetPos]);
|
||||
clFac = myMesh.GetFacet(ulFacetPos);
|
||||
// intersection points
|
||||
Base::Vector3f clP1(raclPoints[0]), clP2(raclPoints[1]), clP3(raclPoints[2]), clP4(raclPoints[3]);
|
||||
|
||||
@@ -96,7 +96,7 @@ private:
|
||||
|
||||
private:
|
||||
MeshKernel& myMesh;
|
||||
bool myInner;
|
||||
bool myInner{true};
|
||||
std::vector<MeshGeomFacet> myTriangles;
|
||||
const Base::ViewProjMethod* myProj;
|
||||
const Base::Polygon2d& myPoly;
|
||||
|
||||
@@ -163,9 +163,7 @@ MeshSearchNeighbourFacetsVisitor::MeshSearchNeighbourFacetsVisitor (const MeshKe
|
||||
FacetIndex ulStartFacetIdx)
|
||||
: _rclMeshBase(rclMesh),
|
||||
_clCenter(rclMesh.GetFacet(ulStartFacetIdx).GetGravityPoint()),
|
||||
_fRadius(fRadius),
|
||||
_ulCurrentLevel(0),
|
||||
_bFacetsFoundInCurrentLevel(false)
|
||||
_fRadius(fRadius)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -89,8 +89,8 @@ protected:
|
||||
const MeshKernel& _rclMeshBase; /**< The mesh kernel. */
|
||||
Base::Vector3f _clCenter; /**< Center. */
|
||||
float _fRadius; /**< Search radius. */
|
||||
unsigned long _ulCurrentLevel;
|
||||
bool _bFacetsFoundInCurrentLevel;
|
||||
unsigned long _ulCurrentLevel{0};
|
||||
bool _bFacetsFoundInCurrentLevel{false};
|
||||
std::vector<FacetIndex> _vecFacets; /**< Found facets. */
|
||||
};
|
||||
|
||||
|
||||
@@ -31,9 +31,8 @@
|
||||
|
||||
using namespace Mesh;
|
||||
|
||||
Edge::Edge()
|
||||
: Index(-1)
|
||||
, Mesh(nullptr)
|
||||
Edge::Edge() //NOLINT
|
||||
: Mesh(nullptr)
|
||||
{
|
||||
for (int i=0; i<2; i++) {
|
||||
PIndex[i] = MeshCore::POINT_INDEX_MAX;
|
||||
|
||||
@@ -49,7 +49,7 @@ public:
|
||||
void unbound();
|
||||
void operator = (const Edge& f);
|
||||
|
||||
int Index;
|
||||
int Index{-1};
|
||||
MeshCore::PointIndex PIndex[2];
|
||||
MeshCore::FacetIndex NIndex[2];
|
||||
Base::Reference<const MeshObject> Mesh;
|
||||
|
||||
@@ -309,8 +309,7 @@ void Exporter3MF::write()
|
||||
|
||||
ExporterAMF::ExporterAMF( std::string fileName,
|
||||
const std::map<std::string, std::string> &meta,
|
||||
bool compress ) :
|
||||
outputStreamPtr(nullptr), nextObjectIndex(0)
|
||||
bool compress )
|
||||
{
|
||||
// ask for write permission
|
||||
throwIfNoPermission(fileName);
|
||||
|
||||
@@ -223,8 +223,8 @@ private:
|
||||
void write();
|
||||
|
||||
private:
|
||||
std::ostream *outputStreamPtr;
|
||||
int nextObjectIndex;
|
||||
std::ostream *outputStreamPtr{nullptr};
|
||||
int nextObjectIndex{0};
|
||||
|
||||
/// Helper for putting Base::Vector3f objects into a std::map in addMesh()
|
||||
class VertLess;
|
||||
|
||||
@@ -725,7 +725,7 @@ bool PropertyMaterial::isSame(const App::Property& other) const
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
PropertyMeshKernel::PropertyMeshKernel()
|
||||
: _meshObject(new MeshObject()), meshPyObject(nullptr)
|
||||
: _meshObject(new MeshObject())
|
||||
{
|
||||
// Note: Normally this property is a member of a document object, i.e. the setValue()
|
||||
// method gets called in the constructor of a subclass of DocumentObject, e.g. Mesh::Feature.
|
||||
|
||||
@@ -298,7 +298,7 @@ public:
|
||||
|
||||
private:
|
||||
Base::Reference<MeshObject> _meshObject;
|
||||
MeshPy* meshPyObject;
|
||||
MeshPy* meshPyObject{nullptr};
|
||||
};
|
||||
|
||||
} // namespace Mesh
|
||||
|
||||
@@ -69,13 +69,7 @@ void CleanupHandler::cleanup()
|
||||
class DlgEvaluateMeshImp::Private
|
||||
{
|
||||
public:
|
||||
Private()
|
||||
: meshFeature(nullptr)
|
||||
, view(nullptr)
|
||||
, enableFoldsCheck(false)
|
||||
, checkNonManfoldPoints(false)
|
||||
, strictlyDegenerated(true)
|
||||
, epsilonDegenerated(0.0f)
|
||||
Private() : view(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -88,15 +82,15 @@ public:
|
||||
ui.repairFoldsButton->setVisible(on);
|
||||
}
|
||||
|
||||
Ui_DlgEvaluateMesh ui;
|
||||
Ui_DlgEvaluateMesh ui{};
|
||||
std::map<std::string, ViewProviderMeshDefects*> vp;
|
||||
Mesh::Feature* meshFeature;
|
||||
Mesh::Feature* meshFeature{nullptr};
|
||||
QPointer<Gui::View3DInventor> view;
|
||||
std::vector<Mesh::FacetIndex> self_intersections;
|
||||
bool enableFoldsCheck;
|
||||
bool checkNonManfoldPoints;
|
||||
bool strictlyDegenerated;
|
||||
float epsilonDegenerated;
|
||||
bool enableFoldsCheck{false};
|
||||
bool checkNonManfoldPoints{false};
|
||||
bool strictlyDegenerated{true};
|
||||
float epsilonDegenerated{0.0f};
|
||||
};
|
||||
|
||||
/* TRANSLATOR MeshGui::DlgEvaluateMeshImp */
|
||||
|
||||
@@ -75,14 +75,6 @@ unsigned char MeshSelection::cross_mask_bitmap[] = {
|
||||
};
|
||||
|
||||
MeshSelection::MeshSelection()
|
||||
: onlyPointToUserTriangles(false)
|
||||
, onlyVisibleTriangles(false)
|
||||
, addToSelection(false)
|
||||
, addComponent(false)
|
||||
, removeComponent(false)
|
||||
, activeCB(nullptr)
|
||||
, selectionCB(nullptr)
|
||||
, ivViewer(nullptr)
|
||||
{
|
||||
setCallback(selectGLCallback);
|
||||
}
|
||||
@@ -464,7 +456,6 @@ void MeshSelection::selectGLCallback(void * ud, SoEventCallback * n)
|
||||
|
||||
SbVec3f pnt, dir;
|
||||
view->getNearPlane(pnt, dir);
|
||||
Base::Vector3f point (pnt[0],pnt[1],pnt[2]);
|
||||
Base::Vector3f normal(dir[0],dir[1],dir[2]);
|
||||
|
||||
std::list<ViewProviderMesh*> views = self->getViewProviders();
|
||||
|
||||
@@ -86,11 +86,14 @@ private:
|
||||
static void pickFaceCallback(void * ud, SoEventCallback * n);
|
||||
|
||||
private:
|
||||
bool onlyPointToUserTriangles, onlyVisibleTriangles;
|
||||
bool addToSelection, addComponent, removeComponent;
|
||||
SoEventCallbackCB *activeCB;
|
||||
SoEventCallbackCB *selectionCB;
|
||||
Gui::View3DInventorViewer* ivViewer;
|
||||
bool onlyPointToUserTriangles{false};
|
||||
bool onlyVisibleTriangles{false};
|
||||
bool addToSelection{false};
|
||||
bool addComponent{false};
|
||||
bool removeComponent{false};
|
||||
SoEventCallbackCB *activeCB{nullptr};
|
||||
SoEventCallbackCB *selectionCB{nullptr};
|
||||
Gui::View3DInventorViewer* ivViewer{nullptr};
|
||||
mutable std::vector<Gui::SelectionObject> meshObjects;
|
||||
|
||||
static unsigned char cross_bitmap[];
|
||||
|
||||
@@ -74,12 +74,11 @@ class MeshRenderer::Private {
|
||||
public:
|
||||
Gui::OpenGLMultiBuffer vertices;
|
||||
Gui::OpenGLMultiBuffer indices;
|
||||
const SbColor * pcolors;
|
||||
SoMaterialBindingElement::Binding matbinding;
|
||||
bool initialized;
|
||||
const SbColor * pcolors{nullptr};
|
||||
SoMaterialBindingElement::Binding matbinding{SoMaterialBindingElement::OVERALL};
|
||||
bool initialized{false};
|
||||
|
||||
Private();
|
||||
~Private();
|
||||
bool canRenderGLArray(SoGLRenderAction *) const;
|
||||
void generateGLArrays(SoGLRenderAction* action,
|
||||
SoMaterialBindingElement::Binding matbind,
|
||||
@@ -96,14 +95,9 @@ private:
|
||||
MeshRenderer::Private::Private()
|
||||
: vertices(GL_ARRAY_BUFFER)
|
||||
, indices(GL_ELEMENT_ARRAY_BUFFER)
|
||||
, pcolors(nullptr)
|
||||
, matbinding(SoMaterialBindingElement::OVERALL)
|
||||
, initialized(false)
|
||||
{
|
||||
}
|
||||
|
||||
MeshRenderer::Private::~Private() = default;
|
||||
|
||||
bool MeshRenderer::Private::canRenderGLArray(SoGLRenderAction *action) const
|
||||
{
|
||||
static bool init = false;
|
||||
@@ -461,7 +455,6 @@ void SoFCIndexedFaceSet::initClass()
|
||||
|
||||
SoFCIndexedFaceSet::SoFCIndexedFaceSet()
|
||||
: renderTriangleLimit(UINT_MAX)
|
||||
, selectBuf(nullptr)
|
||||
{
|
||||
SO_NODE_CONSTRUCTOR(SoFCIndexedFaceSet);
|
||||
SO_NODE_ADD_FIELD(updateGLArray, (false));
|
||||
|
||||
@@ -136,7 +136,7 @@ private:
|
||||
|
||||
private:
|
||||
MeshRenderer render;
|
||||
GLuint *selectBuf;
|
||||
GLuint *selectBuf{nullptr};
|
||||
};
|
||||
|
||||
} // namespace MeshGui
|
||||
|
||||
@@ -331,7 +331,7 @@ SO_NODE_SOURCE(SoFCMeshPickNode)
|
||||
/*!
|
||||
Constructor.
|
||||
*/
|
||||
SoFCMeshPickNode::SoFCMeshPickNode() : meshGrid(nullptr)
|
||||
SoFCMeshPickNode::SoFCMeshPickNode()
|
||||
{
|
||||
SO_NODE_CONSTRUCTOR(SoFCMeshPickNode);
|
||||
|
||||
@@ -585,8 +585,6 @@ void SoFCMeshObjectShape::initClass()
|
||||
|
||||
SoFCMeshObjectShape::SoFCMeshObjectShape()
|
||||
: renderTriangleLimit(UINT_MAX)
|
||||
, selectBuf(nullptr)
|
||||
, updateGLArray(false)
|
||||
{
|
||||
SO_NODE_CONSTRUCTOR(SoFCMeshObjectShape);
|
||||
setName(SoFCMeshObjectShape::getClassTypeId().getName());
|
||||
|
||||
@@ -93,7 +93,7 @@ protected:
|
||||
~SoFCMeshPickNode() override;
|
||||
|
||||
private:
|
||||
MeshCore::MeshFacetGrid* meshGrid;
|
||||
MeshCore::MeshFacetGrid* meshGrid{nullptr};
|
||||
};
|
||||
|
||||
// -------------------------------------------------------
|
||||
@@ -212,13 +212,13 @@ private:
|
||||
void renderCoordsGLArray(SoGLRenderAction *action);
|
||||
|
||||
private:
|
||||
GLuint *selectBuf;
|
||||
GLfloat modelview[16];
|
||||
GLfloat projection[16];
|
||||
GLuint *selectBuf{nullptr};
|
||||
GLfloat modelview[16]{};
|
||||
GLfloat projection[16]{};
|
||||
// Vertex array handling
|
||||
std::vector<int32_t> index_array;
|
||||
std::vector<float> vertex_array;
|
||||
SbBool updateGLArray;
|
||||
SbBool updateGLArray{false};
|
||||
};
|
||||
|
||||
class MeshGuiExport SoFCMeshSegmentShape : public SoShape {
|
||||
|
||||
@@ -221,7 +221,7 @@ const char* ViewProviderMesh::LightingEnums[]= {"One side", "Two side", nullptr}
|
||||
|
||||
PROPERTY_SOURCE(MeshGui::ViewProviderMesh, Gui::ViewProviderGeometryObject)
|
||||
|
||||
ViewProviderMesh::ViewProviderMesh() : pcOpenEdge(nullptr)
|
||||
ViewProviderMesh::ViewProviderMesh() : highlightMode{HighlighMode::None}
|
||||
{
|
||||
static const char *osgroup = "Object Style";
|
||||
|
||||
|
||||
@@ -236,16 +236,18 @@ protected:
|
||||
Segment,
|
||||
Color
|
||||
};
|
||||
//NOLINTBEGIN
|
||||
HighlighMode highlightMode;
|
||||
Gui::SoFCSelection * pcHighlight;
|
||||
SoGroup * pcShapeGroup;
|
||||
SoDrawStyle * pcLineStyle;
|
||||
SoDrawStyle * pcPointStyle;
|
||||
SoSeparator * pcOpenEdge;
|
||||
SoBaseColor * pOpenColor;
|
||||
SoMaterial * pLineColor;
|
||||
SoShapeHints * pShapeHints;
|
||||
SoMaterialBinding * pcMatBinding;
|
||||
Gui::SoFCSelection * pcHighlight{nullptr};
|
||||
SoGroup * pcShapeGroup{nullptr};
|
||||
SoDrawStyle * pcLineStyle{nullptr};
|
||||
SoDrawStyle * pcPointStyle{nullptr};
|
||||
SoSeparator * pcOpenEdge{nullptr};
|
||||
SoBaseColor * pOpenColor{nullptr};
|
||||
SoMaterial * pLineColor{nullptr};
|
||||
SoShapeHints * pShapeHints{nullptr};
|
||||
SoMaterialBinding * pcMatBinding{nullptr};
|
||||
//NOLINTEND
|
||||
|
||||
private:
|
||||
static App::PropertyFloatConstraint::Constraints floatRange;
|
||||
|
||||
Reference in New Issue
Block a user