MeshPart: modernize C++: use default member init

This commit is contained in:
wmayer
2023-08-22 18:29:36 +02:00
committed by wwmayer
parent 5686149cd3
commit 8c2e110bfb
4 changed files with 27 additions and 55 deletions

View File

@@ -476,8 +476,7 @@ class _VertexCompare
return clP1.X() < clP2.X();
}
_VertexCompare () : dE(1.0e-5) {}
double dE;
double dE = 1.0e-5;
};

View File

@@ -127,11 +127,11 @@ namespace MeshPart {
struct Vertex {
static const double deflection;
Standard_Real x,y,z;
Standard_Integer i;
Standard_Integer i = 0;
mutable MeshCore::MeshPoint p;
Vertex(Standard_Real X, Standard_Real Y, Standard_Real Z)
: x(X),y(Y),z(Z),i(0)
: x(X),y(Y),z(Z)
{
p.x = static_cast<float>(x);
p.y = static_cast<float>(y);
@@ -306,26 +306,6 @@ public:
Mesher::Mesher(const TopoDS_Shape& s)
: shape(s)
, method(None)
, maxLength(0)
, maxArea(0)
, localLength(0)
, deflection(0)
, angularDeflection(0.5)
, minLen(0)
, maxLen(0)
, relative(false)
, regular(false)
, segments(false)
#if defined (HAVE_NETGEN)
, fineness(5)
, growthRate(0)
, nbSegPerEdge(0)
, nbSegPerRadius(0)
, secondOrder(false)
, optimize(true)
, allowquad(false)
#endif
{
}

View File

@@ -142,24 +142,24 @@ private:
private:
const TopoDS_Shape& shape;
Method method;
double maxLength;
double maxArea;
double localLength;
double deflection;
double angularDeflection;
double minLen, maxLen;
bool relative;
bool regular;
bool segments;
Method method{None};
double maxLength{0};
double maxArea{0};
double localLength{0};
double deflection{0};
double angularDeflection{0.5};
double minLen{0}, maxLen{0};
bool relative{false};
bool regular{false};
bool segments{false};
#if defined (HAVE_NETGEN)
int fineness;
double growthRate;
double nbSegPerEdge;
double nbSegPerRadius;
bool secondOrder;
bool optimize;
bool allowquad;
int fineness{5};
double growthRate{0};
double nbSegPerEdge{0};
double nbSegPerRadius{0};
bool secondOrder{false};
bool optimize{true};
bool allowquad{false};
#endif
std::vector<uint32_t> colors;

View File

@@ -241,14 +241,7 @@ public:
}
};
Private()
: wireClosed(false)
, distance(1.0)
, cosAngle(0.7071) // 45 degree
, approximate(true)
, curve(new ViewProviderCurveOnMesh)
, mesh(nullptr)
, grid(nullptr)
, viewer(nullptr)
: curve(new ViewProviderCurveOnMesh)
, editcursor(QPixmap(cursor_curveonmesh), 7, 7)
{
}
@@ -322,13 +315,13 @@ public:
std::vector<PickedPoint> pickedPoints;
std::list<std::vector<Base::Vector3f> > cutLines;
bool wireClosed;
double distance;
double cosAngle;
bool approximate;
bool wireClosed{false};
double distance{1};
double cosAngle{0.7071}; // 45 degree
bool approximate{true};
ViewProviderCurveOnMesh* curve;
Gui::ViewProviderDocumentObject* mesh;
MeshCore::MeshFacetGrid* grid;
Gui::ViewProviderDocumentObject* mesh{0};
MeshCore::MeshFacetGrid* grid{nullptr};
MeshCore::MeshKernel kernel;
QPointer<Gui::View3DInventor> viewer;
QCursor editcursor;