Skip to content
Snippets Groups Projects
Commit 00f24773 authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

Use default member initializer.

clang-tidy modernize-use-default-member-init check
parent 61f004c3
No related branches found
No related tags found
No related merge requests found
Showing
with 31 additions and 42 deletions
......@@ -24,8 +24,8 @@
#include <QTextStream>
#include <limits>
DiagramList::DiagramList() : _maxX(0), _maxY(0), _minX(0), _minY(0), _xLabel(""), _yLabel(""),
_xUnit(""), _yUnit(""), _startDate()
DiagramList::DiagramList()
: _xLabel(""), _yLabel(""), _xUnit(""), _yUnit(""), _startDate()
{
}
......
......@@ -171,10 +171,10 @@ private:
/// Updates the bounds of the data points contained in the list.
void update();
float _maxX;
float _maxY;
float _minX;
float _minY;
float _maxX{0};
float _maxY{0};
float _minX{0};
float _minY{0};
std::vector< std::pair<float, float> > _coords;
QString _name;
QString _xLabel;
......
......@@ -28,8 +28,7 @@
/**
* Constructor.
*/
ElementTreeModel::ElementTreeModel( QObject* parent )
: TreeModel(parent), _mesh_source(nullptr)
ElementTreeModel::ElementTreeModel(QObject* parent) : TreeModel(parent)
{
QList<QVariant> rootData;
delete _rootItem;
......
......@@ -48,6 +48,5 @@ public slots:
void setMesh(MeshLib::Mesh const& mesh);
private:
vtkUnstructuredGridAlgorithm const* _mesh_source;
vtkUnstructuredGridAlgorithm const* _mesh_source{nullptr};
};
......@@ -21,7 +21,7 @@
/// Constructor
MeshQualitySelectionDialog::MeshQualitySelectionDialog(QDialog* parent)
: QDialog(parent), _metric (MeshLib::MeshQualityType::EDGERATIO), _histogram_path("")
: QDialog(parent), _histogram_path("")
{
setupUi(this);
this->choiceEdges->toggle();
......
......@@ -30,7 +30,7 @@ class MeshQualitySelectionDialog : public QDialog, private Ui_MeshQualitySelecti
public:
MeshQualitySelectionDialog(QDialog* parent = nullptr);
~MeshQualitySelectionDialog(void) override;
~MeshQualitySelectionDialog() override;
/// Returns selected metric
MeshLib::MeshQualityType getSelectedMetric() const { return _metric; }
......@@ -42,7 +42,7 @@ public:
std::string getHistogramPath() const { return _histogram_path; }
private:
MeshLib::MeshQualityType _metric;
MeshLib::MeshQualityType _metric{MeshLib::MeshQualityType::EDGERATIO};
std::string _histogram_path;
private slots:
......
......@@ -34,7 +34,7 @@ public:
/**
* Creates an empty view.
*/
StratView(QWidget* parent = nullptr) : _scene(nullptr) { Q_UNUSED(parent); }
StratView(QWidget* parent = nullptr) { Q_UNUSED(parent); }
~StratView() override;
/// Sets the Borehole whose data should be visualised.
......@@ -72,5 +72,5 @@ private:
/// Updates the view automatically when a Borehole is added or when the window containing the view changes its state.
void update();
StratScene* _scene;
StratScene* _scene{nullptr};
};
......@@ -16,9 +16,8 @@
#include <QDoubleValidator>
SurfaceExtractionDialog::SurfaceExtractionDialog(QDialog* parent)
: QDialog(parent), _tolerance(90), _dir(0,0,-1)
: QDialog(parent)
{
setupUi(this);
this->xNormalEdit->setValidator(new QDoubleValidator(-1, 1, 3, xNormalEdit));
......
......@@ -45,6 +45,6 @@ private slots:
void reject() override { this->done(QDialog::Rejected); };
private:
int _tolerance;
MathLib::Vector3 _dir;
int _tolerance{90};
MathLib::Vector3 _dir{0, 0, -1};
};
......@@ -44,9 +44,8 @@
#include <QSettings>
#include <QString>
VisualizationWidget::VisualizationWidget( QWidget* parent /*= 0*/ )
: QWidget(parent), _vtkRender(nullptr), _markerWidget(nullptr),
_interactorStyle(nullptr), _vtkPickCallback(nullptr)
VisualizationWidget::VisualizationWidget(QWidget* parent /*= 0*/)
: QWidget(parent)
{
this->setupUi(this);
......
......@@ -103,9 +103,9 @@ protected slots:
void on_screenshotPushButton_pressed();
private:
vtkRenderer* _vtkRender;
vtkOrientationMarkerWidget* _markerWidget;
VtkCustomInteractorStyle* _interactorStyle;
VtkPickCallback* _vtkPickCallback;
vtkRenderer* _vtkRender{nullptr};
vtkOrientationMarkerWidget* _markerWidget{nullptr};
VtkCustomInteractorStyle* _interactorStyle{nullptr};
VtkPickCallback* _vtkPickCallback{nullptr};
bool _isShowAllOnLoad;
};
......@@ -30,10 +30,7 @@
vtkStandardNewMacro(VtkBGImageSource);
VtkBGImageSource::VtkBGImageSource() : _origin(0,0), _cellsize(1)
{
}
VtkBGImageSource::VtkBGImageSource() = default;
VtkBGImageSource::~VtkBGImageSource() = default;
void VtkBGImageSource::SetRaster(vtkImageAlgorithm *img, double x0, double y0, double scalingFactor)
......
......@@ -43,7 +43,6 @@ protected:
~VtkBGImageSource() override;
private:
std::pair<double, double> _origin;
double _cellsize;
std::pair<double, double> _origin{0, 0};
double _cellsize{1};
};
......@@ -33,7 +33,7 @@
vtkStandardNewMacro(VtkColorByHeightFilter);
VtkColorByHeightFilter::VtkColorByHeightFilter()
: ColorLookupTable(VtkColorLookupTable::New()), _tableRangeScaling(1.0)
: ColorLookupTable(VtkColorLookupTable::New())
{
}
......
......@@ -80,5 +80,5 @@ protected:
VtkColorLookupTable* ColorLookupTable;
double _tableRange[2];
double _tableRangeScaling;
double _tableRangeScaling{1.0};
};
......@@ -26,7 +26,6 @@
vtkStandardNewMacro(VtkColorLookupTable);
VtkColorLookupTable::VtkColorLookupTable()
: _type(DataHolderLib::LUTType::LINEAR)
{
}
......
......@@ -92,5 +92,5 @@ private:
unsigned char expInterpolation(unsigned char a, unsigned char b, double gamma, double p) const;
std::map<double, unsigned char*> _dict;
DataHolderLib::LUTType _type;
DataHolderLib::LUTType _type{DataHolderLib::LUTType::LINEAR};
};
......@@ -44,7 +44,6 @@
vtkStandardNewMacro(VtkCustomInteractorStyle);
VtkCustomInteractorStyle::VtkCustomInteractorStyle()
: _data(nullptr), _highlightActor(false), _alternateMouseActions(false)
{
_selectedMapper = vtkDataSetMapper::New();
_selectedActor = vtkActor::New();
......
......@@ -71,7 +71,7 @@ protected:
~VtkCustomInteractorStyle() override;
/// @brief The vtk object to pick.
vtkDataObject* _data;
vtkDataObject* _data{nullptr};
/// @brief The mapper for highlighting the selected cell.
vtkDataSetMapper* _selectedMapper;
......@@ -80,8 +80,8 @@ protected:
vtkActor* _selectedActor;
private:
bool _highlightActor;
bool _alternateMouseActions;
bool _highlightActor{false};
bool _alternateMouseActions{false};
signals:
/// @brief Emitted when something was picked.
......
......@@ -56,7 +56,6 @@ void vtkSimpleImageFilterExampleExecute(vtkImageData* input,
}
VtkGeoImageSource::VtkGeoImageSource()
: _imageSource(nullptr), _x0(0), _y0(0), _z0(0), _spacing(1)
{
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment