Skip to content

Commit

Permalink
Fix compiler warnings and small code cleanups
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Jackson <[email protected]>
  • Loading branch information
imikejackson committed Mar 12, 2021
1 parent 2eaa5a7 commit a3f74d7
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 58 deletions.
14 changes: 6 additions & 8 deletions Source/Plugins/EMMPM/Gui/FilterParameterWidgets/EMMPMWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,20 +75,18 @@ class EMMPMWidget : public FilterParameterWidget, private Ui::EMMPMWidget
*/
EMMPMWidget(QWidget* parent = nullptr);

virtual ~EMMPMWidget();

void initialize(FilterParameter* parameter, AbstractFilter* filter = nullptr);
~EMMPMWidget() override;

/**
* @brief This method does additional GUI widget connections
*/
void setupGui();
void setupGui() override;

void setFilter(AbstractFilter* value);
AbstractFilter* getFilter() const;
void setFilter(AbstractFilter* value) override;
AbstractFilter* getFilter() const override;

void setFilterParameter(FilterParameter* value);
FilterParameter* getFilterParameter() const;
void setFilterParameter(FilterParameter* value) override;
FilterParameter* getFilterParameter() const override;

public Q_SLOTS:
void beforePreflight();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,13 @@ class ConvertHexGridToSquareGridWidget : public FilterParameterWidget, private U
/**
* @brief Initializes some of the GUI elements with selections or other GUI related items
*/
virtual void setupGui();
void setupGui() override;

void setFilter(AbstractFilter* value);
AbstractFilter* getFilter() const;
void setFilter(AbstractFilter* value) override;
AbstractFilter* getFilter() const override;

void setFilterParameter(FilterParameter* value);
FilterParameter* getFilterParameter() const;
void setFilterParameter(FilterParameter* value) override;
FilterParameter* getFilterParameter() const override;

public Q_SLOTS:
void widgetChanged(const QString& msg);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ class EbsdToH5EbsdWidget : public FilterParameterWidget, private Ui::EbsdToH5Ebs
*/
void setupGui() override;

void setFilter(AbstractFilter* value);
AbstractFilter* getFilter() const;
void setFilter(AbstractFilter* value) override;
AbstractFilter* getFilter() const override;

public Q_SLOTS:
void widgetChanged(const QString& msg);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ class OEMEbsdScanSelectionWidget : public FilterParameterWidget, private Ui::OEM

void updateList();

void setFilter(AbstractFilter* value);
AbstractFilter* getFilter() const;
void setFilter(AbstractFilter* value) override;
AbstractFilter* getFilter() const override;

void setFilterParameter(FilterParameter* value);
FilterParameter* getFilterParameter() const;
void setFilterParameter(FilterParameter* value) override;
FilterParameter* getFilterParameter() const override;

public Q_SLOTS:
void beforePreflight();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,35 +43,23 @@

#include "EbsdLib/Core/EbsdLibConstants.h"
#include "EbsdLib/Core/EbsdMacros.h"
#include "EbsdLib/IO/H5EbsdVolumeInfo.h"
#include "EbsdLib/IO/H5EbsdVolumeReader.h"
#include "EbsdLib/IO/HKL/CtfFields.h"
#include "EbsdLib/IO/HKL/H5CtfVolumeReader.h"
#include "EbsdLib/IO/TSL/AngFields.h"
#include "EbsdLib/IO/TSL/H5AngVolumeReader.h"

#include "SIMPLib/Common/Constants.h"
#include "SIMPLib/Utilities/FilterCompatibility.hpp"
#include "SIMPLib/Utilities/SIMPLDataPathValidator.h"

#include "SVWidgetsLib/QtSupport/QtSFileCompleter.h"
#include "SVWidgetsLib/QtSupport/QtSFileUtils.h"
#include "SVWidgetsLib/QtSupport/QtSHelpUrlGenerator.h"
#include "SVWidgetsLib/QtSupport/QtSMacros.h"

#include "OrientationAnalysis/FilterParameters/ReadH5EbsdFilterParameter.h"
#include "OrientationAnalysis/OrientationAnalysisConstants.h"
#include "OrientationAnalysis/OrientationAnalysisFilters/ReadH5Ebsd.h"

// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
ReadH5EbsdWidget::ReadH5EbsdWidget(FilterParameter* parameter, AbstractFilter* filter, QWidget* parent)
: FilterParameterWidget(parameter, filter, parent)
, m_NewFileLoaded(false)
, m_Version4Warning(false)
, m_SampleTransformation(0.0f, 0.0f, 1.0f, 0.0f)
, m_EulerTransformation(0.0f, 0.0f, 1.0f, 0.0f)
{
m_Filter = SIMPL_FILTER_COMPATIBILITY_CHECK(filter, parameter, ReadH5EbsdWidget, ReadH5Ebsd);
m_FilterParameter = SIMPL_FILTER_PARAMETER_COMPATIBILITY_CHECK(filter, parameter, ReadH5EbsdWidget, ReadH5EbsdFilterParameter);
Expand Down Expand Up @@ -602,9 +590,6 @@ void ReadH5EbsdWidget::updateFileInfoWidgets()
int64_t ypoints = 0;
int64_t zpoints = 1;

int zStart = 0;
int zEnd = 0;

if(h5Reader->readVolumeInfo() >= 0)
{

Expand All @@ -618,8 +603,8 @@ void ReadH5EbsdWidget::updateFileInfoWidgets()
m_YDim->setText(QString::number(ypoints));
m_ZDim->setText(QString::number(zpoints));

zStart = h5Reader->getZStart();
zEnd = h5Reader->getZEnd();
int32_t zStart = h5Reader->getZStart();
int32_t zEnd = h5Reader->getZEnd();
m_ZMin->setText(QString::number(zStart));
m_ZMax->setText(QString::number(zEnd));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,18 @@ class ReadH5EbsdWidget : public FilterParameterWidget, private Ui::ReadH5EbsdWid
*/
ReadH5EbsdWidget(FilterParameter* parameter, AbstractFilter* filter = nullptr, QWidget* parent = nullptr);

virtual ~ReadH5EbsdWidget();
~ReadH5EbsdWidget() override;

/**
* @brief Initializes some of the GUI elements with selections or other GUI related items
*/
virtual void setupGui();
void setupGui() override;

void setFilter(AbstractFilter* value);
AbstractFilter* getFilter() const;
void setFilter(AbstractFilter* value) override;
AbstractFilter* getFilter() const override;

void setFilterParameter(FilterParameter* value);
FilterParameter* getFilterParameter() const;
void setFilterParameter(FilterParameter* value) override;
FilterParameter* getFilterParameter() const override;

public Q_SLOTS:
// void widgetChanged(const QString& msg);
Expand All @@ -96,11 +96,6 @@ protected Q_SLOTS:
void setInputFilePath(QString val);
QString getInputFilePath();

/**
* @brief setInputFile
* @param v
*/
void setInputFile(const QString& v);

/**
* @brief validateInputFile
Expand Down Expand Up @@ -140,7 +135,7 @@ protected Q_SLOTS:
* @brief
* @param event
*/
void keyPressEvent(QKeyEvent* event);
void keyPressEvent(QKeyEvent* event) override;

/**
* @brief setupMenuField
Expand All @@ -151,14 +146,14 @@ protected Q_SLOTS:
ReadH5Ebsd* m_Filter = nullptr;
ReadH5EbsdFilterParameter* m_FilterParameter = nullptr;
QList<QWidget*> m_WidgetList;
AxisAngleInput m_SampleTransformation;
AxisAngleInput m_EulerTransformation;
AxisAngleInput m_SampleTransformation = {0.0F, 0.0F, 1.0F, 0.0F};
AxisAngleInput m_EulerTransformation = {0.0F, 0.0F, 1.0F, 0.0F};

QAction* m_ShowFileAction = nullptr;
QString m_CurrentText = "";
bool m_DidCausePreflight = false;
bool m_NewFileLoaded;
bool m_Version4Warning;
bool m_NewFileLoaded = false;
bool m_Version4Warning = false;

public:
ReadH5EbsdWidget(const ReadH5EbsdWidget&) = delete; // Copy Constructor Not Implemented
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,7 @@ void FindAvgOrientations::execute()
for(size_t i = 1; i < totalFeatures; i++)
{
avgQuatsPtr = m_AvgQuats + i * 4; // Get the pointer to the current average quaternion
QuatF qAvg(avgQuatsPtr[0], avgQuatsPtr[1], avgQuatsPtr[2], avgQuatsPtr[3]); // Create a copy of the quaternion
qAvg = QuatF::identity();
qAvg.copyInto(avgQuatsPtr, QuatF::Order::VectorScalar);
QuatF::identity().copyInto(avgQuatsPtr, QuatF::Order::VectorScalar);
}
// Initialize all Euler Angles to Zero
m_FeatureEulerAnglesPtr.lock()->initializeWithZeros();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ class InitializeSyntheticVolumeWidget : public FilterParameterWidget, private Ui
*/
void setupGui() override;

void setFilter(AbstractFilter* value);
AbstractFilter* getFilter() const;
void setFilter(AbstractFilter* value) override;
AbstractFilter* getFilter() const override;

public Q_SLOTS:
// void widgetChanged(const QString& msg);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2980,7 +2980,7 @@ void InsertPrecipitatePhases::moveShapeDescriptions()
AttributeMatrix::Pointer cellFeatureAttrMat = getDataContainerArray()->getAttributeMatrix(getFeaturePhasesArrayPath());

QList<IDataArray::Pointer> attrArrays;
for(const QString name : names)
for(const QString& name : names)
{
IDataArray::Pointer arrayPtr = cellFeatureAttrMat->removeAttributeArray(name);
if(arrayPtr != IDataArray::NullPointer())
Expand Down

0 comments on commit a3f74d7

Please sign in to comment.