Skip to content
Permalink
Browse files

Changed ModifiedLambertProjectionArray functions to be const (#919)

* Changed to match DataArray changes in branch SIMPL/feature/const
  • Loading branch information...
JDuffeyBQ committed Oct 28, 2019
1 parent 6086fec commit b7f5abbb33955b0af17c3599822d79ee186ae7f9
@@ -56,7 +56,7 @@ ModifiedLambertProjectionArray::~ModifiedLambertProjectionArray() = default;
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void ModifiedLambertProjectionArray::getXdmfTypeAndSize(QString& xdmfTypeName, int& precision)
void ModifiedLambertProjectionArray::getXdmfTypeAndSize(QString& xdmfTypeName, int& precision) const
{
xdmfTypeName = getNameOfClass();
precision = 0;
@@ -65,28 +65,28 @@ void ModifiedLambertProjectionArray::getXdmfTypeAndSize(QString& xdmfTypeName, i
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
QString ModifiedLambertProjectionArray::getTypeAsString() { return "ModifiedLambertProjectionArray"; }
QString ModifiedLambertProjectionArray::getTypeAsString() const { return "ModifiedLambertProjectionArray"; }

// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
IDataArray::Pointer ModifiedLambertProjectionArray::createNewArray(size_t numElements, int rank, const size_t* dims, const QString& name, bool allocate)
IDataArray::Pointer ModifiedLambertProjectionArray::createNewArray(size_t numElements, int rank, const size_t* dims, const QString& name, bool allocate) const
{
return ModifiedLambertProjectionArray::NullPointer();
}

// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
IDataArray::Pointer ModifiedLambertProjectionArray::createNewArray(size_t numElements, const std::vector<size_t>& dims, const QString& name, bool allocate)
IDataArray::Pointer ModifiedLambertProjectionArray::createNewArray(size_t numElements, const std::vector<size_t>& dims, const QString& name, bool allocate) const
{
return ModifiedLambertProjectionArray::NullPointer();
}

// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
bool ModifiedLambertProjectionArray::isAllocated()
bool ModifiedLambertProjectionArray::isAllocated() const
{
return m_IsAllocated;
}
@@ -171,7 +171,7 @@ void ModifiedLambertProjectionArray::setName(const QString& name)
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
QString ModifiedLambertProjectionArray::getName()
QString ModifiedLambertProjectionArray::getName() const
{
return m_Name;
}
@@ -211,15 +211,15 @@ void* ModifiedLambertProjectionArray::getVoidPointer(size_t i)
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
size_t ModifiedLambertProjectionArray::getNumberOfTuples()
size_t ModifiedLambertProjectionArray::getNumberOfTuples() const
{
return m_ModifiedLambertProjectionArray.size();
}

// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
size_t ModifiedLambertProjectionArray::getSize()
size_t ModifiedLambertProjectionArray::getSize() const
{
return m_ModifiedLambertProjectionArray.size();
}
@@ -238,15 +238,15 @@ void ModifiedLambertProjectionArray::SetNumberOfComponents(int nc)
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
int ModifiedLambertProjectionArray::getNumberOfComponents()
int ModifiedLambertProjectionArray::getNumberOfComponents() const
{
return 1;
}

// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
std::vector<size_t> ModifiedLambertProjectionArray::getComponentDimensions()
std::vector<size_t> ModifiedLambertProjectionArray::getComponentDimensions() const
{
std::vector<size_t> dims(1, 1);
return dims;
@@ -262,15 +262,15 @@ void ModifiedLambertProjectionArray::SetRank(int rnk)
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
int ModifiedLambertProjectionArray::getRank()
int ModifiedLambertProjectionArray::getRank() const
{
return 1;
}

// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
size_t ModifiedLambertProjectionArray::getTypeSize()
size_t ModifiedLambertProjectionArray::getTypeSize() const
{
return sizeof(ModifiedLambertProjection);
}
@@ -396,7 +396,7 @@ void ModifiedLambertProjectionArray::initializeWithZeros()
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
IDataArray::Pointer ModifiedLambertProjectionArray::deepCopy(bool forceNoAllocate)
IDataArray::Pointer ModifiedLambertProjectionArray::deepCopy(bool forceNoAllocate) const
{
ModifiedLambertProjectionArray::Pointer daCopyPtr = ModifiedLambertProjectionArray::New();
if(!forceNoAllocate)
@@ -431,14 +431,14 @@ void ModifiedLambertProjectionArray::resizeTuples(size_t numTuples)
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void ModifiedLambertProjectionArray::printTuple(QTextStream& out, size_t i, char delimiter)
void ModifiedLambertProjectionArray::printTuple(QTextStream& out, size_t i, char delimiter) const
{
Q_ASSERT(false);
}
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void ModifiedLambertProjectionArray::printComponent(QTextStream& out, size_t i, int j)
void ModifiedLambertProjectionArray::printComponent(QTextStream& out, size_t i, int j) const
{
Q_ASSERT(false);
}
@@ -598,7 +598,7 @@ void Create2DExpandableDataset(hid_t gid, const QString& dsetName, int lambertSi
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
int ModifiedLambertProjectionArray::writeH5Data(hid_t parentId, std::vector<size_t> tDims)
int ModifiedLambertProjectionArray::writeH5Data(hid_t parentId, std::vector<size_t> tDims) const
{
herr_t err = 0;
if(m_ModifiedLambertProjectionArray.empty())
@@ -688,7 +688,7 @@ int ModifiedLambertProjectionArray::readH5Data(hid_t parentId)
//
// -----------------------------------------------------------------------------
int ModifiedLambertProjectionArray::writeXdmfAttribute(QTextStream& out, int64_t* volDims, const QString& hdfFileName,
const QString& groupPath, const QString& labelb)
const QString& groupPath, const QString& labelb) const
{
out << "<!-- Xdmf is not supported for " << getNameOfClass() << " with type " << getTypeAsString() << " --> ";
return -1;
@@ -697,7 +697,7 @@ int ModifiedLambertProjectionArray::writeXdmfAttribute(QTextStream& out, int64_t
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
QString ModifiedLambertProjectionArray::getInfoString(SIMPL::InfoStringFormat format)
QString ModifiedLambertProjectionArray::getInfoString(SIMPL::InfoStringFormat format) const
{
QString info;
QTextStream ss (&info);
@@ -65,14 +65,14 @@ class OrientationLib_EXPORT ModifiedLambertProjectionArray : public IDataArray
* @param xdmfTypeName
* @param precision
*/
void getXdmfTypeAndSize(QString& xdmfTypeName, int& precision) override;
void getXdmfTypeAndSize(QString& xdmfTypeName, int& precision) const override;

/**
* @brief GetTypeName Returns a string representation of the type of data that is stored by this class. This
* can be a primitive like char, float, int or the name of a class.
* @return
*/
QString getTypeAsString() override;
QString getTypeAsString() const override;

SIMPL_INSTANCE_PROPERTY(int, Phase)

@@ -87,7 +87,7 @@ class OrientationLib_EXPORT ModifiedLambertProjectionArray : public IDataArray
* @param allocate
* @return
*/
IDataArray::Pointer createNewArray(size_t numElements, int rank, const size_t* dims, const QString& name, bool allocate = true) override;
IDataArray::Pointer createNewArray(size_t numElements, int rank, const size_t* dims, const QString& name, bool allocate = true) const override;

/**
* @brief createNewArray
@@ -97,12 +97,12 @@ class OrientationLib_EXPORT ModifiedLambertProjectionArray : public IDataArray
* @param allocate
* @return
*/
IDataArray::Pointer createNewArray(size_t numElements, const std::vector<size_t>& dims, const QString& name, bool allocate = true) override;
IDataArray::Pointer createNewArray(size_t numElements, const std::vector<size_t>& dims, const QString& name, bool allocate = true) const override;

/**
* @brief
*/
bool isAllocated() override;
bool isAllocated() const override;

/**
* @brief clearAll
@@ -149,7 +149,7 @@ class OrientationLib_EXPORT ModifiedLambertProjectionArray : public IDataArray
* @brief getName
* @return
*/
QString getName();
QString getName() const;

/**
* @brief Makes this class responsible for freeing the memory.
@@ -175,13 +175,13 @@ class OrientationLib_EXPORT ModifiedLambertProjectionArray : public IDataArray
/**
* @brief Returns the number of Tuples in the array.
*/
size_t getNumberOfTuples() override;
size_t getNumberOfTuples() const override;

/**
* @brief Return the number of elements in the array
* @return
*/
size_t getSize() override;
size_t getSize() const override;

/**
* @brief SetNumberOfComponents
@@ -193,13 +193,13 @@ class OrientationLib_EXPORT ModifiedLambertProjectionArray : public IDataArray
* @brief getNumberOfComponents
* @return
*/
int getNumberOfComponents() override;
int getNumberOfComponents() const override;

/**
* @brief getComponentDimensions
* @return
*/
std::vector<size_t> getComponentDimensions() override;
std::vector<size_t> getComponentDimensions() const override;

/**
* @brief SetRank
@@ -211,7 +211,7 @@ class OrientationLib_EXPORT ModifiedLambertProjectionArray : public IDataArray
* @brief getRank
* @return
*/
virtual int getRank();
virtual int getRank() const;

/**
* @brief Returns the number of bytes that make up the data type.
@@ -220,7 +220,7 @@ class OrientationLib_EXPORT ModifiedLambertProjectionArray : public IDataArray
* 4 = 32 bit integer/Float
* 8 = 64 bit integer/Double
*/
size_t getTypeSize() override;
size_t getTypeSize() const override;

/**
* @brief Removes Tuples from the Array. If the size of the vector is Zero nothing is done. If the size of the
@@ -281,7 +281,7 @@ class OrientationLib_EXPORT ModifiedLambertProjectionArray : public IDataArray
* @brief deepCopy
* @return
*/
IDataArray::Pointer deepCopy(bool forceNoAllocate = false) override;
IDataArray::Pointer deepCopy(bool forceNoAllocate = false) const override;

/**
* @brief Reseizes the internal array
@@ -302,22 +302,22 @@ class OrientationLib_EXPORT ModifiedLambertProjectionArray : public IDataArray
* @param i
* @param delimiter
*/
void printTuple(QTextStream& out, size_t i, char delimiter = ',') override;
void printTuple(QTextStream& out, size_t i, char delimiter = ',') const override;

/**
* @brief printComponent
* @param out
* @param i
* @param j
*/
void printComponent(QTextStream& out, size_t i, int j) override;
void printComponent(QTextStream& out, size_t i, int j) const override;

/**
*
* @param parentId
* @return
*/
int writeH5Data(hid_t parentId, std::vector<size_t> tDims) override;
int writeH5Data(hid_t parentId, std::vector<size_t> tDims) const override;

/**
* @brief readH5Data
@@ -334,14 +334,14 @@ class OrientationLib_EXPORT ModifiedLambertProjectionArray : public IDataArray
* @param groupPath
* @return
*/
int writeXdmfAttribute(QTextStream& out, int64_t* volDims, const QString& hdfFileName, const QString& groupPath, const QString& labelb) override;
int writeXdmfAttribute(QTextStream& out, int64_t* volDims, const QString& hdfFileName, const QString& groupPath, const QString& labelb) const override;

/**
* @brief getInfoString
* @return Returns a formatted string that contains general infomation about
* the instance of the object.
*/
QString getInfoString(SIMPL::InfoStringFormat format) override;
QString getInfoString(SIMPL::InfoStringFormat format) const override;

protected:
ModifiedLambertProjectionArray();

0 comments on commit b7f5abb

Please sign in to comment.
You can’t perform that action at this time.