From b9fe84d7f4d9c8f25b9a9ad90f08119e19a48a37 Mon Sep 17 00:00:00 2001 From: Norihiro Watanabe <norihiro.watanabe@ufz.de> Date: Sat, 21 May 2016 14:20:21 +0200 Subject: [PATCH] move InsituLib to MeshLib/Vtk to fix circular dependency --- .../DataExplorer/DataView/ElementTreeModel.cpp | 6 +++--- Applications/DataExplorer/DataView/MshItem.cpp | 6 +++--- Applications/DataExplorer/DataView/MshItem.h | 6 +++--- Applications/DataExplorer/DataView/MshView.h | 4 ++-- .../DataExplorer/VtkVis/VtkVisPipeline.cpp | 8 ++++---- Applications/DataExplorer/VtkVis/VtkVisPipeline.h | 4 ++-- .../DataExplorer/VtkVis/VtkVisPointSetItem.cpp | 4 ++-- Applications/DataExplorer/mainwindow.cpp | 8 ++++---- Applications/DataExplorer/mainwindow.h | 4 ++-- CMakeLists.txt | 1 - MeshLib/CMakeLists.txt | 5 ++--- MeshLib/IO/VtkIO/VtuInterface-impl.h | 4 ++-- MeshLib/IO/VtkIO/VtuInterface.cpp | 2 +- {InSituLib => MeshLib/Vtk}/VtkMappedMesh.cpp | 2 +- {InSituLib => MeshLib/Vtk}/VtkMappedMesh.h | 2 +- {InSituLib => MeshLib/Vtk}/VtkMappedMeshSource.cpp | 4 ++-- {InSituLib => MeshLib/Vtk}/VtkMappedMeshSource.h | 11 ++++++----- .../Vtk}/VtkMappedPropertyVectorTemplate-impl.h | 4 ++-- .../Vtk}/VtkMappedPropertyVectorTemplate.h | 4 ++-- .../Vtk}/VtkMeshNodalCoordinatesTemplate-impl.h | 2 +- .../Vtk}/VtkMeshNodalCoordinatesTemplate.h | 2 +- Tests/CMakeLists.txt | 2 -- .../TestVtkMappedMeshSource.cpp | 10 ++++------ .../TestVtkMappedPropertyVector.cpp | 14 +++++++------- .../TestVtkMeshNodalCoordinatesTemplate.cpp | 6 +++--- 25 files changed, 60 insertions(+), 65 deletions(-) rename {InSituLib => MeshLib/Vtk}/VtkMappedMesh.cpp (99%) rename {InSituLib => MeshLib/Vtk}/VtkMappedMesh.h (99%) rename {InSituLib => MeshLib/Vtk}/VtkMappedMeshSource.cpp (98%) rename {InSituLib => MeshLib/Vtk}/VtkMappedMeshSource.h (93%) rename {InSituLib => MeshLib/Vtk}/VtkMappedPropertyVectorTemplate-impl.h (99%) rename {InSituLib => MeshLib/Vtk}/VtkMappedPropertyVectorTemplate.h (98%) rename {InSituLib => MeshLib/Vtk}/VtkMeshNodalCoordinatesTemplate-impl.h (99%) rename {InSituLib => MeshLib/Vtk}/VtkMeshNodalCoordinatesTemplate.h (99%) rename Tests/{InSituLib => MeshLib}/TestVtkMappedMeshSource.cpp (98%) rename Tests/{InSituLib => MeshLib}/TestVtkMappedPropertyVector.cpp (90%) rename Tests/{InSituLib => MeshLib}/TestVtkMeshNodalCoordinatesTemplate.cpp (91%) diff --git a/Applications/DataExplorer/DataView/ElementTreeModel.cpp b/Applications/DataExplorer/DataView/ElementTreeModel.cpp index 840c2be8ddf..60eb874656f 100644 --- a/Applications/DataExplorer/DataView/ElementTreeModel.cpp +++ b/Applications/DataExplorer/DataView/ElementTreeModel.cpp @@ -21,7 +21,7 @@ #include "GeoLib/AABB.h" -#include "InSituLib/VtkMappedMeshSource.h" +#include "MeshLib/VtkMappedMeshSource.h" #include "TreeItem.h" @@ -46,8 +46,8 @@ void ElementTreeModel::setElement(vtkUnstructuredGridAlgorithm const*const grid, _mesh_source = grid; this->clearView(); - InSituLib::VtkMappedMeshSource const*const source = - dynamic_cast<InSituLib::VtkMappedMeshSource const*const>(grid); + MeshLib::VtkMappedMeshSource const*const source = + dynamic_cast<MeshLib::VtkMappedMeshSource const*const>(grid); if (!source) return; diff --git a/Applications/DataExplorer/DataView/MshItem.cpp b/Applications/DataExplorer/DataView/MshItem.cpp index 4bb692bbbac..26bc8cdf390 100644 --- a/Applications/DataExplorer/DataView/MshItem.cpp +++ b/Applications/DataExplorer/DataView/MshItem.cpp @@ -13,7 +13,7 @@ */ #include "MshItem.h" -#include "InSituLib/VtkMappedMeshSource.h" +#include "MeshLib/VtkMappedMeshSource.h" /** * Constructor. @@ -24,8 +24,8 @@ MshItem::MshItem(const QList<QVariant> &data, TreeItem* parent, const MeshLib::Mesh* mesh) : TreeItem(data, parent) { - _mesh_source = InSituLib::VtkMappedMeshSource::New(); - static_cast<InSituLib::VtkMappedMeshSource*>(_mesh_source)->SetMesh(mesh); + _mesh_source = MeshLib::VtkMappedMeshSource::New(); + static_cast<MeshLib::VtkMappedMeshSource*>(_mesh_source)->SetMesh(mesh); } MshItem::~MshItem() diff --git a/Applications/DataExplorer/DataView/MshItem.h b/Applications/DataExplorer/DataView/MshItem.h index 2c9debd854a..7855aa7acdc 100644 --- a/Applications/DataExplorer/DataView/MshItem.h +++ b/Applications/DataExplorer/DataView/MshItem.h @@ -17,7 +17,7 @@ #include "TreeItem.h" -#include "InSituLib/VtkMappedMeshSource.h" +#include "MeshLib/VtkMappedMeshSource.h" namespace MeshLib { class Mesh; @@ -37,10 +37,10 @@ public: /// Returns the mesh. MeshLib::Mesh const* getMesh() const { return _mesh_source->GetMesh(); } /// Returns the VTK object. - InSituLib::VtkMappedMeshSource* vtkSource() const { return _mesh_source; } + MeshLib::VtkMappedMeshSource* vtkSource() const { return _mesh_source; } private: - InSituLib::VtkMappedMeshSource * _mesh_source; + MeshLib::VtkMappedMeshSource * _mesh_source; }; #endif //MSHITEM_H diff --git a/Applications/DataExplorer/DataView/MshView.h b/Applications/DataExplorer/DataView/MshView.h index 4ca6e407952..c1117ffb8ec 100644 --- a/Applications/DataExplorer/DataView/MshView.h +++ b/Applications/DataExplorer/DataView/MshView.h @@ -25,7 +25,7 @@ namespace MeshLib { class Mesh; } -namespace InSituLib { +namespace MeshLib { class VtkMappedMeshSource; } @@ -101,7 +101,7 @@ signals: void enableRemoveButton(bool); void meshSelected(MeshLib::Mesh const&); void openMeshFile(int); - void qualityCheckRequested(InSituLib::VtkMappedMeshSource*); + void qualityCheckRequested(MeshLib::VtkMappedMeshSource*); void removeSelectedMeshComponent(); void requestCondSetupDialog(const std::string&, const GeoLib::GEOTYPE, const std::size_t, bool on_points); void requestMeshRemoval(const QModelIndex&); diff --git a/Applications/DataExplorer/VtkVis/VtkVisPipeline.cpp b/Applications/DataExplorer/VtkVis/VtkVisPipeline.cpp index f8a115b53e0..dd763b8ce3b 100644 --- a/Applications/DataExplorer/VtkVis/VtkVisPipeline.cpp +++ b/Applications/DataExplorer/VtkVis/VtkVisPipeline.cpp @@ -36,7 +36,7 @@ #include "VtkVisPipelineItem.h" #include "VtkVisPointSetItem.h" -#include "InSituLib/VtkMappedMeshSource.h" +#include "MeshLib/VtkMappedMeshSource.h" #include <vtkAlgorithm.h> #include <vtkCamera.h> @@ -317,8 +317,8 @@ QModelIndex VtkVisPipeline::addPipelineItem( vtkAlgorithm* source, QModelIndex p vtkXMLReader* new_reader = dynamic_cast<vtkXMLReader*>(source); vtkImageReader2* image_reader = dynamic_cast<vtkImageReader2*>(source); VtkAlgorithmProperties* props = dynamic_cast<VtkAlgorithmProperties*>(source); - InSituLib::VtkMappedMeshSource* meshSource = - dynamic_cast<InSituLib::VtkMappedMeshSource*>(source); + MeshLib::VtkMappedMeshSource* meshSource = + dynamic_cast<MeshLib::VtkMappedMeshSource*>(source); if (old_reader) itemName = old_reader->GetFileName(); else if (new_reader) @@ -432,7 +432,7 @@ void VtkVisPipeline::listArrays(vtkDataSet* dataSet) } void VtkVisPipeline::showMeshElementQuality( - InSituLib::VtkMappedMeshSource* source, + MeshLib::VtkMappedMeshSource* source, MeshLib::MeshQualityType t, std::vector<double> const& quality) { if (!source || quality.empty()) diff --git a/Applications/DataExplorer/VtkVis/VtkVisPipeline.h b/Applications/DataExplorer/VtkVis/VtkVisPipeline.h index cdf6b0f1f51..7623720650e 100644 --- a/Applications/DataExplorer/VtkVis/VtkVisPipeline.h +++ b/Applications/DataExplorer/VtkVis/VtkVisPipeline.h @@ -46,7 +46,7 @@ class StationTreeModel; class TreeModel; class VtkVisPipelineItem; -namespace InSituLib +namespace MeshLib { class VtkMappedMeshSource; } @@ -101,7 +101,7 @@ public: void setGlobalBackfaceCulling(bool enable) const; /// Checks the quality of mesh elements and adds a filter to highlight deformed elements. - void showMeshElementQuality(InSituLib::VtkMappedMeshSource* mesh, MeshLib::MeshQualityType t, std::vector<double> const& quality); + void showMeshElementQuality(MeshLib::VtkMappedMeshSource* mesh, MeshLib::MeshQualityType t, std::vector<double> const& quality); public slots: /// \brief Adds the given Model to the pipeline. diff --git a/Applications/DataExplorer/VtkVis/VtkVisPointSetItem.cpp b/Applications/DataExplorer/VtkVis/VtkVisPointSetItem.cpp index 98fa56fc5bb..5c27699930c 100644 --- a/Applications/DataExplorer/VtkVis/VtkVisPointSetItem.cpp +++ b/Applications/DataExplorer/VtkVis/VtkVisPointSetItem.cpp @@ -31,7 +31,7 @@ #include "VtkCompositeFilter.h" #include "VtkCompositeContourFilter.h" #include "VtkCompositeThresholdFilter.h" -#include "InSituLib/VtkMappedMeshSource.h" +#include "MeshLib/VtkMappedMeshSource.h" #include "QVtkDataSetMapper.h" #include <vtkActor.h> @@ -185,7 +185,7 @@ void VtkVisPointSetItem::Initialize(vtkRenderer* renderer) } // Show edges on meshes - if (dynamic_cast<InSituLib::VtkMappedMeshSource*>(this->_algorithm)) + if (dynamic_cast<MeshLib::VtkMappedMeshSource*>(this->_algorithm)) _vtkProps->GetProperties()->SetEdgeVisibility(1); } diff --git a/Applications/DataExplorer/mainwindow.cpp b/Applications/DataExplorer/mainwindow.cpp index 74130561417..bf6cfe76826 100644 --- a/Applications/DataExplorer/mainwindow.cpp +++ b/Applications/DataExplorer/mainwindow.cpp @@ -57,7 +57,7 @@ #include "VtkRaster.h" #include "VtkVisPipelineItem.h" -#include "InSituLib/VtkMappedMeshSource.h" +#include "MeshLib/VtkMappedMeshSource.h" // FileIO includes #include "GMSInterface.h" @@ -170,9 +170,9 @@ MainWindow::MainWindow(QWidget* parent /* = 0*/) connect(mshTabWidget->treeView, SIGNAL(requestMeshRemoval(const QModelIndex &)), _elementModel.get(), SLOT(clearView())); connect(mshTabWidget->treeView, - SIGNAL(qualityCheckRequested(InSituLib::VtkMappedMeshSource*)), + SIGNAL(qualityCheckRequested(MeshLib::VtkMappedMeshSource*)), this, - SLOT(showMeshQualitySelectionDialog(InSituLib::VtkMappedMeshSource*))); + SLOT(showMeshQualitySelectionDialog(MeshLib::VtkMappedMeshSource*))); connect(mshTabWidget->treeView, SIGNAL(requestMeshToGeometryConversion(const MeshLib::Mesh*)), this, SLOT(convertMeshToGeometry(const MeshLib::Mesh*))); connect(mshTabWidget->treeView, SIGNAL(elementSelected(vtkUnstructuredGridAlgorithm const*const, unsigned, bool)), @@ -1055,7 +1055,7 @@ void MainWindow::showMergeGeometriesDialog() OGSError::box("Points are missing for\n at least one geometry."); } -void MainWindow::showMeshQualitySelectionDialog(InSituLib::VtkMappedMeshSource* mshSource) +void MainWindow::showMeshQualitySelectionDialog(MeshLib::VtkMappedMeshSource* mshSource) { if (mshSource == nullptr) return; diff --git a/Applications/DataExplorer/mainwindow.h b/Applications/DataExplorer/mainwindow.h index 24b1c4da557..81436b36df9 100644 --- a/Applications/DataExplorer/mainwindow.h +++ b/Applications/DataExplorer/mainwindow.h @@ -33,7 +33,7 @@ class TreeModel; class ProcessModel; -namespace InSituLib +namespace MeshLib { class VtkMappedMeshSource; } @@ -104,7 +104,7 @@ protected slots: void showGMSHPrefsDialog(); void showMergeGeometriesDialog(); void showMeshAnalysisDialog(); - void showMeshQualitySelectionDialog(InSituLib::VtkMappedMeshSource* mshSource); + void showMeshQualitySelectionDialog(MeshLib::VtkMappedMeshSource* mshSource); void showVisalizationPrefsDialog(); void updateDataViews(); void writeGeometryToFile(QString listName, QString fileName); diff --git a/CMakeLists.txt b/CMakeLists.txt index 073b3b1fc20..f74323313f8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -196,7 +196,6 @@ endif() add_subdirectory( DataHolderLib ) add_subdirectory( FileIO ) add_subdirectory( GeoLib ) -add_subdirectory( InSituLib ) add_subdirectory( MaterialsLib ) add_subdirectory( MathLib ) add_subdirectory( MeshLib ) diff --git a/MeshLib/CMakeLists.txt b/MeshLib/CMakeLists.txt index 1b23db93238..cb849863055 100644 --- a/MeshLib/CMakeLists.txt +++ b/MeshLib/CMakeLists.txt @@ -13,12 +13,12 @@ GET_SOURCE_FILES(SOURCES_SEARCH MeshSearch) GET_SOURCE_FILES(SOURCES_IO IO) GET_SOURCE_FILES(SOURCES_IO_LEGACY IO/Legacy) GET_SOURCE_FILES(SOURCES_IO_VTKIO IO/VtkIO) - GET_SOURCE_FILES(SOURCES_QUALITY MeshQuality) +GET_SOURCE_FILES(SOURCES_VTK Vtk) set(SOURCES ${SOURCES_MESHLIB} ${SOURCES_ELEMENTS} ${SOURCES_EDITING} ${SOURCES_GENERATORS} ${SOURCES_QUALITY} ${SOURCES_SEARCH} - ${SOURCES_IO} ${SOURCES_IO_LEGACY} ${SOURCES_IO_VTKIO}) + ${SOURCES_IO} ${SOURCES_IO_LEGACY} ${SOURCES_IO_VTKIO} ${SOURCES_VTK}) if(QT4_FOUND) GET_SOURCE_FILES(SOURCES_IO_FEFLOW IO/FEFLOW) @@ -38,7 +38,6 @@ target_link_libraries(MeshLib BaseLib GeoLib MathLib - InSituLib # VtkMappedMeshSource ${VTK_LIBRARIES} ) diff --git a/MeshLib/IO/VtkIO/VtuInterface-impl.h b/MeshLib/IO/VtkIO/VtuInterface-impl.h index 72a76eb8a0d..87fa7faa950 100644 --- a/MeshLib/IO/VtkIO/VtuInterface-impl.h +++ b/MeshLib/IO/VtkIO/VtuInterface-impl.h @@ -24,7 +24,7 @@ #include <logog/include/logog.hpp> -#include "InSituLib/VtkMappedMeshSource.h" +#include "MeshLib/Vtk/VtkMappedMeshSource.h" namespace MeshLib { @@ -44,7 +44,7 @@ bool VtuInterface::writeVTU(std::string const &file_name, const int num_partitio if(_data_mode == vtkXMLWriter::Appended) WARN("Appended data mode is currently not supported, written file is not valid!"); - vtkNew<InSituLib::VtkMappedMeshSource> vtkSource; + vtkNew<MeshLib::VtkMappedMeshSource> vtkSource; vtkSource->SetMesh(_mesh); vtkSmartPointer<UnstructuredGridWriter> vtuWriter = diff --git a/MeshLib/IO/VtkIO/VtuInterface.cpp b/MeshLib/IO/VtkIO/VtuInterface.cpp index eeb68c27bc9..abb2d49d3c1 100644 --- a/MeshLib/IO/VtkIO/VtuInterface.cpp +++ b/MeshLib/IO/VtkIO/VtuInterface.cpp @@ -31,9 +31,9 @@ #endif #include "BaseLib/FileTools.h" -#include "InSituLib/VtkMappedMeshSource.h" #include "MeshLib/Mesh.h" #include "MeshLib/MeshGenerators/VtkMeshConverter.h" +#include "MeshLib/Vtk/VtkMappedMeshSource.h" namespace MeshLib { diff --git a/InSituLib/VtkMappedMesh.cpp b/MeshLib/Vtk/VtkMappedMesh.cpp similarity index 99% rename from InSituLib/VtkMappedMesh.cpp rename to MeshLib/Vtk/VtkMappedMesh.cpp index c73f3dcd0df..a5998250d19 100644 --- a/InSituLib/VtkMappedMesh.cpp +++ b/MeshLib/Vtk/VtkMappedMesh.cpp @@ -30,7 +30,7 @@ #include "MeshLib/Node.h" #include "MeshLib/VtkOGSEnum.h" -namespace InSituLib { +namespace MeshLib { vtkStandardNewMacro(VtkMappedMesh) vtkStandardNewMacro(VtkMappedMeshImpl) diff --git a/InSituLib/VtkMappedMesh.h b/MeshLib/Vtk/VtkMappedMesh.h similarity index 99% rename from InSituLib/VtkMappedMesh.h rename to MeshLib/Vtk/VtkMappedMesh.h index ee5fda3d02c..a80b8d80963 100644 --- a/InSituLib/VtkMappedMesh.h +++ b/MeshLib/Vtk/VtkMappedMesh.h @@ -26,7 +26,7 @@ namespace MeshLib { class Node; } -namespace InSituLib +namespace MeshLib { class VtkMappedMeshImpl : public vtkObject diff --git a/InSituLib/VtkMappedMeshSource.cpp b/MeshLib/Vtk/VtkMappedMeshSource.cpp similarity index 98% rename from InSituLib/VtkMappedMeshSource.cpp rename to MeshLib/Vtk/VtkMappedMeshSource.cpp index 47ed8c52b8e..ee1fab6643a 100644 --- a/InSituLib/VtkMappedMeshSource.cpp +++ b/MeshLib/Vtk/VtkMappedMeshSource.cpp @@ -22,7 +22,7 @@ #include "VtkMappedMesh.h" #include "VtkMeshNodalCoordinatesTemplate.h" -namespace InSituLib { +namespace MeshLib { vtkStandardNewMacro(VtkMappedMeshSource) @@ -116,4 +116,4 @@ int VtkMappedMeshSource::RequestInformation( return 1; } -} // Namespace InSituLib +} // Namespace MeshLib diff --git a/InSituLib/VtkMappedMeshSource.h b/MeshLib/Vtk/VtkMappedMeshSource.h similarity index 93% rename from InSituLib/VtkMappedMeshSource.h rename to MeshLib/Vtk/VtkMappedMeshSource.h index 98116bdcd8b..4460d1bc58c 100644 --- a/InSituLib/VtkMappedMeshSource.h +++ b/MeshLib/Vtk/VtkMappedMeshSource.h @@ -6,7 +6,7 @@ * vtkUnstructuredGrids. * Usage: * \code - * vtkNew<InSituLib::VtkMappedMeshSource> vtkSource; + * vtkNew<MeshLib::VtkMappedMeshSource> vtkSource; * vtkSource->SetMesh(mesh); * vtkSource->Update(); * vtkUnstructuredGrid* output = vtkSource->GetOutput(); @@ -34,10 +34,11 @@ #include <vtkUnstructuredGrid.h> #include <vtkUnstructuredGridAlgorithm.h> -#include "InSituLib/VtkMappedPropertyVectorTemplate.h" #include "MeshLib/Properties.h" #include "MeshLib/PropertyVector.h" +#include "VtkMappedPropertyVectorTemplate.h" + class vtkCellData; class vtkDataArrayCollection; class vtkPointData; @@ -47,7 +48,7 @@ namespace MeshLib { class Properties; } -namespace InSituLib { +namespace MeshLib { /// Adapter which maps a MeshLib::Mesh to a vtkUnstructuredGridAlgorithm. /// Allows for zero-copy access of the mesh from the visualization side. @@ -79,7 +80,7 @@ private: VtkMappedMeshSource(const VtkMappedMeshSource &); // Not implemented. void operator=(const VtkMappedMeshSource &); // Not implemented. - /// Adds a zero-copy array (InSituLib::VtkMappedPropertyVectorTemplate) as + /// Adds a zero-copy array (MeshLib::VtkMappedPropertyVectorTemplate) as /// either point or cell data to the mesh. /// \param properties MeshLib::Properties object /// \param prop_name The name of the property vector to be mapped from @@ -115,6 +116,6 @@ private: vtkNew<vtkCellData> CellData; }; -} // Namespace InSituLib +} // Namespace MeshLib #endif //_VTKMAPPEDMESHSOURCE diff --git a/InSituLib/VtkMappedPropertyVectorTemplate-impl.h b/MeshLib/Vtk/VtkMappedPropertyVectorTemplate-impl.h similarity index 99% rename from InSituLib/VtkMappedPropertyVectorTemplate-impl.h rename to MeshLib/Vtk/VtkMappedPropertyVectorTemplate-impl.h index 54fcf31ff79..b3592b68c1d 100644 --- a/InSituLib/VtkMappedPropertyVectorTemplate-impl.h +++ b/MeshLib/Vtk/VtkMappedPropertyVectorTemplate-impl.h @@ -19,7 +19,7 @@ #include <vtkVariant.h> #include <vtkVariantCast.h> -namespace InSituLib { +namespace MeshLib { // Can't use vtkStandardNewMacro on a templated class. template <class Scalar> VtkMappedPropertyVectorTemplate<Scalar> * @@ -471,4 +471,4 @@ template <class Scalar> vtkIdType VtkMappedPropertyVectorTemplate<Scalar> return -1; } -} // end namespace InSituLib +} // end namespace MeshLib diff --git a/InSituLib/VtkMappedPropertyVectorTemplate.h b/MeshLib/Vtk/VtkMappedPropertyVectorTemplate.h similarity index 98% rename from InSituLib/VtkMappedPropertyVectorTemplate.h rename to MeshLib/Vtk/VtkMappedPropertyVectorTemplate.h index 77fbc650a81..2cef7f9c4a9 100644 --- a/InSituLib/VtkMappedPropertyVectorTemplate.h +++ b/MeshLib/Vtk/VtkMappedPropertyVectorTemplate.h @@ -22,7 +22,7 @@ #include "MeshLib/Elements/Element.h" -namespace InSituLib { +namespace MeshLib { template <class Scalar> class VtkMappedPropertyVectorTemplate : @@ -112,7 +112,7 @@ private: bool Save; }; -} // end namespace InSituLib +} // end namespace MeshLib #include "VtkMappedPropertyVectorTemplate-impl.h" diff --git a/InSituLib/VtkMeshNodalCoordinatesTemplate-impl.h b/MeshLib/Vtk/VtkMeshNodalCoordinatesTemplate-impl.h similarity index 99% rename from InSituLib/VtkMeshNodalCoordinatesTemplate-impl.h rename to MeshLib/Vtk/VtkMeshNodalCoordinatesTemplate-impl.h index f308af44c82..f21973a241e 100644 --- a/InSituLib/VtkMeshNodalCoordinatesTemplate-impl.h +++ b/MeshLib/Vtk/VtkMeshNodalCoordinatesTemplate-impl.h @@ -21,7 +21,7 @@ #include "MeshLib/Node.h" -namespace InSituLib { +namespace MeshLib { // Can't use vtkStandardNewMacro with a template. template <class Scalar> VtkMeshNodalCoordinatesTemplate<Scalar> * diff --git a/InSituLib/VtkMeshNodalCoordinatesTemplate.h b/MeshLib/Vtk/VtkMeshNodalCoordinatesTemplate.h similarity index 99% rename from InSituLib/VtkMeshNodalCoordinatesTemplate.h rename to MeshLib/Vtk/VtkMeshNodalCoordinatesTemplate.h index eff4b21ef90..c9a2b58149a 100644 --- a/InSituLib/VtkMeshNodalCoordinatesTemplate.h +++ b/MeshLib/Vtk/VtkMeshNodalCoordinatesTemplate.h @@ -25,7 +25,7 @@ namespace MeshLib class Node; } -namespace InSituLib +namespace MeshLib { template <class Scalar> diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index cbd1c253f08..86c9fffdb30 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -12,7 +12,6 @@ APPEND_SOURCE_FILES(TEST_SOURCES BaseLib) APPEND_SOURCE_FILES(TEST_SOURCES FileIO) APPEND_SOURCE_FILES(TEST_SOURCES GeoLib) APPEND_SOURCE_FILES(TEST_SOURCES GeoLib/IO) -APPEND_SOURCE_FILES(TEST_SOURCES InSituLib) APPEND_SOURCE_FILES(TEST_SOURCES MathLib) APPEND_SOURCE_FILES(TEST_SOURCES MeshLib) APPEND_SOURCE_FILES(TEST_SOURCES MeshGeoToolsLib) @@ -34,7 +33,6 @@ target_link_libraries(testrunner ApplicationsFileIO FileIO GTest - InSituLib MeshGeoToolsLib MeshLib NumLib diff --git a/Tests/InSituLib/TestVtkMappedMeshSource.cpp b/Tests/MeshLib/TestVtkMappedMeshSource.cpp similarity index 98% rename from Tests/InSituLib/TestVtkMappedMeshSource.cpp rename to Tests/MeshLib/TestVtkMappedMeshSource.cpp index 08b0ad22bfc..ea8e520db7f 100644 --- a/Tests/InSituLib/TestVtkMappedMeshSource.cpp +++ b/Tests/MeshLib/TestVtkMappedMeshSource.cpp @@ -18,14 +18,12 @@ #include <numeric> #include "MeshLib/IO/VtkIO/VtuInterface.h" - -#include "InSituLib/VtkMappedMesh.h" -#include "InSituLib/VtkMappedMeshSource.h" - #include "MeshLib/Elements/Element.h" #include "MeshLib/Mesh.h" #include "MeshLib/MeshGenerators/MeshGenerator.h" #include "MeshLib/MeshGenerators/VtkMeshConverter.h" +#include "MeshLib/Vtk/VtkMappedMesh.h" +#include "MeshLib/Vtk/VtkMappedMeshSource.h" #include "gtest/gtest.h" @@ -127,7 +125,7 @@ TEST_F(InSituMesh, MappedMesh) { ASSERT_TRUE(mesh != nullptr); - vtkNew<InSituLib::VtkMappedMesh> vtkMesh; + vtkNew<MeshLib::VtkMappedMesh> vtkMesh; vtkMesh->GetImplementation()->SetNodes(mesh->getNodes()); vtkMesh->GetImplementation()->SetElements(mesh->getElements()); @@ -155,7 +153,7 @@ TEST_F(InSituMesh, DISABLED_MappedMeshSourceRoundtrip) std::string test_data_file(BaseLib::BuildInfo::tests_tmp_path + "/MappedMeshSourceRoundtrip.vtu"); // -- Test VtkMappedMeshSource, i.e. OGS mesh to VTK mesh - vtkNew<InSituLib::VtkMappedMeshSource> vtkSource; + vtkNew<MeshLib::VtkMappedMeshSource> vtkSource; vtkSource->SetMesh(mesh); vtkSource->Update(); vtkUnstructuredGrid* output = vtkSource->GetOutput(); diff --git a/Tests/InSituLib/TestVtkMappedPropertyVector.cpp b/Tests/MeshLib/TestVtkMappedPropertyVector.cpp similarity index 90% rename from Tests/InSituLib/TestVtkMappedPropertyVector.cpp rename to Tests/MeshLib/TestVtkMappedPropertyVector.cpp index c7099f7247a..4760ac9365c 100644 --- a/Tests/InSituLib/TestVtkMappedPropertyVector.cpp +++ b/Tests/MeshLib/TestVtkMappedPropertyVector.cpp @@ -18,12 +18,12 @@ #include "gtest/gtest.h" -#include "InSituLib/VtkMappedPropertyVectorTemplate.h" #include "MeshLib/Mesh.h" #include "MeshLib/MeshGenerators/MeshGenerator.h" +#include "MeshLib/Vtk/VtkMappedPropertyVectorTemplate.h" // Creates a PropertyVector<double> and maps it into a vtkDataArray-equivalent -TEST(InSituLibMappedPropertyVector, Double) +TEST(MeshLibMappedPropertyVector, Double) { const std::size_t mesh_size = 5; const double length = 1.0; @@ -40,7 +40,7 @@ TEST(InSituLibMappedPropertyVector, Double) (*double_properties).resize(number_of_tuples); std::iota((*double_properties).begin(), (*double_properties).end(), 1); - vtkNew<InSituLib::VtkMappedPropertyVectorTemplate<double> > dataArray; + vtkNew<MeshLib::VtkMappedPropertyVectorTemplate<double> > dataArray; dataArray->SetPropertyVector(*double_properties); ASSERT_EQ(dataArray->GetNumberOfComponents(), 1); @@ -55,7 +55,7 @@ TEST(InSituLibMappedPropertyVector, Double) } // Creates a PropertyVector<int> and maps it into a vtkDataArray-equivalent -TEST(InSituLibMappedPropertyVector, Int) +TEST(MeshLibMappedPropertyVector, Int) { const std::size_t mesh_size = 5; const double length = 1.0; @@ -72,7 +72,7 @@ TEST(InSituLibMappedPropertyVector, Int) (*properties).resize(number_of_tuples); std::iota((*properties).begin(), (*properties).end(), -5); - vtkNew<InSituLib::VtkMappedPropertyVectorTemplate<int> > dataArray; + vtkNew<MeshLib::VtkMappedPropertyVectorTemplate<int> > dataArray; dataArray->SetPropertyVector(*properties); ASSERT_EQ(dataArray->GetNumberOfComponents(), 1); @@ -87,7 +87,7 @@ TEST(InSituLibMappedPropertyVector, Int) } // Creates a PropertyVector<unsigned> and maps it into a vtkDataArray-equivalent -TEST(InSituLibMappedPropertyVector, Unsigned) +TEST(MeshLibMappedPropertyVector, Unsigned) { const std::size_t mesh_size = 5; const double length = 1.0; @@ -104,7 +104,7 @@ TEST(InSituLibMappedPropertyVector, Unsigned) (*properties).resize(number_of_tuples); std::iota((*properties).begin(), (*properties).end(), 0); - vtkNew<InSituLib::VtkMappedPropertyVectorTemplate<unsigned> > dataArray; + vtkNew<MeshLib::VtkMappedPropertyVectorTemplate<unsigned> > dataArray; dataArray->SetPropertyVector(*properties); ASSERT_EQ(dataArray->GetNumberOfComponents(), 1); diff --git a/Tests/InSituLib/TestVtkMeshNodalCoordinatesTemplate.cpp b/Tests/MeshLib/TestVtkMeshNodalCoordinatesTemplate.cpp similarity index 91% rename from Tests/InSituLib/TestVtkMeshNodalCoordinatesTemplate.cpp rename to Tests/MeshLib/TestVtkMeshNodalCoordinatesTemplate.cpp index 18e2eae5e0e..2cd9721fbb2 100644 --- a/Tests/InSituLib/TestVtkMeshNodalCoordinatesTemplate.cpp +++ b/Tests/MeshLib/TestVtkMeshNodalCoordinatesTemplate.cpp @@ -16,11 +16,11 @@ #include "gtest/gtest.h" -#include "InSituLib/VtkMeshNodalCoordinatesTemplate.h" #include "MeshLib/Mesh.h" #include "MeshLib/MeshGenerators/MeshGenerator.h" +#include "MeshLib/Vtk/VtkMeshNodalCoordinatesTemplate.h" -TEST(InSituLibNodalCoordinates, Init) +TEST(MeshLibdalCoordinates, Init) { const std::size_t subdivisions = 99; const double length = 10.0; @@ -28,7 +28,7 @@ TEST(InSituLibNodalCoordinates, Init) MeshLib::Mesh* mesh = MeshLib::MeshGenerator::generateRegularQuadMesh(length, subdivisions); - vtkNew<InSituLib::VtkMeshNodalCoordinatesTemplate<double> > nodeCoords; + vtkNew<MeshLib::VtkMeshNodalCoordinatesTemplate<double> > nodeCoords; nodeCoords->SetNodes(mesh->getNodes()); //nodeCoords->PrintSelf(std::cout, vtkIndent()); -- GitLab