diff --git a/CMakeLists.txt b/CMakeLists.txt index 9f24b1b32f..6ce08970d4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -520,6 +520,7 @@ set(SIMPLNX_HDRS ${SIMPLNX_SOURCE_DIR}/Utilities/ClusteringUtilities.hpp ${SIMPLNX_SOURCE_DIR}/Utilities/MontageUtilities.hpp ${SIMPLNX_SOURCE_DIR}/Utilities/SIMPLConversion.hpp + ${SIMPLNX_SOURCE_DIR}/Utilities/DataTypeUtilities.hpp ${SIMPLNX_SOURCE_DIR}/Utilities/Math/GeometryMath.hpp ${SIMPLNX_SOURCE_DIR}/Utilities/Math/MatrixMath.hpp @@ -720,6 +721,7 @@ set(SIMPLNX_SRCS ${SIMPLNX_SOURCE_DIR}/Utilities/SampleSurfaceMesh.cpp ${SIMPLNX_SOURCE_DIR}/Utilities/MontageUtilities.cpp ${SIMPLNX_SOURCE_DIR}/Utilities/TimeUtilities.cpp + ${SIMPLNX_SOURCE_DIR}/Utilities/DataTypeUtilities.cpp ${SIMPLNX_SOURCE_DIR}/Utilities/Parsing/DREAM3D/Dream3dIO.cpp diff --git a/src/simplnx/Common/Types.hpp b/src/simplnx/Common/Types.hpp index a4590ea99c..ae81ba3087 100644 --- a/src/simplnx/Common/Types.hpp +++ b/src/simplnx/Common/Types.hpp @@ -99,26 +99,4 @@ enum class FaultState Errors = 2 }; -inline const std::set& GetAllDataTypes() -{ - static const std::set dataTypes = {nx::core::DataType::int8, nx::core::DataType::uint8, nx::core::DataType::int16, nx::core::DataType::uint16, - nx::core::DataType::int32, nx::core::DataType::uint32, nx::core::DataType::int64, nx::core::DataType::uint64, - nx::core::DataType::float32, nx::core::DataType::float64, nx::core::DataType::boolean}; - return dataTypes; -} - -inline const std::set& GetAllNumericTypes() -{ - static const std::set dataTypes = {nx::core::DataType::int8, nx::core::DataType::uint8, nx::core::DataType::int16, nx::core::DataType::uint16, nx::core::DataType::int32, - nx::core::DataType::uint32, nx::core::DataType::int64, nx::core::DataType::uint64, nx::core::DataType::float32, nx::core::DataType::float64}; - return dataTypes; -} - -inline const std::set& GetIntegerDataTypes() -{ - static const std::set dataTypes = {nx::core::DataType::int8, nx::core::DataType::uint8, nx::core::DataType::int16, nx::core::DataType::uint16, - nx::core::DataType::int32, nx::core::DataType::uint32, nx::core::DataType::int64, nx::core::DataType::uint64}; - return dataTypes; -} - } // namespace nx::core diff --git a/src/simplnx/Parameters/ArraySelectionParameter.hpp b/src/simplnx/Parameters/ArraySelectionParameter.hpp index 22e3b828b3..25bbf5055f 100644 --- a/src/simplnx/Parameters/ArraySelectionParameter.hpp +++ b/src/simplnx/Parameters/ArraySelectionParameter.hpp @@ -3,6 +3,7 @@ #include "simplnx/DataStructure/IArray.hpp" #include "simplnx/Filter/MutableDataParameter.hpp" #include "simplnx/Filter/ParameterTraits.hpp" +#include "simplnx/Utilities/DataTypeUtilities.hpp" #include "simplnx/simplnx_export.hpp" #include @@ -18,7 +19,7 @@ class SIMPLNX_EXPORT ArraySelectionParameter : public MutableDataParameter { public: using ValueType = DataPath; - using AllowedTypes = std::set; + using AllowedTypes = nx::core::DataTypeSetType; using AllowedComponentShapes = std::vector; enum class DataLocation : uint8 diff --git a/src/simplnx/Parameters/MultiArraySelectionParameter.hpp b/src/simplnx/Parameters/MultiArraySelectionParameter.hpp index c42502137c..059f880374 100644 --- a/src/simplnx/Parameters/MultiArraySelectionParameter.hpp +++ b/src/simplnx/Parameters/MultiArraySelectionParameter.hpp @@ -3,6 +3,7 @@ #include "simplnx/DataStructure/IArray.hpp" #include "simplnx/Filter/MutableDataParameter.hpp" #include "simplnx/Filter/ParameterTraits.hpp" +#include "simplnx/Utilities/DataTypeUtilities.hpp" namespace nx::core { @@ -14,7 +15,7 @@ class SIMPLNX_EXPORT MultiArraySelectionParameter : public MutableDataParameter public: using ValueType = std::vector; using AllowedTypes = std::set; - using AllowedDataTypes = std::set; + using AllowedDataTypes = nx::core::DataTypeSetType; using AllowedComponentShapes = std::vector; MultiArraySelectionParameter() = delete; diff --git a/src/simplnx/Utilities/DataTypeUtilities.cpp b/src/simplnx/Utilities/DataTypeUtilities.cpp new file mode 100644 index 0000000000..f3e6416d89 --- /dev/null +++ b/src/simplnx/Utilities/DataTypeUtilities.cpp @@ -0,0 +1,28 @@ + +#include "DataTypeUtilities.hpp" + +namespace nx::core +{ +const std::set& GetAllDataTypes() +{ + static const DataTypeSetType dataTypes = {nx::core::DataType::int8, nx::core::DataType::uint8, nx::core::DataType::int16, nx::core::DataType::uint16, + nx::core::DataType::int32, nx::core::DataType::uint32, nx::core::DataType::int64, nx::core::DataType::uint64, + nx::core::DataType::float32, nx::core::DataType::float64, nx::core::DataType::boolean}; + return dataTypes; +} + +const std::set& GetAllNumericTypes() +{ + static const DataTypeSetType dataTypes = {nx::core::DataType::int8, nx::core::DataType::uint8, nx::core::DataType::int16, nx::core::DataType::uint16, nx::core::DataType::int32, + nx::core::DataType::uint32, nx::core::DataType::int64, nx::core::DataType::uint64, nx::core::DataType::float32, nx::core::DataType::float64}; + return dataTypes; +} + +const std::set& GetIntegerDataTypes() +{ + static const DataTypeSetType dataTypes = {nx::core::DataType::int8, nx::core::DataType::uint8, nx::core::DataType::int16, nx::core::DataType::uint16, + nx::core::DataType::int32, nx::core::DataType::uint32, nx::core::DataType::int64, nx::core::DataType::uint64}; + return dataTypes; +} + +} // namespace nx::core diff --git a/src/simplnx/Utilities/DataTypeUtilities.hpp b/src/simplnx/Utilities/DataTypeUtilities.hpp new file mode 100644 index 0000000000..f5b48b3f33 --- /dev/null +++ b/src/simplnx/Utilities/DataTypeUtilities.hpp @@ -0,0 +1,28 @@ +#pragma once + +#include "simplnx/Common/Types.hpp" +#include "simplnx/simplnx_export.hpp" + +#include + +namespace nx::core +{ + +using DataTypeSetType = std::set; + +/** + * @brief + */ +SIMPLNX_EXPORT const DataTypeSetType& GetAllDataTypes(); + +/** + * @brief + */ +SIMPLNX_EXPORT const DataTypeSetType& GetAllNumericTypes(); + +/** + * @brief + */ +SIMPLNX_EXPORT const DataTypeSetType& GetIntegerDataTypes(); + +}; // namespace nx::core diff --git a/test/DataArrayTest.cpp b/test/DataArrayTest.cpp index 628564bec4..a47527189e 100644 --- a/test/DataArrayTest.cpp +++ b/test/DataArrayTest.cpp @@ -1,9 +1,9 @@ #include "simplnx/DataStructure/DataArray.hpp" #include "simplnx/Common/Array.hpp" +#include "simplnx/Core/Application.hpp" #include "simplnx/DataStructure/DataStore.hpp" #include "simplnx/DataStructure/DataStructure.hpp" #include "simplnx/Utilities/DataArrayUtilities.hpp" -#include "simplnx/Core/Application.hpp" #include