diff --git a/MeshLib/MeshGenerators/LayeredMeshGenerator.cpp b/MeshLib/MeshGenerators/LayeredMeshGenerator.cpp index 1336891d676a46e7059a795401bfc6f3d67c6ca8..5715d24ea3de5d19a90255d7402e842a7081d58f 100644 --- a/MeshLib/MeshGenerators/LayeredMeshGenerator.cpp +++ b/MeshLib/MeshGenerators/LayeredMeshGenerator.cpp @@ -57,10 +57,9 @@ LayeredMeshGenerator::getMesh(std::string const& mesh_name) const MeshLib::Properties properties; if (_materials.size() == _elements.size()) { - boost::optional<MeshLib::PropertyVector<int>&> materials = - properties.createNewPropertyVector<int>( - "MaterialIDs", MeshLib::MeshItemType::Cell); - assert(materials != boost::none); + auto* const materials = properties.createNewPropertyVector<int>( + "MaterialIDs", MeshLib::MeshItemType::Cell); + assert(materials != nullptr); materials->reserve(_materials.size()); std::copy(_materials.cbegin(), _materials.cend(), diff --git a/MeshLib/MeshGenerators/MeshLayerMapper.cpp b/MeshLib/MeshGenerators/MeshLayerMapper.cpp index 5916fa7b12585d9f6bea66f21e1859ee63caf2ca..366627c6aa05fde73828d1b9617c1f8aadc4190f 100644 --- a/MeshLib/MeshGenerators/MeshLayerMapper.cpp +++ b/MeshLib/MeshGenerators/MeshLayerMapper.cpp @@ -60,9 +60,8 @@ MeshLib::Mesh* MeshLayerMapper::createStaticLayers(MeshLib::Mesh const& mesh, st std::vector<MeshLib::Element*> new_elems; new_elems.reserve(nElems * nLayers); MeshLib::Properties properties; - boost::optional<PropertyVector<int>&> materials = - properties.createNewPropertyVector<int>("MaterialIDs", - MeshLib::MeshItemType::Cell); + auto* const materials = properties.createNewPropertyVector<int>( + "MaterialIDs", MeshLib::MeshItemType::Cell); if (!materials) { ERR("Could not create PropertyVector object \"MaterialIDs\"."); diff --git a/MeshLib/MeshGenerators/RasterToMesh.cpp b/MeshLib/MeshGenerators/RasterToMesh.cpp index 9731a06689edfedbb9e3100051b7a926e35cd6d2..d5703b0d319e6fb5b6e05b424c4b430e7c97b773 100644 --- a/MeshLib/MeshGenerators/RasterToMesh.cpp +++ b/MeshLib/MeshGenerators/RasterToMesh.cpp @@ -147,14 +147,14 @@ MeshLib::Mesh* RasterToMesh::constructMesh( MeshLib::Properties properties; if (intensity_type == MeshLib::UseIntensityAs::MATERIALS) { - boost::optional< MeshLib::PropertyVector<int>& > prop_vec = - properties.createNewPropertyVector<int>("MaterialIDs", MeshLib::MeshItemType::Cell, 1); + auto* const prop_vec = properties.createNewPropertyVector<int>( + "MaterialIDs", MeshLib::MeshItemType::Cell, 1); fillPropertyVector<int>(*prop_vec, pix_val, pix_vis, header.n_rows, header.n_cols, elem_type); } else if (intensity_type == MeshLib::UseIntensityAs::DATAVECTOR) { - boost::optional< MeshLib::PropertyVector<double>& > prop_vec = - properties.createNewPropertyVector<double>(array_name, MeshLib::MeshItemType::Cell, 1); + auto* const prop_vec = properties.createNewPropertyVector<double>( + array_name, MeshLib::MeshItemType::Cell, 1); fillPropertyVector<double>(*prop_vec, pix_val, pix_vis, header.n_rows, header.n_cols, elem_type); } diff --git a/MeshLib/MeshGenerators/RasterToMesh.h b/MeshLib/MeshGenerators/RasterToMesh.h index c5820ace20d75dfbfa1d3864b8e082b8707ad456..14706c1ee13af820e25bb0e4f621fde4afe7061e 100644 --- a/MeshLib/MeshGenerators/RasterToMesh.h +++ b/MeshLib/MeshGenerators/RasterToMesh.h @@ -11,14 +11,12 @@ #ifndef RASTERTOMESH_H #define RASTERTOMESH_H -#include <boost/optional.hpp> #include <logog/include/logog.hpp> #include "GeoLib/Raster.h" #include "MeshLib/Location.h" #include "MeshLib/MeshEnums.h" #include "MeshLib/Properties.h" -#include "MeshLib/PropertyVector.h" class vtkImageData; // For conversion from Image to QuadMesh @@ -27,6 +25,8 @@ namespace MeshLib { class Mesh; class Node; class Element; +template <typename T> +class PropertyVector; /** * \brief Converts raster data into an OGS mesh. diff --git a/MeshLib/MeshGenerators/VtkMeshConverter.h b/MeshLib/MeshGenerators/VtkMeshConverter.h index 72db6ee1ed2a26faab99c44faaae7b8aff87fec6..1117df716af989896f2e3659b2bb3660b20bd087 100644 --- a/MeshLib/MeshGenerators/VtkMeshConverter.h +++ b/MeshLib/MeshGenerators/VtkMeshConverter.h @@ -16,7 +16,6 @@ #ifndef VTKMESHCONVERTER_H #define VTKMESHCONVERTER_H -#include <boost/optional.hpp> #include <vtkDataArray.h> #include <vtkType.h> @@ -105,8 +104,8 @@ private: int const nComponents (array.GetNumberOfComponents()); char const*const array_name (array.GetName()); - boost::optional<MeshLib::PropertyVector<T> &> vec - (properties.createNewPropertyVector<T>(array_name, type, nComponents)); + auto* const vec = properties.createNewPropertyVector<T>( + array_name, type, nComponents); if (!vec) { WARN("Array %s could not be converted to PropertyVector.", array_name);