diff --git a/.gitignore b/.gitignore index 9948ccaf0f2863a2a05e1f8a557fdb572c337d9f..04c6661f2d7f50305f3984c67e427e33216f7a1c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,13 @@ -.gitignore -bin/ -binWSL/ +# build directories build/ -source/MSVC2015/ -source/Applications/DLR-F16-Solid/f16-solid-coarse.cfg -.vscode/ +bin/ MSVC2017/ VS2017/ + +# IDE +.vscode/ +.sync/ +.idea/ + +# MacOS +.DS_Store diff --git a/CMake/CMakeCABMacros.cmake b/CMake/CMakeCABMacros.cmake index 85cd2eaa28bd417ee3a5cc5cc9b2082db526b4ba..32e8c1e0fba34debf5dddbce3e19788aa9c24d44 100644 --- a/CMake/CMakeCABMacros.cmake +++ b/CMake/CMakeCABMacros.cmake @@ -18,15 +18,7 @@ SET(CAB_ADDITIONAL_LINK_FLAGS_RELEASE) SET(CAB_ADDITIONAL_LINK_LIBRARIES) -############################################################### -# SOURCE_DIR variable wird beim einbinden automatisch gesetzt - ebenso das include dir!!! -# SOURCE_DIR wird dem Projekt als Standardincludepfad hinzugefuegt -############################################################### -#CMakeCABMacros.txt liegt direkt im source-Ordner -> pfad == SOURCE_ROOT -GET_FILENAME_COMPONENT( SOURCE_ROOT ${CMAKE_CURRENT_LIST_FILE} PATH) -STRING(REGEX REPLACE "(.*)/CMake" "\\1" SOURCE_ROOT "${SOURCE_ROOT}" ) -INCLUDE_DIRECTORIES(${SOURCE_ROOT}) -LIST(APPEND CAB_ADDTIONAL_COMPILER_FLAGS -DSOURCE_ROOT=${SOURCE_ROOT} ) +LIST(APPEND CAB_ADDTIONAL_COMPILER_FLAGS -DSOURCE_ROOT=${VF_ROOT_DIR} ) ############################################################### # hostename ermitteln -> CAB_MACHINE @@ -63,8 +55,8 @@ ENDIF() ############################################################################ # externe (ACHTUNG: die darin enthaltenen benoetigen teils noch macros die # hier im Anschluss folgen -INCLUDE("${SOURCE_ROOT}/CMake/CMakeSetCompilerFlags.cmake") -INCLUDE("${SOURCE_ROOT}/CMake/CMakeCompilerMacros.cmake") +INCLUDE("${VF_CMAKE_DIR}/CMakeSetCompilerFlags.cmake") +INCLUDE("${VF_CMAKE_DIR}/CMakeCompilerMacros.cmake") ################################################################ ### ADD_TARGET_PROPERTIES ### @@ -319,7 +311,7 @@ SET_CAB_COMPILER() CHECK_FOR_VARIABLE(CAB_MACHINE "machine name, e.g. ALTIX, ARWEN") LIST(APPEND CAB_ADDTIONAL_COMPILER_FLAGS -DCAB_MACHINE_${CAB_MACHINE}) LIST(APPEND CAB_ADDTIONAL_COMPILER_FLAGS -DCAB_MACHINE=${CAB_MACHINE}) -SET(CMAKE_CONFIG_FILE "${SOURCE_ROOT}/CMake/cmake_config_files/${CAB_MACHINE}.config.cmake") +SET(CMAKE_CONFIG_FILE "${VF_CMAKE_DIR}/cmake_config_files/${CAB_MACHINE}.config.cmake") IF(NOT EXISTS ${CMAKE_CONFIG_FILE}) MESSAGE(FATAL_ERROR "${CMAKE_CONFIG_FILE} does not exists... maybe false CAB_MACHINE = ${CAB_MACHINE}") diff --git a/CMake/CMakePackages.txt b/CMake/CMakePackages.txt deleted file mode 100644 index f1f371400b880aa027a6ae47a1c62f7a5ef15ae5..0000000000000000000000000000000000000000 --- a/CMake/CMakePackages.txt +++ /dev/null @@ -1,12 +0,0 @@ -#SUBDIRS(numerics/algebra/examples/tutorial) -#SUBDIRS(numerics/geometry3d/examples/stl2inp) -#SUBDIRS(lbmd2q9/a2pII/testcases/inputfile) -SUBDIRS(lbmd2q9/a2pII/testcases/SFC_arne) -IF(NEED_METIS) - MESSAGE(${NEED_METIS}) -ENDIF(NEED_METIS) -SUBDIRS(lbmd2q9/a2pIIparallel/testcases/inputfile) -#SUBDIRS(lbmd3q19/a2pII/testcases/inputfile) -#SUBDIRS(lbmd3q19/OctLBM/testcases/inputfile) -#SUBDIRS(lbmd3q19/OctLBMparallel/testcases/inputfile) -#SUBDIRS(basics/network/examples/FourInOne) diff --git a/CMake/CMakeSetCompilerFlags.cmake b/CMake/CMakeSetCompilerFlags.cmake index 10a277299b1124026dc110c9dc06824603863346..7197caaa64838edbcfbd421af334dd29fe4362ba 100644 --- a/CMake/CMakeSetCompilerFlags.cmake +++ b/CMake/CMakeSetCompilerFlags.cmake @@ -38,8 +38,8 @@ MACRO(SET_COMPILER_SPECIFIC_FLAGS compiler_type build_type) ############################################################################################################### ## standard compiler flags ############################################################################################################### - ELSEIF( EXISTS "${SOURCE_ROOT}/CMake/compilerflags/${CAB_COMPILER}.cmake" ) - INCLUDE( ${SOURCE_ROOT}/CMake/compilerflags/${CAB_COMPILER}.cmake) + ELSEIF( EXISTS "${VF_CMAKE_DIR}/compilerflags/${CAB_COMPILER}.cmake" ) + INCLUDE( ${VF_CMAKE_DIR}/compilerflags/${CAB_COMPILER}.cmake) ############################################################################################################### ## unknown compiler ############################################################################################################### @@ -47,7 +47,7 @@ MACRO(SET_COMPILER_SPECIFIC_FLAGS compiler_type build_type) #MESSAGE(FATAL_ERROR "CAB_COMPILER=${CAB_COMPILER} seems to be a not supported compiler") #MESSAGE(WARNING "CAB_COMPILER=${CAB_COMPILER} seems to be a not supported compiler; set to generic") SET(CAB_COMPILER "gccGeneric") - INCLUDE( ${SOURCE_ROOT}/CMake/compilerflags/${CAB_COMPILER}.cmake) + INCLUDE( ${VF_CMAKE_DIR}/compilerflags/${CAB_COMPILER}.cmake) ENDIF() diff --git a/CMake/FileUtilities.cmake b/CMake/FileUtilities.cmake index e1c8c0f8cf1f7daa9855851223610ba35ac5654d..23e256dfd85b91b1980d168c676ef6a1d2b758ea 100644 --- a/CMake/FileUtilities.cmake +++ b/CMake/FileUtilities.cmake @@ -79,7 +79,6 @@ macro(setSourceGroupForFilesIn file package_dir targetName) if(isAllTestSuite) source_group(${targetName}\\${SOURCE_GROUP} FILES ${file}) else() - #message("SOURCE_GROUP: " ${SOURCE_GROUP} " ,src: " ${file}) source_group(${SOURCE_GROUP} FILES ${file}) endif() #output: - diff --git a/CMake/VirtualFluidsMacros.cmake b/CMake/VirtualFluidsMacros.cmake index 5b059d4fe01d3e7485a1bf70276a91aca218ab41..de563d28fbbbc959f96f29fa69470dc74e713556 100644 --- a/CMake/VirtualFluidsMacros.cmake +++ b/CMake/VirtualFluidsMacros.cmake @@ -165,7 +165,7 @@ function(vf_add_library) target_include_directories(${library_name} PRIVATE ${CMAKE_BINARY_DIR}) target_include_directories(${library_name} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_include_directories(${library_name} PRIVATE ${CMAKE_SOURCE_DIR}/src) + target_include_directories(${library_name} PRIVATE ${VF_SRC_DIR}) #status("... configuring target: ${library_name} (type=${ARG_BUILDTYPE}) done") @@ -215,10 +215,10 @@ function(vf_add_tests) # link tested library target_include_directories(${library_test_name} PRIVATE ${CMAKE_BINARY_DIR}) target_include_directories(${library_test_name} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_include_directories(${library_test_name} PRIVATE ${CMAKE_SOURCE_DIR}/src) + target_include_directories(${library_test_name} PRIVATE ${VF_SRC_DIR}) # link googlemock - include(${CMAKE_PATH}/3rd/gmock.cmake) + include(${VF_CMAKE_DIR}/3rd/gmock.cmake) endfunction() diff --git a/CMake/cmake_config_files/BILBO.config.cmake b/CMake/cmake_config_files/BILBO.config.cmake index e9757065cd956c8ab7f57d0a95388bc3df6c6dd1..ead4ef15bcfe529d4b6a5a2d9d5e6f5211f04a66 100644 --- a/CMake/cmake_config_files/BILBO.config.cmake +++ b/CMake/cmake_config_files/BILBO.config.cmake @@ -39,6 +39,3 @@ IF(${USE_METIS}) SET(METIS_DEBUG_LIBRARY "/usr/local/lib/libmetis.a") SET(METIS_RELEASE_LIBRARY "/usr/local/lib/libmetis.a") ENDIF() -#set(SOURCE_ROOT "/host/Projects/pFluid/source") - -SET(GMOCK_ROOT "~/Libraries/googletest-release-1.10.0" CACHE PATH "GMOCK ROOT") \ No newline at end of file diff --git a/CMake/cmake_config_files/ELLADAN.config.cmake b/CMake/cmake_config_files/ELLADAN.config.cmake index 3729898e3b9f105232db5d8552fbb9e87c85e2d3..7896929276a2969029937ab819b7a59b8132a7c6 100644 --- a/CMake/cmake_config_files/ELLADAN.config.cmake +++ b/CMake/cmake_config_files/ELLADAN.config.cmake @@ -42,6 +42,3 @@ IF(${USE_METIS}) SET(METIS_DEBUG_LIBRARY "/usr/lib/x86_64-linux-gnu/libmetis.so") SET(METIS_RELEASE_LIBRARY "/usr/lib/x86_64-linux-gnu/libmetis.so") ENDIF() -#set(SOURCE_ROOT "/host/Projects/pFluid/source") - -SET(GMOCK_ROOT /usr/src/googletest CACHE PATH "GMOCK ROOT") \ No newline at end of file diff --git a/CMake/cmake_config_files/TESLA01.config.cmake b/CMake/cmake_config_files/TESLA01.config.cmake index 4301bd774cb2a8aa43c0926a03a8e9ade628c2a0..adebd6af01a6fbe44952cdf39f398aa9d7abb49d 100644 --- a/CMake/cmake_config_files/TESLA01.config.cmake +++ b/CMake/cmake_config_files/TESLA01.config.cmake @@ -1,10 +1,9 @@ #Don't change: -SET(METIS_ROOT ${CMAKE_SOURCE_DIR}/3rdParty/metis/metis-5.1.0 CACHE PATH "METIS ROOT") -#SET(GMOCK_ROOT ${CMAKE_SOURCE_DIR}/3rdParty/googletest CACHE PATH "GMOCK ROOT") -SET(JSONCPP_ROOT ${CMAKE_SOURCE_DIR}/3rdParty/jsoncpp CACHE PATH "JSONCPP ROOT") -SET(FFTW_ROOT ${CMAKE_SOURCE_DIR}/3rdParty/fftw/fftw-3.3.7 CACHE PATH "JSONCPP ROOT") +SET(METIS_ROOT ${VF_THIRD_DIR}/metis/metis-5.1.0 CACHE PATH "METIS ROOT") +SET(GMOCK_ROOT ${VF_THIRD_DIR}/googletest CACHE PATH "GMOCK ROOT") +SET(JSONCPP_ROOT ${VF_THIRD_DIR}/jsoncpp CACHE PATH "JSONCPP ROOT") +SET(FFTW_ROOT ${VF_THIRD_DIR}/fftw/fftw-3.3.7 CACHE PATH "JSONCPP ROOT") -SET(GMOCK_ROOT C:\\Libraries\\googletest-release-1.10.0 CACHE PATH "GMOCK ROOT") #SET TO CORRECT PATH: SET(BOOST_ROOT "C:\\Libraries\\boost_1_65_1" CACHE PATH "BOOST_ROOT") diff --git a/CMakeLists.txt b/CMakeLists.txt index 5a69951e72cb04b6385dd4c84a57d0959e82b98d..4219695ee306e8fc48c8ac210521a36a460d203b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,11 @@ set(testFolder "tests") set(appFolder "apps") set(thirdFolder "3rd") +set (VF_CMAKE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/CMake) +set (VF_THIRD_DIR ${CMAKE_CURRENT_SOURCE_DIR}/3rdParty) +set (VF_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src) +set (VF_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}) + ################################################################################# # OPTIONS ################################################################################# @@ -45,13 +50,12 @@ endif() # MACROS ################################################################################# include(CMakePrintHelpers) -set (CMAKE_PATH "${CMAKE_SOURCE_DIR}/CMake") -include("${CMAKE_PATH}/CMakeCABMacros.cmake") -include("${CMAKE_PATH}/FileUtilities.cmake") -include("${CMAKE_PATH}/VirtualFluidsMacros.cmake") +include(${VF_CMAKE_DIR}/CMakeCABMacros.cmake) +include(${VF_CMAKE_DIR}/FileUtilities.cmake) +include(${VF_CMAKE_DIR}/VirtualFluidsMacros.cmake) -include(${CMAKE_PATH}/CMakeMacros_old/general/FindCompiler.cmake) -configure_file(src/basics/VirtualFluidsDefinitions.in.h VirtualFluidsDefinitions.h) +include(${VF_CMAKE_DIR}/CMakeMacros_old/general/FindCompiler.cmake) +configure_file(src/basics/VirtualFluidsDefinitions.in.h ${CMAKE_BINARY_DIR}/VirtualFluidsDefinitions.h) ################################################################################# # COMMON LIBRARIES @@ -72,5 +76,5 @@ endif() # 3rd Party Libraries ################################################################################# if(BUILD_VF_UNIT_TESTS) - add_subdirectory(${CMAKE_SOURCE_DIR}/3rdParty/googletest) + add_subdirectory(${VF_THIRD_DIR}/googletest) endif() diff --git a/apps/cpu/CylinderSt/cylinder_st.cpp b/apps/cpu/CylinderSt/cylinder_st.cpp index e25250c0b69af9cc73e8f8dd031cdeebda835309..824a4d12e8eac4187e06f394a01dddf0f7f5dbde 100644 --- a/apps/cpu/CylinderSt/cylinder_st.cpp +++ b/apps/cpu/CylinderSt/cylinder_st.cpp @@ -1,12 +1,12 @@ #include <iostream> #include <string> -#include "numerics/geometry3d/CoordinateTransformation3D.h" +#include "geometry3d/CoordinateTransformation3D.h" #include "Grid3D.h" #include "GenBlocksGridVisitor.h" -#include "numerics/geometry3d/GbSystem3D.h" -#include "numerics/geometry3d/GbCuboid3D.h" -#include "numerics/geometry3d/GbCylinder3D.h" +#include "geometry3d/GbSystem3D.h" +#include "geometry3d/GbCuboid3D.h" +#include "geometry3d/GbCylinder3D.h" #include "basics/writer/WbWriterVtkXmlASCII.h" #include "basics/writer/WbWriterVtkXmlBinary.h" #include "RefineCrossAndInsideGbObjectBlockVisitor.h" diff --git a/apps/cpu/FlowAroundCylinder/cylinder.cpp1 b/apps/cpu/FlowAroundCylinder/cylinder.cpp1 index b7ddec982c4a70a153fb1f6bf95de85c903fcc6a..5321a23d1c03fe85270cf8e382b8d50dc5df4351 100644 --- a/apps/cpu/FlowAroundCylinder/cylinder.cpp1 +++ b/apps/cpu/FlowAroundCylinder/cylinder.cpp1 @@ -1,12 +1,12 @@ #include <iostream> #include <string> -#include "numerics/geometry3d/CoordinateTransformation3D.h" +#include "geometry3d/CoordinateTransformation3D.h" #include "Grid3D.h" #include "GenBlocksGridVisitor.h" -#include "numerics/geometry3d/GbSystem3D.h" -#include "numerics/geometry3d/GbCuboid3D.h" -#include "numerics/geometry3d/GbCylinder3D.h" +#include "geometry3d/GbSystem3D.h" +#include "geometry3d/GbCuboid3D.h" +#include "geometry3d/GbCylinder3D.h" #include "basics/writer/WbWriterVtkXmlASCII.h" #include "basics/writer/WbWriterVtkXmlBinary.h" #include "RefineCrossAndInsideGbObjectBlockVisitor.h" diff --git a/apps/cpu/FlowAroundCylinder/cylinder.cpp2 b/apps/cpu/FlowAroundCylinder/cylinder.cpp2 index 35d9e975742e0365e4c4827d4bb8f3ebbacf3d4b..4dc7285b37131250607166cca3de70db53935156 100644 --- a/apps/cpu/FlowAroundCylinder/cylinder.cpp2 +++ b/apps/cpu/FlowAroundCylinder/cylinder.cpp2 @@ -1,12 +1,12 @@ #include <iostream> #include <string> -#include "numerics/geometry3d/CoordinateTransformation3D.h" +#include "geometry3d/CoordinateTransformation3D.h" #include "Grid3D.h" #include "GenBlocksGridVisitor.h" -#include "numerics/geometry3d/GbSystem3D.h" -#include "numerics/geometry3d/GbCuboid3D.h" -#include "numerics/geometry3d/GbCylinder3D.h" +#include "geometry3d/GbSystem3D.h" +#include "geometry3d/GbCuboid3D.h" +#include "geometry3d/GbCylinder3D.h" #include "basics/writer/WbWriterVtkXmlASCII.h" #include "basics/writer/WbWriterVtkXmlBinary.h" #include "RefineCrossAndInsideGbObjectBlockVisitor.h" diff --git a/apps/cpu/IncludsList.cmake b/apps/cpu/IncludsList.cmake index 98341df07ca3318610f9f32fe840c5bce7e7fd8c..21cd47eddb5ca7d182a53c7ee01f97ea991aa02e 100644 --- a/apps/cpu/IncludsList.cmake +++ b/apps/cpu/IncludsList.cmake @@ -1,13 +1,14 @@ INCLUDE_DIRECTORIES(${APPS_ROOT_CPU}) -INCLUDE(${CMAKE_SOURCE_DIR}/src/cpu/VirtualFluidsCore/IncludsList.cmake) +INCLUDE(${VF_SRC_DIR}/cpu/VirtualFluidsCore/IncludsList.cmake) -INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/basics) -INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/basics/numerics/geometry3d) -INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/basics/numerics/geometry3d/Creator) -INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/basics/numerics/geometry3d/KdTree) -INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/basics/basics/container) -INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/basics/basics/memory) -INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/basics/basics/objects) -INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/basics/basics/transmiitter) -INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/basics/basics/utilities) -INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/basics/basics/writer) \ No newline at end of file +INCLUDE_DIRECTORIES(${VF_SRC_DIR}/cpu/VirtualFluidsCore) +INCLUDE_DIRECTORIES(${VF_SRC_DIR}/basics) +INCLUDE_DIRECTORIES(${VF_SRC_DIR}/basics/geometry3d) +INCLUDE_DIRECTORIES(${VF_SRC_DIR}/basics/geometry3d/Creator) +INCLUDE_DIRECTORIES(${VF_SRC_DIR}/basics/geometry3d/KdTree) +INCLUDE_DIRECTORIES(${VF_SRC_DIR}/basics/basics/container) +INCLUDE_DIRECTORIES(${VF_SRC_DIR}/basics/basics/memory) +INCLUDE_DIRECTORIES(${VF_SRC_DIR}/basics/basics/objects) +INCLUDE_DIRECTORIES(${VF_SRC_DIR}/basics/basics/transmiitter) +INCLUDE_DIRECTORIES(${VF_SRC_DIR}/basics/basics/utilities) +INCLUDE_DIRECTORIES(${VF_SRC_DIR}/basics/basics/writer) \ No newline at end of file diff --git a/apps/cpu/LaminarTubeFlow/CMakeLists.txt b/apps/cpu/LaminarTubeFlow/CMakeLists.txt index 196cb9c2c8a212502a7607380934c36c340e5899..94a0cc53541f573b6c6975304e6aab1b80e296ad 100644 --- a/apps/cpu/LaminarTubeFlow/CMakeLists.txt +++ b/apps/cpu/LaminarTubeFlow/CMakeLists.txt @@ -1,26 +1,7 @@ -######################################################## -## C++ PROJECT ### -######################################################## -PROJECT(ltf) - -INCLUDE(${APPS_ROOT_CPU}IncludsList.cmake) -################################################################# -### LOCAL FILES ### -################################################################# -#FILE(GLOB SPECIFIC_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.h - # ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp - # ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp ) - -#SET(ALL_SOURCES ${ALL_SOURCES} ${SPECIFIC_FILES}) -#SOURCE_GROUP(src FILES ${SPECIFIC_FILES}) - -#SET(CAB_ADDITIONAL_LINK_LIBRARIES VirtualFluids) +PROJECT(ltf) -################################################################# -### CREATE PROJECT ### -################################################################# -#CREATE_CAB_PROJECT(ltf BINARY) +INCLUDE(${APPS_ROOT_CPU}/IncludsList.cmake) vf_add_library(BUILDTYPE binary DEPENDS VirtualFluidsCore basics ${MPI_CXX_LIBRARIES} FILES ltf.cpp ) diff --git a/apps/cpu/LidDrivenCavity/CMakeLists.txt b/apps/cpu/LidDrivenCavity/CMakeLists.txt index cf76ed91b770c41224313329914517b2925ecd57..a2518ab60534f36f566b7ae1b93012471f466520 100644 --- a/apps/cpu/LidDrivenCavity/CMakeLists.txt +++ b/apps/cpu/LidDrivenCavity/CMakeLists.txt @@ -1,27 +1,6 @@ -#CMAKE_MINIMUM_REQUIRED(VERSION 2.8) -######################################################## -## C++ PROJECT ### -######################################################## -#PROJECT(LidDrivenCavity) +PROJECT(LidDrivenCavity) -INCLUDE(${APPS_ROOT}/IncludsList.cmake) - -################################################################# -### LOCAL FILES ### -################################################################# -#FILE(GLOB SPECIFIC_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.h - # ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp - # ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp ) - -#SET(ALL_SOURCES ${ALL_SOURCES} ${SPECIFIC_FILES}) -#SOURCE_GROUP(src FILES ${SPECIFIC_FILES}) - -#SET(CAB_ADDITIONAL_LINK_LIBRARIES VirtualFluids) - -################################################################# -### CREATE PROJECT ### -################################################################# -#CREATE_CAB_PROJECT(LidDrivenCavity BINARY) +INCLUDE(${APPS_ROOT}/IncludsList.cmake) vf_add_library(BUILDTYPE binary DEPENDS VirtualFluidsCore VirtualFluidsBasic FILES LidDrivenCavity.cpp) diff --git a/apps/cpu/VirtualFluids.h b/apps/cpu/VirtualFluids.h index 2fd3321905ffdd14ba2860282b02e6e6bae9651c..3ce68d66355e843b5b9fe39582706dbd95c82184 100644 --- a/apps/cpu/VirtualFluids.h +++ b/apps/cpu/VirtualFluids.h @@ -12,7 +12,7 @@ #include <omp.h> #endif -#include <basics/Core/PointerDefinitions.h> +#include <basics/PointerDefinitions.h> #include <MuParser/include/muParser.h> #include <MuParser/include/muParserBase.h> @@ -33,22 +33,13 @@ #include <basics/container/CbArray4D.h> #include <basics/container/CbVector.h> #include <basics/container/CbVectorPool.h> -#include <basics/memory/MbMemPool.h> -#include <basics/memory/MbSharedPointerDefines.h> #include <basics/memory/MbSmartPtr.h> #include <basics/memory/MbSmartPtrBase.h> -#include <basics/objects/ObCreator.h> -#include <basics/objects/ObFactory.h> #include <basics/objects/ObObject.h> -#include <basics/objects/ObObjectCreator.h> -#include <basics/objects/ObObjectFactory.h> -#include <basics/objects/ObObjectManager.h> #include <basics/transmitter/TbTransmitter.h> #include <basics/transmitter/TbTransmitterLocal.h> #include <basics/transmitter/TbTransmitterMpiPool.h> -#include <basics/utilities/UbAutoRun.hpp> #include <basics/utilities/UbComparators.h> -#include <basics/utilities/UbConverter.h> #include <basics/utilities/UbEqual.h> #include <basics/utilities/UbException.h> #include <basics/utilities/UbFileInput.h> @@ -65,14 +56,10 @@ #include <basics/utilities/UbNupsTimer.h> #include <basics/utilities/UbObservable.h> #include <basics/utilities/UbObserver.h> -#include <basics/utilities/UbPointerWrapper.h> #include <basics/utilities/UbRandom.h> #include <basics/utilities/UbScheduler.h> -#include <basics/utilities/UbStaticPathMap.h> -#include <basics/utilities/UbString.h> #include <basics/utilities/UbStringInputASCII.h> #include <basics/utilities/UbSystem.h> -#include <basics/utilities/UbTableModel.h> #include <basics/utilities/UbTiming.h> #include <basics/utilities/UbTuple.h> #include <basics/writer/WbWriter.h> @@ -197,52 +184,38 @@ #include <LBM/LBMUnitConverter.h> #include <LBM/LBMKernelETD3Q27BGK.h> -#include <numerics/geometry3d/CoordinateTransformation3D.h> -#include <numerics/geometry3d/GbCuboid3D.h> -#include <numerics/geometry3d/GbCylinder3D.h> -#include <numerics/geometry3d/GbHalfSpace3D.h> -#include <numerics/geometry3d/GbHalfSpaceKrischan3D.h> -#include <numerics/geometry3d/GbLine3D.h> -#include <numerics/geometry3d/GbMeshTools3D.h> -#include <numerics/geometry3d/GbObject3D.h> -#include <numerics/geometry3d/GbObject3DManager.h> -#include <numerics/geometry3d/GbObjectGroup3D.h> -#include <numerics/geometry3d/GbPoint3D.h> -#include <numerics/geometry3d/GbPolygon3D.h> -#include <numerics/geometry3d/GbQuadFaceMesh3D.h> -#include <numerics/geometry3d/GbSphere3D.h> -#include <numerics/geometry3d/GbSystem3D.h> -#include <numerics/geometry3d/GbTriangle3D.h> -#include <numerics/geometry3d/GbTriangularMesh3D.h> -#include <numerics/geometry3d/GbTriFaceMesh3D.h> -#include <numerics/geometry3d/GbVector3D.h> -#include <numerics/geometry3d/GbVoxelMatrix3D.h> -#include <numerics/geometry3d/creator/GbCuboid3DCreator.h> -#include <numerics/geometry3d/creator/GbCylinder3DCreator.h> -#include <numerics/geometry3d/creator/GbLine3DCreator.h> -#include <numerics/geometry3d/creator/GbObject3DCreator.h> -#include <numerics/geometry3d/creator/GbObject3DFactory.h> -#include <numerics/geometry3d/creator/GbPoint3DCreator.h> -#include <numerics/geometry3d/creator/GbPolygon3DCreator.h> -#include <numerics/geometry3d/creator/GbQuadFaceMesh3DCreator.h> -#include <numerics/geometry3d/creator/GbSphere3DCreator.h> -#include <numerics/geometry3d/creator/GbTriangle3DCreator.h> -#include <numerics/geometry3d/creator/GbTriangularMesh3DCreator.h> -#include <numerics/geometry3d/creator/GbTriFaceMesh3DCreator.h> -#include <numerics/geometry3d/creator/GbVoxelMatrix3DCreator.h> -#include <numerics/geometry3d/KdTree/KdNode.h> -#include <numerics/geometry3d/KdTree/KdRay.h> -#include <numerics/geometry3d/KdTree/KdSplitCandidate.h> -#include <numerics/geometry3d/KdTree/KdSplitCandidateManager.h> -#include <numerics/geometry3d/KdTree/KdTree.h> -#include <numerics/geometry3d/KdTree/KdUtilities.h> -#include <numerics/geometry3d/KdTree/intersectionhandler/KdCountLineIntersectionHandler.h> -#include <numerics/geometry3d/KdTree/intersectionhandler/KdCountRayIntersectionHandler.h> -#include <numerics/geometry3d/KdTree/intersectionhandler/KdLineIntersectionHandler.h> -#include <numerics/geometry3d/KdTree/intersectionhandler/KdRayIntersectionHandler.h> -#include <numerics/geometry3d/KdTree/splitalgorithms/KdSAHSplit.h> -#include <numerics/geometry3d/KdTree/splitalgorithms/KdSpatiallMedianSplit.h> -#include <numerics/geometry3d/KdTree/splitalgorithms/KdSplitAlgorithm.h> +#include <geometry3d/CoordinateTransformation3D.h> +#include <geometry3d/GbCuboid3D.h> +#include <geometry3d/GbCylinder3D.h> +#include <geometry3d/GbHalfSpace3D.h> +#include <geometry3d/GbHalfSpaceKrischan3D.h> +#include <geometry3d/GbLine3D.h> +#include <geometry3d/GbMeshTools3D.h> +#include <geometry3d/GbObject3D.h> +#include <geometry3d/GbObjectGroup3D.h> +#include <geometry3d/GbPoint3D.h> +#include <geometry3d/GbPolygon3D.h> +#include <geometry3d/GbQuadFaceMesh3D.h> +#include <geometry3d/GbSphere3D.h> +#include <geometry3d/GbSystem3D.h> +#include <geometry3d/GbTriangle3D.h> +#include <geometry3d/GbTriangularMesh3D.h> +#include <geometry3d/GbTriFaceMesh3D.h> +#include <geometry3d/GbVector3D.h> +#include <geometry3d/GbVoxelMatrix3D.h> +#include <geometry3d/KdTree/KdNode.h> +#include <geometry3d/KdTree/KdRay.h> +#include <geometry3d/KdTree/KdSplitCandidate.h> +#include <geometry3d/KdTree/KdSplitCandidateManager.h> +#include <geometry3d/KdTree/KdTree.h> +#include <geometry3d/KdTree/KdUtilities.h> +#include <geometry3d/KdTree/intersectionhandler/KdCountLineIntersectionHandler.h> +#include <geometry3d/KdTree/intersectionhandler/KdCountRayIntersectionHandler.h> +#include <geometry3d/KdTree/intersectionhandler/KdLineIntersectionHandler.h> +#include <geometry3d/KdTree/intersectionhandler/KdRayIntersectionHandler.h> +#include <geometry3d/KdTree/splitalgorithms/KdSAHSplit.h> +#include <geometry3d/KdTree/splitalgorithms/KdSpatiallMedianSplit.h> +#include <geometry3d/KdTree/splitalgorithms/KdSplitAlgorithm.h> #include <Parallel/Communicator.h> #include <Parallel/MetisPartitioner.h> diff --git a/apps/cpu/bananas/bananas.cpp b/apps/cpu/bananas/bananas.cpp index 9e6744f42318af1cda99edd8ee2e3fdfcd62578b..223fe402890758427361f7861f8ded5fffaa16e1 100644 --- a/apps/cpu/bananas/bananas.cpp +++ b/apps/cpu/bananas/bananas.cpp @@ -1,13 +1,13 @@ #include <iostream> #include <string> -#include "numerics/geometry3d/CoordinateTransformation3D.h" +#include "geometry3d/CoordinateTransformation3D.h" #include "Grid3D.h" #include "GenBlocksGridVisitor.h" -#include "numerics/geometry3d/GbSystem3D.h" -#include "numerics/geometry3d/GbCuboid3D.h" -#include "numerics/geometry3d/GbCylinder3D.h" -#include <numerics/geometry3d/GbSphere3D.h> +#include "geometry3d/GbSystem3D.h" +#include "geometry3d/GbCuboid3D.h" +#include "geometry3d/GbCylinder3D.h" +#include <geometry3d/GbSphere3D.h> #include "basics/writer/WbWriterVtkXmlASCII.h" #include "basics/writer/WbWriterVtkXmlBinary.h" #include "RefineCrossAndInsideGbObjectBlockVisitor.h" @@ -39,14 +39,14 @@ #include "D3Q27OffsetInterpolationProcessor.h" #include "D3Q27CompactInterpolationProcessor.h" #include "SyncBcBlockVisitor.h" -#include "numerics/geometry3d/creator/GbTriFaceMesh3DCreator.h" -#include "numerics/geometry3d/GbTriFaceMesh3D.h" +#include "geometry3d/creator/GbTriFaceMesh3DCreator.h" +#include "geometry3d/GbTriFaceMesh3D.h" #include "D3Q27TriFaceMeshInteractor.h" #include "basics/utilities/UbFileOutputASCII.h" #include "basics/utilities/UbFileInputASCII.h" #include "basics/utilities/UbFileInputBinary.h" #include "basics/container/CbArray3D.h" -#include "numerics/geometry3d/GbVoxelMatrix3D.h" +#include "geometry3d/GbVoxelMatrix3D.h" #define CONVEXHULL diff --git a/apps/cpu/bananas2/bananas2.cpp b/apps/cpu/bananas2/bananas2.cpp index 01a969315c78d2da7418565761f71fe5c75311a3..4a348c219e975782ed52b6a6ac2e6481ed9c63b4 100644 --- a/apps/cpu/bananas2/bananas2.cpp +++ b/apps/cpu/bananas2/bananas2.cpp @@ -1,13 +1,13 @@ #include <iostream> #include <string> -#include "numerics/geometry3d/CoordinateTransformation3D.h" +#include "geometry3d/CoordinateTransformation3D.h" #include "Grid3D.h" #include "GenBlocksGridVisitor.h" -#include "numerics/geometry3d/GbSystem3D.h" -#include "numerics/geometry3d/GbCuboid3D.h" -#include "numerics/geometry3d/GbCylinder3D.h" -#include <numerics/geometry3d/GbSphere3D.h> +#include "geometry3d/GbSystem3D.h" +#include "geometry3d/GbCuboid3D.h" +#include "geometry3d/GbCylinder3D.h" +#include <geometry3d/GbSphere3D.h> #include "basics/writer/WbWriterVtkXmlASCII.h" #include "basics/writer/WbWriterVtkXmlBinary.h" #include "RefineCrossAndInsideGbObjectBlockVisitor.h" @@ -39,14 +39,14 @@ #include "D3Q27OffsetInterpolationProcessor.h" #include "D3Q27CompactInterpolationProcessor.h" #include "SyncBcBlockVisitor.h" -#include "numerics/geometry3d/creator/GbTriFaceMesh3DCreator.h" -#include "numerics/geometry3d/GbTriFaceMesh3D.h" +#include "geometry3d/creator/GbTriFaceMesh3DCreator.h" +#include "geometry3d/GbTriFaceMesh3D.h" #include "D3Q27TriFaceMeshInteractor.h" #include "basics/utilities/UbFileOutputASCII.h" #include "basics/utilities/UbFileInputASCII.h" #include "basics/utilities/UbFileInputBinary.h" #include "basics/container/CbArray3D.h" -#include "numerics/geometry3d/GbVoxelMatrix3D.h" +#include "geometry3d/GbVoxelMatrix3D.h" /* diff --git a/apps/cpu/block_test/block_test_all.hpp b/apps/cpu/block_test/block_test_all.hpp index c51e77b162017322623eeca0e467f6eb482ed3d1..d530c0a11e0d01af705337d84d5e7142cc5f5185 100644 --- a/apps/cpu/block_test/block_test_all.hpp +++ b/apps/cpu/block_test/block_test_all.hpp @@ -1,12 +1,12 @@ #include <iostream> #include <string> -#include "numerics/geometry3d/CoordinateTransformation3D.h" +#include "geometry3d/CoordinateTransformation3D.h" #include "Grid3D.h" #include "GenBlocksGridVisitor.h" -#include "numerics/geometry3d/GbSystem3D.h" -#include "numerics/geometry3d/GbCuboid3D.h" -#include "numerics/geometry3d/GbCylinder3D.h" +#include "geometry3d/GbSystem3D.h" +#include "geometry3d/GbCuboid3D.h" +#include "geometry3d/GbCylinder3D.h" #include "basics/writer/WbWriterVtkXmlASCII.h" #include "basics/writer/WbWriterVtkXmlBinary.h" #include "RefineCrossAndInsideGbObjectBlockVisitor.h" diff --git a/apps/cpu/greenvortex/greenvortex.cpp b/apps/cpu/greenvortex/greenvortex.cpp index e9b1327e4451ea03e9cb7afd85110096eed1d6d4..618bcf0b93cc44bed4bbc4d229a143d570214843 100644 --- a/apps/cpu/greenvortex/greenvortex.cpp +++ b/apps/cpu/greenvortex/greenvortex.cpp @@ -1,13 +1,13 @@ #include <iostream> #include <string> -#include "numerics/geometry3d/CoordinateTransformation3D.h" +#include "geometry3d/CoordinateTransformation3D.h" #include "Grid3D.h" #include "GenBlocksGridVisitor.h" -#include "numerics/geometry3d/GbSystem3D.h" -#include "numerics/geometry3d/GbCuboid3D.h" -#include "numerics/geometry3d/GbCylinder3D.h" -#include <numerics/geometry3d/GbSphere3D.h> +#include "geometry3d/GbSystem3D.h" +#include "geometry3d/GbCuboid3D.h" +#include "geometry3d/GbCylinder3D.h" +#include <geometry3d/GbSphere3D.h> #include "basics/writer/WbWriterVtkXmlASCII.h" #include "basics/writer/WbWriterVtkXmlBinary.h" #include "RefineCrossAndInsideGbObjectBlockVisitor.h" diff --git a/apps/cpu/gridRf/gridRf.cpp b/apps/cpu/gridRf/gridRf.cpp index a406609e9f970632eb0e906b47c5c23c93275ebc..6064022b851637f6b68e09919d1ffa677785d7e5 100644 --- a/apps/cpu/gridRf/gridRf.cpp +++ b/apps/cpu/gridRf/gridRf.cpp @@ -1,13 +1,13 @@ #include <iostream> #include <string> -#include "numerics/geometry3d/CoordinateTransformation3D.h" +#include "geometry3d/CoordinateTransformation3D.h" #include "Grid3D.h" #include "GenBlocksGridVisitor.h" -#include "numerics/geometry3d/GbSystem3D.h" -#include "numerics/geometry3d/GbCuboid3D.h" -#include "numerics/geometry3d/GbCylinder3D.h" -#include <numerics/geometry3d/GbSphere3D.h> +#include "geometry3d/GbSystem3D.h" +#include "geometry3d/GbCuboid3D.h" +#include "geometry3d/GbCylinder3D.h" +#include <geometry3d/GbSphere3D.h> #include "basics/writer/WbWriterVtkXmlASCII.h" #include "basics/writer/WbWriterVtkXmlBinary.h" #include "RefineCrossAndInsideGbObjectBlockVisitor.h" diff --git a/apps/cpu/micropart/micropartSetup1.hpp b/apps/cpu/micropart/micropartSetup1.hpp index 79fe30059a596f9a9600c4eb45eddd248bb35a62..268009681451845ffd3945de1338dec01f976b42 100644 --- a/apps/cpu/micropart/micropartSetup1.hpp +++ b/apps/cpu/micropart/micropartSetup1.hpp @@ -6,10 +6,10 @@ #include "RatioSmoothBlockVisitor.h" #include "OverlapBlockVisitor.h" #include "SetInterpolationDirsBlockVisitor.h" -#include "numerics/geometry3d/GbSystem3D.h" -#include "numerics/geometry3d/GbCuboid3D.h" -#include "numerics/geometry3d/GbCylinder3D.h" -#include "numerics/geometry3d/GbSphere3D.h" +#include "geometry3d/GbSystem3D.h" +#include "geometry3d/GbCuboid3D.h" +#include "geometry3d/GbCylinder3D.h" +#include "geometry3d/GbSphere3D.h" #include "BlocksPostprocessor.h" #include "Grid3D.h" #include "Patch3D.h" @@ -45,8 +45,8 @@ // #include "basics/writer/WbWriterVtkXmlBinary.h" #include "basics/writer/WbWriterVtkXmlASCII.h" -#include "numerics/geometry3d/creator/GbTriFaceMesh3DCreator.h" -#include "numerics/geometry3d/GbTriFaceMesh3D.h" +#include "geometry3d/creator/GbTriFaceMesh3DCreator.h" +#include "geometry3d/GbTriFaceMesh3D.h" #include "D3Q27System.h" #include <basics/transmitter/TbTransmitterMpiPool.h> #include "MathUtil.hpp" @@ -394,7 +394,7 @@ void runSetup1(const char *cstr) //if(myid == 0) //{ - // //Abstände "q" als Linien rausschreiben + // //Abst�nde "q" als Linien rausschreiben // std::vector< UbTupleFloat3 > nodes; // std::vector< UbTupleInt2 > lines; // geoInt->addQsLineSet(nodes, lines); diff --git a/apps/cpu/micropart/micropartSetup2.hpp b/apps/cpu/micropart/micropartSetup2.hpp index e2ee2d18c6eea114bdbd9e161d9e8628b5ef42aa..0e8f904dbfa446a77c9295bbb143521bf027c48f 100644 --- a/apps/cpu/micropart/micropartSetup2.hpp +++ b/apps/cpu/micropart/micropartSetup2.hpp @@ -6,10 +6,10 @@ #include "RatioSmoothBlockVisitor.h" #include "OverlapBlockVisitor.h" #include "SetInterpolationDirsBlockVisitor.h" -#include "numerics/geometry3d/GbSystem3D.h" -#include "numerics/geometry3d/GbCuboid3D.h" -#include "numerics/geometry3d/GbCylinder3D.h" -#include "numerics/geometry3d/GbSphere3D.h" +#include "geometry3d/GbSystem3D.h" +#include "geometry3d/GbCuboid3D.h" +#include "geometry3d/GbCylinder3D.h" +#include "geometry3d/GbSphere3D.h" #include "BlocksPostprocessor.h" #include "Grid3D.h" #include "Patch3D.h" @@ -45,8 +45,8 @@ // #include "basics/writer/WbWriterVtkXmlBinary.h" #include "basics/writer/WbWriterVtkXmlASCII.h" -#include "numerics/geometry3d/creator/GbTriFaceMesh3DCreator.h" -#include "numerics/geometry3d/GbTriFaceMesh3D.h" +#include "geometry3d/creator/GbTriFaceMesh3DCreator.h" +#include "geometry3d/GbTriFaceMesh3D.h" #include "D3Q27System.h" #include <basics/transmitter/TbTransmitterMpiPool.h> #include "MathUtil.hpp" @@ -388,7 +388,7 @@ void runSetup2(const char *cstr) //if(myid == 0) //{ - // //Abstände "q" als Linien rausschreiben + // //Abst�nde "q" als Linien rausschreiben // std::vector< UbTupleFloat3 > nodes; // std::vector< UbTupleInt2 > lines; // geoInt->addQsLineSet(nodes, lines); diff --git a/apps/cpu/micropart/micropartTestQs2.hpp b/apps/cpu/micropart/micropartTestQs2.hpp index bcaa75a458fb0cdf3126d8bce7a72d853dd0bc21..210b295336cb0171c450d5d04e10f9c3575a2d23 100644 --- a/apps/cpu/micropart/micropartTestQs2.hpp +++ b/apps/cpu/micropart/micropartTestQs2.hpp @@ -6,10 +6,10 @@ #include "RatioSmoothBlockVisitor.h" #include "OverlapBlockVisitor.h" #include "SetInterpolationDirsBlockVisitor.h" -#include "numerics/geometry3d/GbSystem3D.h" -#include "numerics/geometry3d/GbCuboid3D.h" -#include "numerics/geometry3d/GbCylinder3D.h" -#include "numerics/geometry3d/GbSphere3D.h" +#include "geometry3d/GbSystem3D.h" +#include "geometry3d/GbCuboid3D.h" +#include "geometry3d/GbCylinder3D.h" +#include "geometry3d/GbSphere3D.h" #include "BlocksPostprocessor.h" #include "Grid3D.h" #include "Patch3D.h" @@ -45,8 +45,8 @@ // #include "basics/writer/WbWriterVtkXmlBinary.h" #include "basics/writer/WbWriterVtkXmlASCII.h" -#include "numerics/geometry3d/creator/GbTriFaceMesh3DCreator.h" -#include "numerics/geometry3d/GbTriFaceMesh3D.h" +#include "geometry3d/creator/GbTriFaceMesh3DCreator.h" +#include "geometry3d/GbTriFaceMesh3D.h" #include "D3Q27System.h" #include <basics/transmitter/TbTransmitterMpiPool.h> #include "MathUtil.hpp" @@ -469,7 +469,7 @@ void micropartTestQs2(const char *cstr) if(myid == 0) { - //Abstände "q" als Linien rausschreiben + //Abst�nde "q" als Linien rausschreiben std::vector< UbTupleFloat3 > nodes; std::vector< UbTupleInt2 > lines; geoInt->addQsLineSet(nodes, lines); diff --git a/apps/cpu/micropart/miro.txt b/apps/cpu/micropart/miro.txt index 7ed704098a74d3ea0db5fea3a9cf21810bcbeb8e..d66356a8eb7d6dc58d65434f24a5833eb52357d2 100644 --- a/apps/cpu/micropart/miro.txt +++ b/apps/cpu/micropart/miro.txt @@ -6,10 +6,10 @@ #include "RatioSmoothBlockVisitor.h" #include "OverlapBlockVisitor.h" #include "SetInterpolationDirsBlockVisitor.h" -#include "numerics/geometry3d/GbSystem3D.h" -#include "numerics/geometry3d/GbCuboid3D.h" -#include "numerics/geometry3d/GbCylinder3D.h" -#include "numerics/geometry3d/GbSphere3D.h" +#include "geometry3d/GbSystem3D.h" +#include "geometry3d/GbCuboid3D.h" +#include "geometry3d/GbCylinder3D.h" +#include "geometry3d/GbSphere3D.h" #include "BlocksPostprocessor.h" #include "Grid3D.h" #include "Patch3D.h" @@ -45,8 +45,8 @@ // #include "basics/writer/WbWriterVtkXmlBinary.h" #include "basics/writer/WbWriterVtkXmlASCII.h" -#include "numerics/geometry3d/creator/GbTriFaceMesh3DCreator.h" -#include "numerics/geometry3d/GbTriFaceMesh3D.h" +#include "geometry3d/creator/GbTriFaceMesh3DCreator.h" +#include "geometry3d/GbTriFaceMesh3D.h" #include "D3Q27System.h" #include <basics/transmitter/TbTransmitterMpiPool.h> #include "MathUtil.hpp" @@ -462,7 +462,7 @@ if(myid == 0) UBLOG(logINFO,"line"<<__LINE__); if(myid == 0) { - //Abstände "q" als Linien rausschreiben + //Abst�nde "q" als Linien rausschreiben std::vector< UbTupleFloat3 > nodes; std::vector< UbTupleInt2 > lines; geoInt->addQsLineSet(nodes, lines); diff --git a/apps/cpu/pChannel/CMakeLists.txt b/apps/cpu/pChannel/CMakeLists.txt index c39cc238bb757edcfd5ebae5b6f4c6f05ef2dae7..84eb9e9c25213997fdd43726549d99e442b7436f 100644 --- a/apps/cpu/pChannel/CMakeLists.txt +++ b/apps/cpu/pChannel/CMakeLists.txt @@ -1,23 +1,5 @@ -######################################################## -## C++ PROJECT ### -######################################################## +PROJECT(PChannel) INCLUDE(${APPS_ROOT}/IncludsList.cmake) -################################################################# -### LOCAL FILES ### -################################################################# -#FILE(GLOB SPECIFIC_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.h -# ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp -# ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp ) - -#SET(ALL_SOURCES ${ALL_SOURCES} ${SPECIFIC_FILES}) -#SOURCE_GROUP(src FILES ${SPECIFIC_FILES}) - -#SET(CAB_ADDITIONAL_LINK_LIBRARIES VirtualFluidsCore VirtualFluidsBasic) - -################################################################# -### CREATE PROJECT ### -################################################################# -#CREATE_CAB_PROJECT(pchannel BINARY) vf_add_library(BUILDTYPE binary DEPENDS VirtualFluidsCore VirtualFluidsBasic FILES pChannel.cpp) diff --git a/apps/cpu/reefer/reefer.cpp b/apps/cpu/reefer/reefer.cpp index 74bfc3d2d600be085faffc73cd68eca8d09fc698..d66cf9705570f3ba40c619ac6638e6b782bd8ecb 100644 --- a/apps/cpu/reefer/reefer.cpp +++ b/apps/cpu/reefer/reefer.cpp @@ -1,13 +1,13 @@ #include <iostream> #include <string> -#include "numerics/geometry3d/CoordinateTransformation3D.h" +#include "geometry3d/CoordinateTransformation3D.h" #include "Grid3D.h" #include "GenBlocksGridVisitor.h" -#include "numerics/geometry3d/GbSystem3D.h" -#include "numerics/geometry3d/GbCuboid3D.h" -#include "numerics/geometry3d/GbCylinder3D.h" -#include <numerics/geometry3d/GbSphere3D.h> +#include "geometry3d/GbSystem3D.h" +#include "geometry3d/GbCuboid3D.h" +#include "geometry3d/GbCylinder3D.h" +#include <geometry3d/GbSphere3D.h> #include "basics/writer/WbWriterVtkXmlASCII.h" #include "basics/writer/WbWriterVtkXmlBinary.h" #include "RefineCrossAndInsideGbObjectBlockVisitor.h" @@ -39,8 +39,8 @@ #include "D3Q27OffsetInterpolationProcessor.h" #include "D3Q27CompactInterpolationProcessor.h" #include "SyncBcBlockVisitor.h" -#include "numerics/geometry3d/creator/GbTriFaceMesh3DCreator.h" -#include "numerics/geometry3d/GbTriFaceMesh3D.h" +#include "geometry3d/creator/GbTriFaceMesh3DCreator.h" +#include "geometry3d/GbTriFaceMesh3D.h" #include "D3Q27TriFaceMeshInteractor.h" #include "MathUtil.hpp" #include "SolidBlocksHelper.h" diff --git a/apps/cpu/vfscript/vfscript.cpp b/apps/cpu/vfscript/vfscript.cpp index e7322b73f0807c0f8891e6706545b605b05d7fb9..2d915b69247787edfe8dfcf8f4d295672d9a8a2a 100644 --- a/apps/cpu/vfscript/vfscript.cpp +++ b/apps/cpu/vfscript/vfscript.cpp @@ -1,13 +1,13 @@ #include <iostream> #include <string> -#include "numerics/geometry3d/CoordinateTransformation3D.h" +#include "geometry3d/CoordinateTransformation3D.h" #include "Grid3D.h" #include "GenBlocksGridVisitor.h" -#include "numerics/geometry3d/GbSystem3D.h" -#include "numerics/geometry3d/GbCuboid3D.h" -#include "numerics/geometry3d/GbCylinder3D.h" -#include <numerics/geometry3d/GbSphere3D.h> +#include "geometry3d/GbSystem3D.h" +#include "geometry3d/GbCuboid3D.h" +#include "geometry3d/GbCylinder3D.h" +#include <geometry3d/GbSphere3D.h> #include "basics/writer/WbWriterVtkXmlASCII.h" #include "basics/writer/WbWriterVtkXmlBinary.h" #include "RefineCrossAndInsideGbObjectBlockVisitor.h" diff --git a/apps/gpu/GKS/BoundaryJet/BoundaryJet.cpp b/apps/gpu/GKS/BoundaryJet/BoundaryJet.cpp index ec4c37a78b8e8b6a48c02dd5d020a83016902dd6..76cda7ba2a91d72a4e008938d18ae00d41eff159 100644 --- a/apps/gpu/GKS/BoundaryJet/BoundaryJet.cpp +++ b/apps/gpu/GKS/BoundaryJet/BoundaryJet.cpp @@ -9,7 +9,7 @@ #include <memory> #include "Core/Timer/Timer.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "Core/VectorTypes.h" #include "Core/Logger/Logger.h" diff --git a/apps/gpu/GKS/BoundaryJet/package.include b/apps/gpu/GKS/BoundaryJet/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/GKS/Candle/Candle.cpp b/apps/gpu/GKS/Candle/Candle.cpp index c4a0a5d4d8b8f859d0ced03f0a8c2f6ca13fbc48..2f6ed9f30a23783a6d8bcc87722b8ffde46de802 100644 --- a/apps/gpu/GKS/Candle/Candle.cpp +++ b/apps/gpu/GKS/Candle/Candle.cpp @@ -9,7 +9,7 @@ #include <memory> #include "Core/Timer/Timer.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "Core/VectorTypes.h" #include "Core/Logger/Logger.h" diff --git a/apps/gpu/GKS/Candle/package.include b/apps/gpu/GKS/Candle/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/GKS/ChannelFlow/ChannelFlow.cpp b/apps/gpu/GKS/ChannelFlow/ChannelFlow.cpp index d0450b85428b7187ecdf1724fb3fe93d49b83ff9..a1142e0dd5b66228e9d38bc566ebbbc279477345 100644 --- a/apps/gpu/GKS/ChannelFlow/ChannelFlow.cpp +++ b/apps/gpu/GKS/ChannelFlow/ChannelFlow.cpp @@ -9,7 +9,7 @@ #include <memory> #include "Core/Timer/Timer.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "Core/VectorTypes.h" #include "Core/Logger/Logger.h" diff --git a/apps/gpu/GKS/ChannelFlow/package.include b/apps/gpu/GKS/ChannelFlow/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/GKS/ChannelFlowObstacle/ChannelFlowObstacle.cpp b/apps/gpu/GKS/ChannelFlowObstacle/ChannelFlowObstacle.cpp index 978f375914cf3af9356e795db2bbe844cb85f74c..98af8e1245d5bd492d387ba580f4a0af628a8620 100644 --- a/apps/gpu/GKS/ChannelFlowObstacle/ChannelFlowObstacle.cpp +++ b/apps/gpu/GKS/ChannelFlowObstacle/ChannelFlowObstacle.cpp @@ -9,7 +9,7 @@ #include <memory> #include "Core/Timer/Timer.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "Core/VectorTypes.h" #include "Core/Logger/Logger.h" diff --git a/apps/gpu/GKS/ChannelFlowObstacle/package.include b/apps/gpu/GKS/ChannelFlowObstacle/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/GKS/ConcreteHeatFluxBCTest/ConcreteHeatFluxBCTest.cpp b/apps/gpu/GKS/ConcreteHeatFluxBCTest/ConcreteHeatFluxBCTest.cpp index cb71cb9f2626f5b75aa06f32d2a5ee09ed0cab50..f23e9d74bb1027e5c3d66b9df289ca84cee21f15 100644 --- a/apps/gpu/GKS/ConcreteHeatFluxBCTest/ConcreteHeatFluxBCTest.cpp +++ b/apps/gpu/GKS/ConcreteHeatFluxBCTest/ConcreteHeatFluxBCTest.cpp @@ -22,7 +22,7 @@ #include <memory> #include "Core/Timer/Timer.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "Core/VectorTypes.h" #include "Core/Logger/Logger.h" diff --git a/apps/gpu/GKS/ConcreteHeatFluxBCTest/package.include b/apps/gpu/GKS/ConcreteHeatFluxBCTest/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/GKS/ConfinedCombustion/ConfinedCombustion.cpp b/apps/gpu/GKS/ConfinedCombustion/ConfinedCombustion.cpp index 3d9b3d1ac4f76ad099e1b14633edb8e964e10bf1..e903cb3a06e0250a8d13fbfcb40d619f87245d9c 100644 --- a/apps/gpu/GKS/ConfinedCombustion/ConfinedCombustion.cpp +++ b/apps/gpu/GKS/ConfinedCombustion/ConfinedCombustion.cpp @@ -9,7 +9,7 @@ #include <memory> #include "Core/Timer/Timer.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "Core/VectorTypes.h" #include "Core/Logger/Logger.h" diff --git a/apps/gpu/GKS/ConfinedCombustion/package.include b/apps/gpu/GKS/ConfinedCombustion/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/GKS/DrivenCavity3D/DrivenCavity3D.cpp b/apps/gpu/GKS/DrivenCavity3D/DrivenCavity3D.cpp index a0771f788432d63e8ef2b9f7e3d5ea97cc1e6238..5bb85fa912165aa19087f5991d8d3db5d215c411 100644 --- a/apps/gpu/GKS/DrivenCavity3D/DrivenCavity3D.cpp +++ b/apps/gpu/GKS/DrivenCavity3D/DrivenCavity3D.cpp @@ -9,7 +9,7 @@ #include <memory> #include "Core/Timer/Timer.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "Core/VectorTypes.h" #include "Core/Logger/Logger.h" diff --git a/apps/gpu/GKS/DrivenCavity3D/package.include b/apps/gpu/GKS/DrivenCavity3D/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/GKS/DrivenCavityMultiGPU/DrivenCavityMultiGPU.cpp b/apps/gpu/GKS/DrivenCavityMultiGPU/DrivenCavityMultiGPU.cpp index 66dd6ae21febb133a8c18dbde262e42adb9d85ce..12320e5ee1f4133223177ef7231a7862640cbda2 100644 --- a/apps/gpu/GKS/DrivenCavityMultiGPU/DrivenCavityMultiGPU.cpp +++ b/apps/gpu/GKS/DrivenCavityMultiGPU/DrivenCavityMultiGPU.cpp @@ -12,7 +12,7 @@ #include <mpi.h> #include "Core/Timer/Timer.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "Core/VectorTypes.h" #include "Core/Logger/Logger.h" diff --git a/apps/gpu/GKS/DrivenCavityMultiGPU/package.include b/apps/gpu/GKS/DrivenCavityMultiGPU/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/GKS/Flame7cm/Flame7cm.cpp b/apps/gpu/GKS/Flame7cm/Flame7cm.cpp index a9dd32034844c44a229e0cef062bb066dfa67021..e0b736dfe5fb1be1a038bfb4ea6ad88b570f5951 100644 --- a/apps/gpu/GKS/Flame7cm/Flame7cm.cpp +++ b/apps/gpu/GKS/Flame7cm/Flame7cm.cpp @@ -10,7 +10,7 @@ #include <memory> #include "Core/Timer/Timer.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "Core/VectorTypes.h" #include "Core/Logger/Logger.h" diff --git a/apps/gpu/GKS/Flame7cm/package.include b/apps/gpu/GKS/Flame7cm/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/GKS/LiFuXu/LiFuXu.cpp b/apps/gpu/GKS/LiFuXu/LiFuXu.cpp index 161bbf7531a951d906cceb978a265638c669ccf3..209bd832ac2599bea187da887990cd83adfa9fa7 100644 --- a/apps/gpu/GKS/LiFuXu/LiFuXu.cpp +++ b/apps/gpu/GKS/LiFuXu/LiFuXu.cpp @@ -9,7 +9,7 @@ #include <memory> #include "Core/Timer/Timer.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "Core/VectorTypes.h" #include "Core/Logger/Logger.h" diff --git a/apps/gpu/GKS/LiFuXu/package.include b/apps/gpu/GKS/LiFuXu/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/GKS/MethaneFlame/MethaneFlame.cpp b/apps/gpu/GKS/MethaneFlame/MethaneFlame.cpp index c721eb7d64dc02b95a6cdb02e22ccf60d3be7022..42192f8db68dcc294926f7a6bcb770ad59043cdd 100644 --- a/apps/gpu/GKS/MethaneFlame/MethaneFlame.cpp +++ b/apps/gpu/GKS/MethaneFlame/MethaneFlame.cpp @@ -9,7 +9,7 @@ #include <memory> #include "Core/Timer/Timer.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "Core/VectorTypes.h" #include "Core/Logger/Logger.h" diff --git a/apps/gpu/GKS/MethaneFlame/package.include b/apps/gpu/GKS/MethaneFlame/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/GKS/MultiGPU/MultiGPU.cpp b/apps/gpu/GKS/MultiGPU/MultiGPU.cpp index 38fcdbad5b67a80c41a69d0d952056cef779683b..7b0c81fa700f0d1aa0260680617050a15496e326 100644 --- a/apps/gpu/GKS/MultiGPU/MultiGPU.cpp +++ b/apps/gpu/GKS/MultiGPU/MultiGPU.cpp @@ -10,7 +10,7 @@ #include <memory> #include "Core/Timer/Timer.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "Core/VectorTypes.h" #include "Core/Logger/Logger.h" diff --git a/apps/gpu/GKS/MultiGPU/package.include b/apps/gpu/GKS/MultiGPU/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/GKS/MultiGPU_nD/MultiGPU_nD.cpp b/apps/gpu/GKS/MultiGPU_nD/MultiGPU_nD.cpp index c6720cb44ebeb1911e1339a00536b38ea83acf61..bc5a488b55592345de7814febd5fb2b6d5cdf129 100644 --- a/apps/gpu/GKS/MultiGPU_nD/MultiGPU_nD.cpp +++ b/apps/gpu/GKS/MultiGPU_nD/MultiGPU_nD.cpp @@ -10,7 +10,7 @@ #include <memory> #include "Core/Timer/Timer.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "Core/VectorTypes.h" #include "Core/Logger/Logger.h" diff --git a/apps/gpu/GKS/MultiGPU_nD/package.include b/apps/gpu/GKS/MultiGPU_nD/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/GKS/PoolFire/PoolFire.cpp b/apps/gpu/GKS/PoolFire/PoolFire.cpp index a6abbe0683dbbad51366a79c495162e841034f58..0db6adb4adb24b91624fc1fd457359f758cfc19d 100644 --- a/apps/gpu/GKS/PoolFire/PoolFire.cpp +++ b/apps/gpu/GKS/PoolFire/PoolFire.cpp @@ -9,7 +9,7 @@ #include <memory> #include "Core/Timer/Timer.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "Core/VectorTypes.h" #include "Core/Logger/Logger.h" diff --git a/apps/gpu/GKS/PoolFire/package.include b/apps/gpu/GKS/PoolFire/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/GKS/PropaneFlame/PropaneFlame.cpp b/apps/gpu/GKS/PropaneFlame/PropaneFlame.cpp index 3046bb99b29f89cacca2e14df52028801d5ce721..bdee594864925933f6afe462e45b473f7d921ed9 100644 --- a/apps/gpu/GKS/PropaneFlame/PropaneFlame.cpp +++ b/apps/gpu/GKS/PropaneFlame/PropaneFlame.cpp @@ -9,7 +9,7 @@ #include <memory> #include "Core/Timer/Timer.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "Core/VectorTypes.h" #include "Core/Logger/Logger.h" diff --git a/apps/gpu/GKS/PropaneFlame/package.include b/apps/gpu/GKS/PropaneFlame/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/GKS/RayleighBenardMultiGPU/RayleighBenardMultiGPU.cpp b/apps/gpu/GKS/RayleighBenardMultiGPU/RayleighBenardMultiGPU.cpp index 03c14eddacb3a0002bf0bd6179d5058de96fa013..811872820c0d9fce485279d086d9b907199230ae 100644 --- a/apps/gpu/GKS/RayleighBenardMultiGPU/RayleighBenardMultiGPU.cpp +++ b/apps/gpu/GKS/RayleighBenardMultiGPU/RayleighBenardMultiGPU.cpp @@ -13,7 +13,7 @@ #include <mpi.h> #include "Core/Timer/Timer.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "Core/VectorTypes.h" #include "Core/Logger/Logger.h" diff --git a/apps/gpu/GKS/RayleighBenardMultiGPU/package.include b/apps/gpu/GKS/RayleighBenardMultiGPU/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/GKS/Room/Room.cpp b/apps/gpu/GKS/Room/Room.cpp index 55bdc909689725fd635876ccbf5a081b439a2e7b..cfd245afe481b1ed2e860bca00c164fec2a74d59 100644 --- a/apps/gpu/GKS/Room/Room.cpp +++ b/apps/gpu/GKS/Room/Room.cpp @@ -9,7 +9,7 @@ #include <memory> #include "Core/Timer/Timer.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "Core/VectorTypes.h" #include "Core/Logger/Logger.h" diff --git a/apps/gpu/GKS/Room/package.include b/apps/gpu/GKS/Room/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/GKS/RoomFire/RoomFire.cpp b/apps/gpu/GKS/RoomFire/RoomFire.cpp index 5893ebeb8c6d063dee601f92ddb12a0d53d67303..814c8fcfe40bb17775897f10eb971d0a463e847a 100644 --- a/apps/gpu/GKS/RoomFire/RoomFire.cpp +++ b/apps/gpu/GKS/RoomFire/RoomFire.cpp @@ -9,7 +9,7 @@ #include <memory> #include "Core/Timer/Timer.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "Core/VectorTypes.h" #include "Core/Logger/Logger.h" diff --git a/apps/gpu/GKS/RoomFire/package.include b/apps/gpu/GKS/RoomFire/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/GKS/RoomFireExtended/RoomFireExtended.cpp b/apps/gpu/GKS/RoomFireExtended/RoomFireExtended.cpp index d78804cf12178cca41f3fb5cd3a98014d92fb796..77b8c2bc53721a5f455254ebbec58a47ce36eca6 100644 --- a/apps/gpu/GKS/RoomFireExtended/RoomFireExtended.cpp +++ b/apps/gpu/GKS/RoomFireExtended/RoomFireExtended.cpp @@ -23,7 +23,7 @@ #include <algorithm> #include "Core/Timer/Timer.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "Core/VectorTypes.h" #include "Core/Logger/Logger.h" diff --git a/apps/gpu/GKS/RoomFireExtended/package.include b/apps/gpu/GKS/RoomFireExtended/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/GKS/RoomMultiGPU/RoomMultiGPU.cpp b/apps/gpu/GKS/RoomMultiGPU/RoomMultiGPU.cpp index 87a6e2d7739aa23caf2afc64db53d0389ba2ac68..2c92c5f737612167e1f092944c8b32a87f9d7215 100644 --- a/apps/gpu/GKS/RoomMultiGPU/RoomMultiGPU.cpp +++ b/apps/gpu/GKS/RoomMultiGPU/RoomMultiGPU.cpp @@ -9,7 +9,7 @@ #include <memory> #include "Core/Timer/Timer.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "Core/VectorTypes.h" #include "Core/Logger/Logger.h" diff --git a/apps/gpu/GKS/RoomMultiGPU/package.include b/apps/gpu/GKS/RoomMultiGPU/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/GKS/SalinasVazquez/SalinasVazquez.cpp b/apps/gpu/GKS/SalinasVazquez/SalinasVazquez.cpp index ecb96f7c90f080dace051e1c4d309073afec294d..1f8f352cac757c7138981d331fd7f7130b9f58a6 100644 --- a/apps/gpu/GKS/SalinasVazquez/SalinasVazquez.cpp +++ b/apps/gpu/GKS/SalinasVazquez/SalinasVazquez.cpp @@ -11,7 +11,7 @@ #include <sstream> #include "Core/Timer/Timer.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "Core/VectorTypes.h" #include "Core/Logger/Logger.h" diff --git a/apps/gpu/GKS/SalinasVazquez/package.include b/apps/gpu/GKS/SalinasVazquez/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/GKS/SandiaFlame_1m/SandiaFlame_1m.cpp b/apps/gpu/GKS/SandiaFlame_1m/SandiaFlame_1m.cpp index 53725b4880bd105f179203f258d587b55db45fcb..8c29bbb4f73109deb41e9dd4ab7402241d3079cf 100644 --- a/apps/gpu/GKS/SandiaFlame_1m/SandiaFlame_1m.cpp +++ b/apps/gpu/GKS/SandiaFlame_1m/SandiaFlame_1m.cpp @@ -10,7 +10,7 @@ #include <memory> #include "Core/Timer/Timer.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "Core/VectorTypes.h" #include "Core/Logger/Logger.h" diff --git a/apps/gpu/GKS/SandiaFlame_1m/package.include b/apps/gpu/GKS/SandiaFlame_1m/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/GKS/ShearWave/ShearWave.cpp b/apps/gpu/GKS/ShearWave/ShearWave.cpp index 9557de6716a3074f0c9acaa78a6146b620f8f9ba..e94d921fbdbb141a89eeaad46b5d4b95d174be9e 100644 --- a/apps/gpu/GKS/ShearWave/ShearWave.cpp +++ b/apps/gpu/GKS/ShearWave/ShearWave.cpp @@ -9,7 +9,7 @@ #include <memory> #include "Core/Timer/Timer.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "Core/VectorTypes.h" #include "Core/Logger/Logger.h" diff --git a/apps/gpu/GKS/ShearWave/package.include b/apps/gpu/GKS/ShearWave/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/GKS/SingleGPU/SingleGPU.cpp b/apps/gpu/GKS/SingleGPU/SingleGPU.cpp index b473c180cc221e0c74833bf672af0922eec6563c..2fed78f38419af983d9818ff3f15f2e01f0c5f69 100644 --- a/apps/gpu/GKS/SingleGPU/SingleGPU.cpp +++ b/apps/gpu/GKS/SingleGPU/SingleGPU.cpp @@ -12,7 +12,7 @@ #include <omp.h> #include "Core/Timer/Timer.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "Core/VectorTypes.h" #include "Core/Logger/Logger.h" diff --git a/apps/gpu/GKS/SingleGPU/package.include b/apps/gpu/GKS/SingleGPU/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/GKS/TaylorGreen3D/TaylorGreen3D.cpp b/apps/gpu/GKS/TaylorGreen3D/TaylorGreen3D.cpp index 63de16ae67b23f08f7a0e7c2d79fb1226751eed4..1fdd80bd207cbd688601f47de3d2ea54814112f3 100644 --- a/apps/gpu/GKS/TaylorGreen3D/TaylorGreen3D.cpp +++ b/apps/gpu/GKS/TaylorGreen3D/TaylorGreen3D.cpp @@ -9,7 +9,7 @@ #include <memory> #include "Core/Timer/Timer.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "Core/VectorTypes.h" #include "Core/Logger/Logger.h" diff --git a/apps/gpu/GKS/TaylorGreen3D/package.include b/apps/gpu/GKS/TaylorGreen3D/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/GKS/ThermalCavity/ThermalCavity.cpp b/apps/gpu/GKS/ThermalCavity/ThermalCavity.cpp index 8ed2f2c17e0b37497b1fa69bcd5471ae6d6d4feb..ae729002cd11ba3793e6a3a98e612f6f4230ca6f 100644 --- a/apps/gpu/GKS/ThermalCavity/ThermalCavity.cpp +++ b/apps/gpu/GKS/ThermalCavity/ThermalCavity.cpp @@ -9,7 +9,7 @@ #include <memory> #include "Core/Timer/Timer.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "Core/VectorTypes.h" #include "Core/Logger/Logger.h" diff --git a/apps/gpu/GKS/ThermalCavity/package.include b/apps/gpu/GKS/ThermalCavity/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/GKS/ThermalCavityMultiGPU/ThermalCavityMultiGPU.cpp b/apps/gpu/GKS/ThermalCavityMultiGPU/ThermalCavityMultiGPU.cpp index a72951916385d19736037d842e7df88c2c8fcb2e..1af2397d4bfa06f54ee1adb39ab6f618a7829522 100644 --- a/apps/gpu/GKS/ThermalCavityMultiGPU/ThermalCavityMultiGPU.cpp +++ b/apps/gpu/GKS/ThermalCavityMultiGPU/ThermalCavityMultiGPU.cpp @@ -13,7 +13,7 @@ #include <mpi.h> #include "Core/Timer/Timer.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "Core/VectorTypes.h" #include "Core/Logger/Logger.h" diff --git a/apps/gpu/GKS/ThermalCavityMultiGPU/package.include b/apps/gpu/GKS/ThermalCavityMultiGPU/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/GKS/gksTest/main.cpp b/apps/gpu/GKS/gksTest/main.cpp index 58a6203bd4c5651e80cec3a30ad92499ba6df4df..b66017eeaf727def602b9ab9f41556a8dd5a984e 100644 --- a/apps/gpu/GKS/gksTest/main.cpp +++ b/apps/gpu/GKS/gksTest/main.cpp @@ -9,7 +9,7 @@ #include <memory> #include "Core/Timer/Timer.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "Core/VectorTypes.h" #include "Core/Logger/Logger.h" diff --git a/apps/gpu/GKS/gksTest/package.include b/apps/gpu/GKS/gksTest/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/LBM/Basel/package.include b/apps/gpu/LBM/Basel/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/LBM/BaselMultiGPU/package.include b/apps/gpu/LBM/BaselMultiGPU/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/LBM/BaselNU/package.include b/apps/gpu/LBM/BaselNU/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/LBM/DrivenCavity/3rdPartyLinking.cmake b/apps/gpu/LBM/DrivenCavity/3rdPartyLinking.cmake deleted file mode 100644 index 30d15ff96351a944d95f7d4309b6b4f4a15456cb..0000000000000000000000000000000000000000 --- a/apps/gpu/LBM/DrivenCavity/3rdPartyLinking.cmake +++ /dev/null @@ -1,13 +0,0 @@ -include (${CMAKE_SOURCE_DIR}/${cmakeMacroPath}/MPI/Link.cmake) -linkMPI(${targetName}) -include (${CMAKE_SOURCE_DIR}/${cmakeMacroPath}/Cuda/Link.cmake) -linkCuda(${targetName}) -include (${CMAKE_SOURCE_DIR}/${cmakeMacroPath}/Boost/Link.cmake) -linkBoost(${targetName} "serialization") -#include (${CMAKE_SOURCE_DIR}/${cmakeMacroPath}/Metis/Link.cmake) -#linkMetis(${targetName}) - -if(HULC.BUILD_JSONCPP) - include (${CMAKE_SOURCE_DIR}/${cmakeMacroPath}/JsonCpp/Link.cmake) - linkJsonCpp(${targetName}) -endif() \ No newline at end of file diff --git a/apps/gpu/LBM/DrivenCavity/CMakeLists.txt b/apps/gpu/LBM/DrivenCavity/CMakeLists.txt index 20cc76e8011bcdabf1960a2b24d4898df3411853..986d3fabbc8352666bc3a6fba25a27ba89522129 100644 --- a/apps/gpu/LBM/DrivenCavity/CMakeLists.txt +++ b/apps/gpu/LBM/DrivenCavity/CMakeLists.txt @@ -4,28 +4,14 @@ PROJECT(DrivenCavity) vf_add_library(BUILDTYPE binary DEPENDS VirtualFluids_GPU basics GridGenerator FILES DrivenCavity.cpp ) -include (${CMAKE_PATH}/3rd/cuda.cmake) -include (${CMAKE_PATH}/3rd/mpi.cmake) -include (${CMAKE_PATH}/3rd/boost.cmake) +include (${VF_CMAKE_DIR}/3rd/cuda.cmake) +include (${VF_CMAKE_DIR}/3rd/mpi.cmake) +include (${VF_CMAKE_DIR}/3rd/boost.cmake) linkBoost ("serialization") vf_get_library_name(library_name) -target_include_directories(${library_name} PRIVATE "${CMAKE_SOURCE_DIR}/src/basics") -target_include_directories(${library_name} PRIVATE "${CMAKE_SOURCE_DIR}/src/gpu") -target_include_directories(${library_name} PRIVATE "${CMAKE_SOURCE_DIR}/src/gpu/VirtualFluids_GPU") -target_include_directories(${library_name} PRIVATE "${CMAKE_SOURCE_DIR}/src/gpu/GridGenerator") -target_include_directories(${library_name} PRIVATE "${CMAKE_SOURCE_DIR}/src/basics/Core") - -#include (${CMAKE_SOURCE_DIR}/${cmakeMacroPath}/MPI/Link.cmake) -#linkMPI(${targetName}) -#include (${CMAKE_SOURCE_DIR}/${cmakeMacroPath}/Cuda/Link.cmake) -#linkCuda(${targetName}) -#include (${CMAKE_SOURCE_DIR}/${cmakeMacroPath}/Boost/Link.cmake) -#linkBoost(${targetName} "serialization") -#include (${CMAKE_SOURCE_DIR}/${cmakeMacroPath}/Metis/Link.cmake) -#linkMetis(${targetName}) - -#if(HULC.BUILD_JSONCPP) -# include (${CMAKE_SOURCE_DIR}/${cmakeMacroPath}/JsonCpp/Link.cmake) -# linkJsonCpp(${targetName}) -#endif() \ No newline at end of file +target_include_directories(${library_name} PRIVATE ${VF_SRC_DIR}/basics) +target_include_directories(${library_name} PRIVATE ${VF_SRC_DIR}/gpu) +target_include_directories(${library_name} PRIVATE ${VF_SRC_DIR}/gpu/VirtualFluids_GPU) +target_include_directories(${library_name} PRIVATE ${VF_SRC_DIR}/gpu/GridGenerator) +target_include_directories(${library_name} PRIVATE ${VF_SRC_DIR}/basics/Core) diff --git a/apps/gpu/LBM/DrivenCavity/CMakePackage.cmake b/apps/gpu/LBM/DrivenCavity/CMakePackage.cmake deleted file mode 100644 index 5d39e3804dbd180790629111449a7dc918292430..0000000000000000000000000000000000000000 --- a/apps/gpu/LBM/DrivenCavity/CMakePackage.cmake +++ /dev/null @@ -1,9 +0,0 @@ -#FILE ENDINGS -resetFileEndingsToCollect() -addCAndCPPFileTypes() -addFileEndingToCollect("*.cu") -addFileEndingToCollect("*.cuh") - -#GLOB SOURCE FILES IN MY_SRCS -unset(MY_SRCS) -includeRecursiveAllFilesFrom(${targetName} ${CMAKE_CURRENT_LIST_DIR}) \ No newline at end of file diff --git a/apps/gpu/LBM/DrivenCavity/DrivenCavity.cpp b/apps/gpu/LBM/DrivenCavity/DrivenCavity.cpp index abf1f7bb621ef5c0dc5913124aaafb5515c0a442..0af28e6f6c6eed2994d72ceeb1194c399ea79d5a 100644 --- a/apps/gpu/LBM/DrivenCavity/DrivenCavity.cpp +++ b/apps/gpu/LBM/DrivenCavity/DrivenCavity.cpp @@ -12,7 +12,7 @@ ////////////////////////////////////////////////////////////////////////// #include "Core/DataTypes.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/LbmOrGks.h" #include "Core/Input/Input.h" diff --git a/apps/gpu/LBM/DrivenCavity/package.include b/apps/gpu/LBM/DrivenCavity/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/LBM/TGV_3D/CMakeLists.txt b/apps/gpu/LBM/TGV_3D/CMakeLists.txt index 962907cdbc8b0bdd29ab6f9fffaa14f00b14ef41..56d9ac4f1281b03b3de4a023853619f0f5df4a14 100644 --- a/apps/gpu/LBM/TGV_3D/CMakeLists.txt +++ b/apps/gpu/LBM/TGV_3D/CMakeLists.txt @@ -2,9 +2,9 @@ PROJECT(TGV_3D) vf_add_library(BUILDTYPE binary DEPENDS basics VirtualFluids_GPU GridGenerator FILES TGV_3D.cpp) -include (${CMAKE_PATH}/3rd/cuda.cmake) -include (${CMAKE_PATH}/3rd/mpi.cmake) -include (${CMAKE_PATH}/3rd/boost.cmake) +include (${VF_CMAKE_DIR}/3rd/cuda.cmake) +include (${VF_CMAKE_DIR}/3rd/mpi.cmake) +include (${VF_CMAKE_DIR}/3rd/boost.cmake) linkBoost ("serialization") vf_get_library_name(library_name) diff --git a/apps/gpu/LBM/TGV_3D/package.include b/apps/gpu/LBM/TGV_3D/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/LBM/TGV_3D_MultiGPU/CMakeLists.txt b/apps/gpu/LBM/TGV_3D_MultiGPU/CMakeLists.txt index a3a6c4566e5ca3d4e0f93b1285961bfb26b06d34..24a7c8907fc7c2fd31b02ef868642584f647a32e 100644 --- a/apps/gpu/LBM/TGV_3D_MultiGPU/CMakeLists.txt +++ b/apps/gpu/LBM/TGV_3D_MultiGPU/CMakeLists.txt @@ -2,9 +2,9 @@ PROJECT(TGV_3D_MultiGPU) vf_add_library(BUILDTYPE binary DEPENDS basics VirtualFluids_GPU GridGenerator FILES TGV_3D_MultiGPU.cpp) -include (${CMAKE_PATH}/3rd/cuda.cmake) -include (${CMAKE_PATH}/3rd/mpi.cmake) -include (${CMAKE_PATH}/3rd/boost.cmake) +include (${VF_CMAKE_DIR}/3rd/cuda.cmake) +include (${VF_CMAKE_DIR}/3rd/mpi.cmake) +include (${VF_CMAKE_DIR}/3rd/boost.cmake) linkBoost ("serialization") vf_get_library_name(library_name) diff --git a/apps/gpu/LBM/TGV_3D_MultiGPU/package.include b/apps/gpu/LBM/TGV_3D_MultiGPU/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/LBM/TrafficTest/package.include b/apps/gpu/LBM/TrafficTest/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/LBM/gridGeneratorTest/CMakeLists.txt b/apps/gpu/LBM/gridGeneratorTest/CMakeLists.txt index e4b1aa19095d5d712601852989372c582782e195..8e249d2a21604bf501dc0c75bf9f7190d4a154ad 100644 --- a/apps/gpu/LBM/gridGeneratorTest/CMakeLists.txt +++ b/apps/gpu/LBM/gridGeneratorTest/CMakeLists.txt @@ -2,9 +2,9 @@ PROJECT(GridGeneratorTest) vf_add_library(BUILDTYPE binary DEPENDS basics VirtualFluids_GPU GridGenerator FILES gridGenerator.cpp) -include (${CMAKE_PATH}/3rd/cuda.cmake) -include (${CMAKE_PATH}/3rd/mpi.cmake) -include (${CMAKE_PATH}/3rd/boost.cmake) +include (${VF_CMAKE_DIR}/3rd/cuda.cmake) +include (${VF_CMAKE_DIR}/3rd/mpi.cmake) +include (${VF_CMAKE_DIR}/3rd/boost.cmake) linkBoost ("serialization") vf_get_library_name(library_name) diff --git a/apps/gpu/LBM/gridGeneratorTest/package.include b/apps/gpu/LBM/gridGeneratorTest/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/LBM/lbmTest/package.include b/apps/gpu/LBM/lbmTest/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/LBM/metisTest/package.include b/apps/gpu/LBM/metisTest/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/LBM/streetTest/package.include b/apps/gpu/LBM/streetTest/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTestPostProcessing/Simulation/ShearWave/LogFileData/package.include b/apps/gpu/tests/NumericalTestPostProcessing/Simulation/ShearWave/LogFileData/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTestPostProcessing/Simulation/ShearWave/LogFileDataAssistantStrategy/package.include b/apps/gpu/tests/NumericalTestPostProcessing/Simulation/ShearWave/LogFileDataAssistantStrategy/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTestPostProcessing/Simulation/TaylorGreenVortexUx/LogFileData/package.include b/apps/gpu/tests/NumericalTestPostProcessing/Simulation/TaylorGreenVortexUx/LogFileData/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTestPostProcessing/Simulation/TaylorGreenVortexUx/LogFileDataAssistantStrategy/package.include b/apps/gpu/tests/NumericalTestPostProcessing/Simulation/TaylorGreenVortexUx/LogFileDataAssistantStrategy/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTestPostProcessing/Simulation/TaylorGreenVortexUz/LogFileData/package.include b/apps/gpu/tests/NumericalTestPostProcessing/Simulation/TaylorGreenVortexUz/LogFileData/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTestPostProcessing/Simulation/TaylorGreenVortexUz/LogFileDataAssistantStrategy/package.include b/apps/gpu/tests/NumericalTestPostProcessing/Simulation/TaylorGreenVortexUz/LogFileDataAssistantStrategy/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTestPostProcessing/Simulation/package.include b/apps/gpu/tests/NumericalTestPostProcessing/Simulation/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTestPostProcessing/Tests/L2Norm/LogFileData/package.include b/apps/gpu/tests/NumericalTestPostProcessing/Tests/L2Norm/LogFileData/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTestPostProcessing/Tests/L2Norm/MathematicaAssistant/package.include b/apps/gpu/tests/NumericalTestPostProcessing/Tests/L2Norm/MathematicaAssistant/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTestPostProcessing/Tests/L2NormBetweenKernels/LogFileData/package.include b/apps/gpu/tests/NumericalTestPostProcessing/Tests/L2NormBetweenKernels/LogFileData/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTestPostProcessing/Tests/L2NormBetweenKernels/MathematicaAssistant/package.include b/apps/gpu/tests/NumericalTestPostProcessing/Tests/L2NormBetweenKernels/MathematicaAssistant/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTestPostProcessing/Tests/NyTest/LogFileData/package.include b/apps/gpu/tests/NumericalTestPostProcessing/Tests/NyTest/LogFileData/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTestPostProcessing/Tests/NyTest/MathematicaAssistant/package.include b/apps/gpu/tests/NumericalTestPostProcessing/Tests/NyTest/MathematicaAssistant/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTestPostProcessing/Tests/PhiTest/LogFileData/package.include b/apps/gpu/tests/NumericalTestPostProcessing/Tests/PhiTest/LogFileData/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTestPostProcessing/Tests/PhiTest/MathematicaAssistant/package.include b/apps/gpu/tests/NumericalTestPostProcessing/Tests/PhiTest/MathematicaAssistant/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTestPostProcessing/Utilities/DataPoint/package.include b/apps/gpu/tests/NumericalTestPostProcessing/Utilities/DataPoint/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTestPostProcessing/Utilities/LogFileData/LogFileDataGroup/package.include b/apps/gpu/tests/NumericalTestPostProcessing/Utilities/LogFileData/LogFileDataGroup/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTestPostProcessing/Utilities/LogFileData/package.include b/apps/gpu/tests/NumericalTestPostProcessing/Utilities/LogFileData/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTestPostProcessing/Utilities/LogFileDataAssistant/LogFileDataAssistantStrategy/LogFileDataAssistantStrategyFactory/package.include b/apps/gpu/tests/NumericalTestPostProcessing/Utilities/LogFileDataAssistant/LogFileDataAssistantStrategy/LogFileDataAssistantStrategyFactory/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTestPostProcessing/Utilities/LogFileDataAssistant/LogFileDataAssistantStrategy/package.include b/apps/gpu/tests/NumericalTestPostProcessing/Utilities/LogFileDataAssistant/LogFileDataAssistantStrategy/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTestPostProcessing/Utilities/LogFileDataAssistant/package.include b/apps/gpu/tests/NumericalTestPostProcessing/Utilities/LogFileDataAssistant/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTestPostProcessing/Utilities/LogFileReader/package.include b/apps/gpu/tests/NumericalTestPostProcessing/Utilities/LogFileReader/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTestPostProcessing/Utilities/MathematicaAssistant/MathematicaAssistantFactory/package.include b/apps/gpu/tests/NumericalTestPostProcessing/Utilities/MathematicaAssistant/MathematicaAssistantFactory/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTestPostProcessing/Utilities/MathematicaAssistant/TimeAssistant/package.include b/apps/gpu/tests/NumericalTestPostProcessing/Utilities/MathematicaAssistant/TimeAssistant/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTestPostProcessing/Utilities/MathematicaAssistant/package.include b/apps/gpu/tests/NumericalTestPostProcessing/Utilities/MathematicaAssistant/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTestPostProcessing/Utilities/MathematicaFile/package.include b/apps/gpu/tests/NumericalTestPostProcessing/Utilities/MathematicaFile/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTestPostProcessing/Utilities/MathematicaFunction/LinePlot/package.include b/apps/gpu/tests/NumericalTestPostProcessing/Utilities/MathematicaFunction/LinePlot/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTestPostProcessing/Utilities/MathematicaFunction/ListOfLists/package.include b/apps/gpu/tests/NumericalTestPostProcessing/Utilities/MathematicaFunction/ListOfLists/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTestPostProcessing/Utilities/MathematicaFunction/PointList/package.include b/apps/gpu/tests/NumericalTestPostProcessing/Utilities/MathematicaFunction/PointList/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTestPostProcessing/Utilities/MathematicaFunction/package.include b/apps/gpu/tests/NumericalTestPostProcessing/Utilities/MathematicaFunction/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTestPostProcessing/Utilities/MathematicaFunctionFactory/package.include b/apps/gpu/tests/NumericalTestPostProcessing/Utilities/MathematicaFunctionFactory/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTestPostProcessing/Utilities/PostProcessingConfigData/package.include b/apps/gpu/tests/NumericalTestPostProcessing/Utilities/PostProcessingConfigData/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTestPostProcessing/Utilities/PostProcessingConfigFileReader/package.include b/apps/gpu/tests/NumericalTestPostProcessing/Utilities/PostProcessingConfigFileReader/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTestPostProcessing/Utilities/package.include b/apps/gpu/tests/NumericalTestPostProcessing/Utilities/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTestPostProcessing/package.include b/apps/gpu/tests/NumericalTestPostProcessing/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Simulations/ShearWave/AnalyticalResults/package.include b/apps/gpu/tests/NumericalTests/Simulations/ShearWave/AnalyticalResults/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Simulations/ShearWave/InitialConditions/package.include b/apps/gpu/tests/NumericalTests/Simulations/ShearWave/InitialConditions/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Simulations/ShearWave/LogFileInformation/package.include b/apps/gpu/tests/NumericalTests/Simulations/ShearWave/LogFileInformation/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Simulations/ShearWave/SimulationInfo/package.include b/apps/gpu/tests/NumericalTests/Simulations/ShearWave/SimulationInfo/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Simulations/ShearWave/SimulationParameter/package.include b/apps/gpu/tests/NumericalTests/Simulations/ShearWave/SimulationParameter/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Simulations/ShearWave/package.include b/apps/gpu/tests/NumericalTests/Simulations/ShearWave/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Simulations/TaylorGreenVortexUx/AnalyticalResults/package.include b/apps/gpu/tests/NumericalTests/Simulations/TaylorGreenVortexUx/AnalyticalResults/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Simulations/TaylorGreenVortexUx/InitialConditions/package.include b/apps/gpu/tests/NumericalTests/Simulations/TaylorGreenVortexUx/InitialConditions/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Simulations/TaylorGreenVortexUx/LogFileInformation/package.include b/apps/gpu/tests/NumericalTests/Simulations/TaylorGreenVortexUx/LogFileInformation/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Simulations/TaylorGreenVortexUx/SimulationInfo/package.include b/apps/gpu/tests/NumericalTests/Simulations/TaylorGreenVortexUx/SimulationInfo/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Simulations/TaylorGreenVortexUx/SimulationParameter/package.include b/apps/gpu/tests/NumericalTests/Simulations/TaylorGreenVortexUx/SimulationParameter/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Simulations/TaylorGreenVortexUx/package.include b/apps/gpu/tests/NumericalTests/Simulations/TaylorGreenVortexUx/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Simulations/TaylorGreenVortexUz/AnalyticalResults/package.include b/apps/gpu/tests/NumericalTests/Simulations/TaylorGreenVortexUz/AnalyticalResults/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Simulations/TaylorGreenVortexUz/InitialConditions/package.include b/apps/gpu/tests/NumericalTests/Simulations/TaylorGreenVortexUz/InitialConditions/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Simulations/TaylorGreenVortexUz/LogFileInformation/package.include b/apps/gpu/tests/NumericalTests/Simulations/TaylorGreenVortexUz/LogFileInformation/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Simulations/TaylorGreenVortexUz/SimulationInfo/package.include b/apps/gpu/tests/NumericalTests/Simulations/TaylorGreenVortexUz/SimulationInfo/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Simulations/TaylorGreenVortexUz/SimulationParameter/package.include b/apps/gpu/tests/NumericalTests/Simulations/TaylorGreenVortexUz/SimulationParameter/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Simulations/TaylorGreenVortexUz/package.include b/apps/gpu/tests/NumericalTests/Simulations/TaylorGreenVortexUz/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Tests/L2NormTest/LogFileInformation/package.include b/apps/gpu/tests/NumericalTests/Tests/L2NormTest/LogFileInformation/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Tests/L2NormTest/PostProcessingStrategy/package.include b/apps/gpu/tests/NumericalTests/Tests/L2NormTest/PostProcessingStrategy/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Tests/L2NormTest/package.include b/apps/gpu/tests/NumericalTests/Tests/L2NormTest/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Tests/L2NormTestBetweenKernels/LogFileInformation/package.include b/apps/gpu/tests/NumericalTests/Tests/L2NormTestBetweenKernels/LogFileInformation/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Tests/L2NormTestBetweenKernels/PostProcessingStrategy/package.include b/apps/gpu/tests/NumericalTests/Tests/L2NormTestBetweenKernels/PostProcessingStrategy/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Tests/L2NormTestBetweenKernels/package.include b/apps/gpu/tests/NumericalTests/Tests/L2NormTestBetweenKernels/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Tests/NyTest/LogFileInformation/package.include b/apps/gpu/tests/NumericalTests/Tests/NyTest/LogFileInformation/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Tests/NyTest/PostProcessingStrategy/package.include b/apps/gpu/tests/NumericalTests/Tests/NyTest/PostProcessingStrategy/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Tests/NyTest/package.include b/apps/gpu/tests/NumericalTests/Tests/NyTest/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Tests/PhiTest/LogFileInformation/package.include b/apps/gpu/tests/NumericalTests/Tests/PhiTest/LogFileInformation/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Tests/PhiTest/PostProcessingStrategy/package.include b/apps/gpu/tests/NumericalTests/Tests/PhiTest/PostProcessingStrategy/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Tests/PhiTest/package.include b/apps/gpu/tests/NumericalTests/Tests/PhiTest/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Utilities/Calculator/FFTCalculator/package.include b/apps/gpu/tests/NumericalTests/Utilities/Calculator/FFTCalculator/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Utilities/Calculator/L2NormCalculator/L2CalculatorNormalizeWithAmplitude/package.include b/apps/gpu/tests/NumericalTests/Utilities/Calculator/L2NormCalculator/L2CalculatorNormalizeWithAmplitude/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Utilities/Calculator/L2NormCalculator/L2CalculatorNormalizeWithBasicData/package.include b/apps/gpu/tests/NumericalTests/Utilities/Calculator/L2NormCalculator/L2CalculatorNormalizeWithBasicData/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Utilities/Calculator/L2NormCalculator/L2NormCalculatorFactory/package.include b/apps/gpu/tests/NumericalTests/Utilities/Calculator/L2NormCalculator/L2NormCalculatorFactory/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Utilities/Calculator/L2NormCalculator/package.include b/apps/gpu/tests/NumericalTests/Utilities/Calculator/L2NormCalculator/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Utilities/Calculator/package.include b/apps/gpu/tests/NumericalTests/Utilities/Calculator/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Utilities/ColorConsoleOutput/package.include b/apps/gpu/tests/NumericalTests/Utilities/ColorConsoleOutput/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Utilities/ConfigFileReaderNT/package.include b/apps/gpu/tests/NumericalTests/Utilities/ConfigFileReaderNT/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Utilities/DataWriter/AnalyticalResults2DToVTKWriter/package.include b/apps/gpu/tests/NumericalTests/Utilities/DataWriter/AnalyticalResults2DToVTKWriter/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Utilities/DataWriter/Y2dSliceToResults/package.include b/apps/gpu/tests/NumericalTests/Utilities/DataWriter/Y2dSliceToResults/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Utilities/DataWriter/package.include b/apps/gpu/tests/NumericalTests/Utilities/DataWriter/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Utilities/InitialCondition/package.include b/apps/gpu/tests/NumericalTests/Utilities/InitialCondition/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Utilities/KernelConfiguration/package.include b/apps/gpu/tests/NumericalTests/Utilities/KernelConfiguration/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Utilities/LogFileInformation/BasicSimulationInfo/package.include b/apps/gpu/tests/NumericalTests/Utilities/LogFileInformation/BasicSimulationInfo/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Utilities/LogFileInformation/BasicTestLogFileInformation/package.include b/apps/gpu/tests/NumericalTests/Utilities/LogFileInformation/BasicTestLogFileInformation/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Utilities/LogFileInformation/LogFileHead/package.include b/apps/gpu/tests/NumericalTests/Utilities/LogFileInformation/LogFileHead/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Utilities/LogFileInformation/LogFileTimeInformation/package.include b/apps/gpu/tests/NumericalTests/Utilities/LogFileInformation/LogFileTimeInformation/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Utilities/LogFileInformation/SimulationLogFileInformation/package.include b/apps/gpu/tests/NumericalTests/Utilities/LogFileInformation/SimulationLogFileInformation/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Utilities/LogFileInformation/TestLogFileInformation/package.include b/apps/gpu/tests/NumericalTests/Utilities/LogFileInformation/TestLogFileInformation/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Utilities/LogFileInformation/package.include b/apps/gpu/tests/NumericalTests/Utilities/LogFileInformation/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Utilities/LogFileQueue/package.include b/apps/gpu/tests/NumericalTests/Utilities/LogFileQueue/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Utilities/LogFileWriter/package.include b/apps/gpu/tests/NumericalTests/Utilities/LogFileWriter/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Utilities/NumericalTestFactory/package.include b/apps/gpu/tests/NumericalTests/Utilities/NumericalTestFactory/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Utilities/NumericalTestGridReader/package.include b/apps/gpu/tests/NumericalTests/Utilities/NumericalTestGridReader/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Utilities/NumericalTestSimulation/package.include b/apps/gpu/tests/NumericalTests/Utilities/NumericalTestSimulation/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Utilities/NumericalTestSuite/package.include b/apps/gpu/tests/NumericalTests/Utilities/NumericalTestSuite/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Utilities/PostProcessingStrategy/package.include b/apps/gpu/tests/NumericalTests/Utilities/PostProcessingStrategy/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Utilities/Results/AnalyticalResults/package.include b/apps/gpu/tests/NumericalTests/Utilities/Results/AnalyticalResults/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Utilities/Results/SimulationResults/package.include b/apps/gpu/tests/NumericalTests/Utilities/Results/SimulationResults/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Utilities/Results/package.include b/apps/gpu/tests/NumericalTests/Utilities/Results/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Utilities/SimulationInfo/package.include b/apps/gpu/tests/NumericalTests/Utilities/SimulationInfo/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Utilities/SimulationParameter/package.include b/apps/gpu/tests/NumericalTests/Utilities/SimulationParameter/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Utilities/Structs/package.include b/apps/gpu/tests/NumericalTests/Utilities/Structs/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Utilities/Test/package.include b/apps/gpu/tests/NumericalTests/Utilities/Test/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Utilities/TestQueue/package.include b/apps/gpu/tests/NumericalTests/Utilities/TestQueue/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Utilities/TestSimulation/package.include b/apps/gpu/tests/NumericalTests/Utilities/TestSimulation/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Utilities/Time/package.include b/apps/gpu/tests/NumericalTests/Utilities/Time/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Utilities/VirtualFluidSimulation/package.include b/apps/gpu/tests/NumericalTests/Utilities/VirtualFluidSimulation/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/Utilities/VirtualFluidSimulationFactory/package.include b/apps/gpu/tests/NumericalTests/Utilities/VirtualFluidSimulationFactory/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/apps/gpu/tests/NumericalTests/package.include b/apps/gpu/tests/NumericalTests/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/cpu.cmake b/cpu.cmake index 204c00b718f8a735314691787df29bdb4dce6dc8..d3522f0585c184905c9d9da74a342a36d418e024 100644 --- a/cpu.cmake +++ b/cpu.cmake @@ -20,8 +20,6 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.10) #set(CMAKE_CXX_COMPILER mpiCC) PROJECT(VirtualFluids) -set (SOURCE_DIR ${PROJECT_SOURCE_DIR}) -set(SOURCE_ROOT ${CMAKE_SOURCE_DIR}) #debug build for unix #IF(UNIX) @@ -165,5 +163,5 @@ add_subdirectory(3rdParty/MuParser) add_subdirectory(src/cpu/VirtualFluidsCore) #add_subdirectory(VirtualFluidsBasic) -set (APPS_ROOT_CPU "${CMAKE_SOURCE_DIR}/apps/cpu/") +set (APPS_ROOT_CPU "${VF_ROOT_DIR}/apps/cpu") include(${APPS_ROOT_CPU}/Applications.cmake) \ No newline at end of file diff --git a/gpu.cmake b/gpu.cmake index cde1c42886237ce7df2f60d40e6d231e83691009..8e71c74ab7d6613c4acdc6801771a281ccd87d93 100644 --- a/gpu.cmake +++ b/gpu.cmake @@ -27,24 +27,6 @@ if(UNIX) set(CMAKE_CXX_STANDARD 14) endif() -############################################################# -### ENVIRONMENT ### -############################################################# -set(cmakeMacroPath "CMakeMacros") -#include(${cmakeMacroPath}/Environment/environment.cmake) - -#CAB -#include("../CMake/CMakeCABMacros.cmake") -#include("../CMake/FileUtilities.cmake") -#include("../CMake/VirtualFluidsMacros.cmake") - -############################################################# -### GENERAL MACROS ### -############################################################# -#include(${CMAKE_SOURCE_DIR}/${cmakeMacroPath}/general/BuildTarget.cmake) -#include(${CMAKE_SOURCE_DIR}/${cmakeMacroPath}/general/BuildTargetUtilities.cmake) -#include(${CMAKE_SOURCE_DIR}/${cmakeMacroPath}/general/EndingsToCollect.cmake) -#include(${CMAKE_SOURCE_DIR}/${cmakeMacroPath}/general/FileUtilities.cmake) ############################################################# ### PROJECT SETTINGS ### diff --git a/src/basics/CMakeLists.txt b/src/basics/CMakeLists.txt index 5d371078fc7b2043444443da146cb416f2eab373..3d5d423d520ac9a31d4c224df97c6f1779188c7c 100644 --- a/src/basics/CMakeLists.txt +++ b/src/basics/CMakeLists.txt @@ -1,59 +1,23 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_LIST_DIR}) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_LIST_DIR}/numerics/geometry3d) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_LIST_DIR}/numerics/geometry3d/Creator) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_LIST_DIR}/numerics/geometry3d/KdTree) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_LIST_DIR}/basics/container) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_LIST_DIR}/basics/memory) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_LIST_DIR}/basics/objects) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_LIST_DIR}/basics/transmiitter) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_LIST_DIR}/utilities) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_LIST_DIR}/basics/writer) - - -include (${CMAKE_SOURCE_DIR}/CMake/VirtualFluidsMacros.cmake) -#SET(CAB_ADDITIONAL_LINK_LIBRARIES ${MPI_CXX_LIBRARIES}) - include(Core/buildInfo.cmake) -INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/VirtualFluidsCore) -INCLUDE_DIRECTORIES(${MPI_INCLUDE_PATH}) - - - -vf_add_library(BUILDTYPE static - FOLDER - ${CMAKE_CURRENT_LIST_DIR}/numerics/geometry3d - ${CMAKE_CURRENT_LIST_DIR}/numerics/geometry3d/creator - ${CMAKE_CURRENT_LIST_DIR}/numerics/geometry3d/KdTree - ${CMAKE_CURRENT_LIST_DIR}/basics/container - ${CMAKE_CURRENT_LIST_DIR}/basics/memory - ${CMAKE_CURRENT_LIST_DIR}/basics/objects - ${CMAKE_CURRENT_LIST_DIR}/basics/transmiitter - ${CMAKE_CURRENT_LIST_DIR}/basics/utilities - ${CMAKE_CURRENT_LIST_DIR}/basics/writer - ${CMAKE_CURRENT_LIST_DIR}/Core - ${CMAKE_CURRENT_LIST_DIR}/Core/Logger - ${CMAKE_CURRENT_LIST_DIR}/Core/Logger/implementations - ${CMAKE_CURRENT_LIST_DIR}/Core/Input - ${CMAKE_CURRENT_LIST_DIR}/Core/Input/ConfigData - ${CMAKE_CURRENT_LIST_DIR}/Core/Input/ConfigFileReader - ${CMAKE_CURRENT_LIST_DIR}/Core/Input/ConfigInput - ${CMAKE_CURRENT_LIST_DIR}/Core/Input/JsonInput - ${CMAKE_CURRENT_LIST_DIR}/Core/StringUtilities - ${CMAKE_CURRENT_LIST_DIR}/Core/Timer - - EXCLUDE buildInfo.in.cpp - ) +vf_add_library(BUILDTYPE static EXCLUDE buildInfo.in.cpp) vf_get_library_name (library_name) target_include_directories(${library_name} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/Core) -target_include_directories(${library_name} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) +target_include_directories(${library_name} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/geometry3d) +target_include_directories(${library_name} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/geometry3d/KdTree) +target_include_directories(${library_name} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/basics/container) +target_include_directories(${library_name} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/basics/memory) +target_include_directories(${library_name} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/basics/objects) +target_include_directories(${library_name} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/basics/transmitter) +target_include_directories(${library_name} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/utilities) +target_include_directories(${library_name} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/basics/writer) IF(MSVC) target_compile_definitions(${library_name} PUBLIC NOMINMAX) # Disable Min/Max-Macros ENDIF(MSVC) -include (${CMAKE_PATH}/3rd/mpi.cmake) +include (${VF_CMAKE_DIR}/3rd/mpi.cmake) vf_add_tests() \ No newline at end of file diff --git a/src/basics/Core/LbmOrGks.h b/src/basics/Core/LbmOrGks.h index bd9a55ae12ddc3a904105afd9c607c5da7841440..96ef76a5a76cb029ab8aef7767574f18906c451a 100644 --- a/src/basics/Core/LbmOrGks.h +++ b/src/basics/Core/LbmOrGks.h @@ -1,7 +1,35 @@ -/* -* Author: St. Lenz -* mail: lenz@irmb.tu-bs.de -*/ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file LbmOrGks.h +//! \ingroup Core +//! \author Stephan Lenz +//======================================================================================= #ifndef LBMORGKS_H #define LBMORGKS_H diff --git a/src/basics/Core/buildInfo.cmake b/src/basics/Core/buildInfo.cmake index 91972c43d54037beb194b7c8a30c3aca43784edb..bbad317e989f670e05eb663a74123343035daa63 100644 --- a/src/basics/Core/buildInfo.cmake +++ b/src/basics/Core/buildInfo.cmake @@ -2,7 +2,7 @@ set(buildInfoPath ${CMAKE_BINARY_DIR}/buildInfo) set(buildInfoFile buildInfo.cpp) set(buildInfoInput ${CMAKE_CURRENT_LIST_DIR}/buildInfo.in.cpp) -include(${CMAKE_PATH}/3rd/git/GetGitRevisionDescription.cmake) +include(${VF_CMAKE_DIR}/3rd/git/GetGitRevisionDescription.cmake) get_git_head_revision(git_branch git_commit_hash) set(COMPILER_FLAGS "${CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}} ${CMAKE_CXX_FLAGS}") diff --git a/src/basics/Core/package.include b/src/basics/Core/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/basics/Core/PointerDefinitions.h b/src/basics/PointerDefinitions.h similarity index 88% rename from src/basics/Core/PointerDefinitions.h rename to src/basics/PointerDefinitions.h index d3257e2ed85b8fb9c8fdf530185e1410259fd355..07462b89eca7f3248ee311a849ba185261597204 100644 --- a/src/basics/Core/PointerDefinitions.h +++ b/src/basics/PointerDefinitions.h @@ -23,6 +23,6 @@ using RPtr = T*; template <class T> using enableSharedFromThis = std::enable_shared_from_this<T>; -#define dynamicPointerCast dynamic_pointer_cast +#define dynamicPointerCast std::dynamic_pointer_cast #endif diff --git a/src/basics/basics/container/CbArray2D.h b/src/basics/basics/container/CbArray2D.h index 54df75401aafd97a3bcb95cc00d757ffce1fd745..c4c115c29321073b4f56dccf27ebd53507c93b20 100644 --- a/src/basics/basics/container/CbArray2D.h +++ b/src/basics/basics/container/CbArray2D.h @@ -1,34 +1,38 @@ -// _ ___ __ __________ _ __ -// | | / (_)____/ /___ ______ _/ / ____/ /_ __(_)___/ /____ -// | | / / / ___/ __/ / / / __ `/ / /_ / / / / / / __ / ___/ -// | |/ / / / / /_/ /_/ / /_/ / / __/ / / /_/ / / /_/ (__ ) -// |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ // +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file CbArray2D.h +//! \ingroup container +//! \author Soeren Freudiger, Sebastian Geller +//======================================================================================= #ifndef CBARRAY2D_H #define CBARRAY2D_H -////////////////////////////////////////////////////////////////////////// -// 4D Array -// die Daten werden in einem Vector gehalten -// -// Ver 1.2 -// Nov. 2003 muffmolch@gmx.de -// Ver 1.3 -// Aug. 2006 - Kosmetik -// Ver 1.4 -// Sep. 2006 - indexer eingefuehrt -// Ver 1.5 -// Jul. 2006 - size_t + range check bei getIndex -// Ver 1.6 -// Mrz. 2008 - typedefs, new index checks, NO_CB_RANGECHECK, no base class -// assigmetcomparison between Matrices with different value_type and/or index-class -// Oct. 2008 - +isEmpty() -// -// Rangecheck aktiv, wenn: -// -debug : not defined "NO_CB_RANGECHECK" -// -release: not defined "NO_CB_RANGECHECK" && defined "CB_RANGECHECK" -////////////////////////////////////////////////////////////////////////// - #include <iomanip> #include <basics/utilities/UbException.h> @@ -36,10 +40,6 @@ #include <algorithm> #include <typeinfo> -#ifdef CAB_RCF - #include <3rdParty/rcf/RcfSerializationIncludes.h> -#endif //CAB_RCF - ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// // IndexClasses @@ -90,7 +90,16 @@ public: ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// // CbArray2D - +////////////////////////////////////////////////////////////////////////// +//! \brief 2D Array +//! \details the data is stored in a vector +//! +//! Rangecheck active, if: +//! +//! -debug : not defined "NO_CB_RANGECHECK" +//! +//! -release: not defined "NO_CB_RANGECHECK" && defined "CB_RANGECHECK" +////////////////////////////////////////////////////////////////////////// template<typename T, typename IndexClass = IndexerX2X1> class CbArray2D { @@ -128,7 +137,7 @@ public: this->resize(uniformDimensionSize,uniformDimensionSize); } /*=======================================================================*/ - //übernimmt vector als daten vector! (erstellt KEINE kopie!!!, vec ist anschließend leer, da swap verwendet wird) + //ssbernimmt vector als daten vector! (erstellt KEINE kopie!!!, vec ist anschlieueend leer, da swap verwendet wird) CbArray2D(std::vector<value_type>& vec, const size_type& nx1,const size_type& nx2) { assert( (nx1*nx2)==vec.size() ); @@ -190,7 +199,7 @@ public: this->data.resize(rhs.data.size()); //Sourcedaten kopieren (!! koennte anderen Indexer besitzen!!! -> operator() benutzen) - //ACHTUNG: für diese Konvertierung muss bei Klassen der demenstrechende operator + //ACHTUNG: fuer diese Konvertierung muss bei Klassen der demenstrechende operator // implementiert sein, e.g.: class value_type2 {public: inline operator value_type2() const { return value_type2(); } for(int x1=0; x1<this->nx1; x1++) for(int x2=0; x2<this->nx2; x2++) @@ -372,16 +381,6 @@ public: return indexer.getIndex(x1,x2,nx1,nx2); } -#ifdef CAB_RCF - template<class Archive> - void serialize(Archive & ar, const unsigned int version) - { - ar & nx1; - ar & nx2; - ar & data; - } -#endif //CAB_RCF - protected: /*=======================================================================*/ //success -> true diff --git a/src/basics/basics/container/CbArray3D.h b/src/basics/basics/container/CbArray3D.h index 2ec0306c4dafd449c11a3741e69bae90ad892fb2..f8ad3e8c9e114729bcaa1e6bfa67fa2c9cceba0d 100644 --- a/src/basics/basics/container/CbArray3D.h +++ b/src/basics/basics/container/CbArray3D.h @@ -1,34 +1,38 @@ -// _ ___ __ __________ _ __ -// | | / (_)____/ /___ ______ _/ / ____/ /_ __(_)___/ /____ -// | | / / / ___/ __/ / / / __ `/ / /_ / / / / / / __ / ___/ -// | |/ / / / / /_/ /_/ / /_/ / / __/ / / /_/ / / /_/ (__ ) -// |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ // +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file CbArray3D.h +//! \ingroup container +//! \author Soeren Freudiger, Sebastian Geller +//======================================================================================= #ifndef CBARRAY3D_H #define CBARRAY3D_H -////////////////////////////////////////////////////////////////////////// -// 3D Array -// die Daten werden in einem Vector gehalten -// -// Ver 1.2 -// Nov. 2003 muffmolch@gmx.de -// Ver 1.3 -// Aug. 2006 - Kosmetik -// Ver 1.4 -// Sep. 2006 - indexer eingefuehrt -// Ver 1.5 -// Jul. 2006 - size_t + range check bei getIndex -// Ver 1.2 -// Mrz. 2008 - typedefs, new index checks, NO_CB_RANGECHECK, no base class -// assigmetcomparison between Matrices with different value_type and/or index-class -// Oct. 2008 - +isEmpty() -// -// Rangecheck aktiv, wenn: -// -debug : not defined "NO_CB_RANGECHECK" -// -release: not defined "NO_CB_RANGECHECK" && defined "CB_RANGECHECK" -////////////////////////////////////////////////////////////////////////// - #include <iomanip> #include <basics/utilities/UbException.h> @@ -37,10 +41,6 @@ #include <typeinfo> #include "PointerDefinitions.h" -#ifdef CAB_RCF - #include <3rdParty/rcf/RcfSerializationIncludes.h> -#endif //CAB_RCF - ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// // IndexClasses @@ -122,6 +122,16 @@ public: ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// // CbArray3D +////////////////////////////////////////////////////////////////////////// +//! \brief 3D Array +//! \details The data is stored in a vector +//! +//! Rangecheck active, if: +//! +//! -debug : not defined "NO_CB_RANGECHECK" +//! +//! -release: not defined "NO_CB_RANGECHECK" && defined "CB_RANGECHECK" +////////////////////////////////////////////////////////////////////////// template<typename T, typename IndexClass = IndexerX3X2X1> class CbArray3D { @@ -161,7 +171,7 @@ public: this->resize(uniformDimensionSize,uniformDimensionSize,uniformDimensionSize); } /*=======================================================================*/ - //�bernimmt vector als daten vector! (erstellt KEINE kopie!!!, vec ist anschlie�end leer, da swap verwendet wird) + //ssbernimmt vector als daten vector! (erstellt KEINE kopie!!!, vec ist anschliessend leer, da swap verwendet wird) CbArray3D(std::vector<value_type>& vec, const size_type& nx1,const size_type& nx2, const size_type& nx3) { assert( (nx1*nx2*nx3)==vec.size() ); @@ -422,17 +432,6 @@ public: return indexer.getIndex(x1,x2,x3,nx1,nx2,nx3); } -#ifdef CAB_RCF - template<class Archive> - void serialize(Archive & ar, const unsigned int version) - { - ar & nx1; - ar & nx2; - ar & nx3; - ar & data; - } -#endif //CAB_RCF - /*=======================================================================*/ //success -> true diff --git a/src/basics/basics/container/CbArray4D.h b/src/basics/basics/container/CbArray4D.h index aa91844d034d888badc632c3d5ebfbab45efc61e..21579b0da97abf5a7bb062d17f4cc03b3fefaaef 100644 --- a/src/basics/basics/container/CbArray4D.h +++ b/src/basics/basics/container/CbArray4D.h @@ -1,29 +1,39 @@ -// _ ___ __ __________ _ __ -// | | / (_)____/ /___ ______ _/ / ____/ /_ __(_)___/ /____ -// | | / / / ___/ __/ / / / __ `/ / /_ / / / / / / __ / ___/ -// | |/ / / / / /_/ /_/ / /_/ / / __/ / / /_/ / / /_/ (__ ) -// |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ // +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file CbArray4D.h +//! \ingroup container +//! \author Soeren Freudiger, Sebastian Geller +//======================================================================================= #ifndef CBARRAY4D_H #define CBARRAY4D_H -////////////////////////////////////////////////////////////////////////// -// 4D Array -// die Daten werden in einem Vector gehalten -// -// Ver 1.0 -// Sept. 2006 muffmolch@gmx.de -// Ver 1.1 -// Jul. 2006 - size_t + range check bei getIndex -// Ver 1.2 -// Mrz. 2008 - typedefs, new index checks, NO_CB_RANGECHECK, no base class -// assigmetcomparison between Matrices with different value_type and/or index-class -// Oct. 2008 - +isEmpty() -// -// Rangecheck aktiv, wenn: -// -debug : not defined "NO_CB_RANGECHECK" -// -release: not defined "NO_CB_RANGECHECK" && defined "CB_RANGECHECK" -////////////////////////////////////////////////////////////////////////// + #include <iomanip> #include <basics/utilities/UbException.h> @@ -32,13 +42,6 @@ #include <typeinfo> #include "PointerDefinitions.h" -#include "basics_export.h" - -#ifdef CAB_RCF - #include <3rdParty/rcf/RcfSerializationIncludes.h> -#endif //CAB_RCF - - ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// // IndexClasses @@ -50,7 +53,7 @@ // for(alle X2) // for(alle X3) // for(alle X4) -class BASICS_EXPORT IndexerX1X2X3X4 +class IndexerX1X2X3X4 { public: typedef int size_type; @@ -93,8 +96,16 @@ public: } }; ////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////// // CbArray4D +//! \brief 4D Array +//! \details The data is stored in a vector +//! +//! Rangecheck active, if: +//! +//! -debug : not defined "NO_CB_RANGECHECK" +//! +//! -release: not defined "NO_CB_RANGECHECK" && defined "CB_RANGECHECK" +////////////////////////////////////////////////////////////////////////// template<typename T, typename IndexClass = IndexerX4X3X2X1> class CbArray4D { @@ -134,7 +145,7 @@ public: this->resize(uniformDimensionSize,uniformDimensionSize,uniformDimensionSize,uniformDimensionSize); } /*=======================================================================*/ - //ubernimmt vector als daten vector! (erstellt KEINE kopie!!!, vec ist anschlie�end leer, da swap verwendet wird) + //ubernimmt vector als daten vector! (erstellt KEINE kopie!!!, vec ist anschliessend leer, da swap verwendet wird) CbArray4D(std::vector<value_type>& vec, const size_type& nx1,const size_type& nx2, const size_type& nx3, const size_type& nx4) { assert( (nx1*nx2*nx3*nx4)==vec.size() ); @@ -403,18 +414,6 @@ public: return indexer.getIndex(x1,x2,x3,x4,nx1,nx2,nx3,nx4); } -#ifdef CAB_RCF - template<class Archive> - void serialize(Archive & ar, const unsigned int version) - { - ar & nx1; - ar & nx2; - ar & nx3; - ar & nx4; - ar & data; - } -#endif //CAB_RCF - protected: /*=======================================================================*/ //success -> true diff --git a/src/basics/basics/container/CbVector.h b/src/basics/basics/container/CbVector.h index bd7174da9b46fe7b53352d38bb9d1ce5d143c641..d0fc6144d0762b58d823fa4abbecfbf7c61a7aa3 100644 --- a/src/basics/basics/container/CbVector.h +++ b/src/basics/basics/container/CbVector.h @@ -1,17 +1,38 @@ -// _ ___ __ __________ _ __ -// | | / (_)____/ /___ ______ _/ / ____/ /_ __(_)___/ /____ -// | | / / / ___/ __/ / / / __ `/ / /_ / / / / / / __ / ___/ -// | |/ / / / / /_/ /_/ / /_/ / / __/ / / /_/ / / /_/ (__ ) -// |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ // +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file CbVector.h +//! \ingroup container +//! \author Soeren Freudiger, Sebastian Geller +//======================================================================================= #ifndef CBVECTOR_H #define CBVECTOR_H -#ifdef CAB_RCF - #include <3rdParty/rcf/RcfSerializationIncludes.h> - #include <RCF/ByteBuffer.hpp> -#endif - #include <vector> #include <algorithm> //for std::swap #include <typeinfo> //for typeid @@ -20,36 +41,23 @@ #include <basics/utilities/UbSystem.h> #include <basics/utilities/UbEqual.h> -/*=========================================================================*/ -/* CbVector */ -/* */ -/** -<BR><BR> -@author <A HREF="mailto:muffmolch@gmx.de">S. Freudiger</A> -@version 1.0 - 08.11.07 -@version 1.1 - 09.02.08 -@version 1.2 - 23.04.08 - swap added -@version 1.3 - 08.05.08 - boosting up serialization performance! -*/ - -/* -usage: ... -Da es Voraussetzun bei doeser Klasse war, dass lediglich der Typ als -template-parameter miteingeht, muss der allcocator eine abstrakte klasse sein -ansonsten h�tte sich hier der allokator als zweites argument -wie beim STL vector angeboten, womit man auch keinen pointer speichern muesste. -Im letzteren Fall w�rde aber jeweils ein bestimmeter Klassentyp in Abhaengigkeit -des allokators zur compilezeit erzeugt. Problem wir wollen ein und denselben -typ benutzen und nur der allokator innerhalb der klasse soll sich unterscheiden -// -// Rangecheck aktiv, wenn: -// -debug : not defined "NO_CB_RANGECHECK" -// -release: not defined "NO_CB_RANGECHECK" && defined "CB_RANGECHECK" -*/ - template< typename T > class CbVectorAllocator; template< typename T > class CbVectorAllocatorStd; +//========================================================================= +//! \brief A class implements a container like a vector +//! \details +//! For this class it was required to ave only the type as template argument. +//! Hence, the allocator must be an abstract class. With out this requirement, +//! an allocator as second template argument would have been possible, as in the +//! STL vector. This would lead to the compiler generating two different classes +//! for the same data type with different allocators during compile time. Here it +//! is required that the same class can have different allocators. +//! +//! Rangecheck active, if: +//! -debug : not defined "NO_CB_RANGECHECK" +//! -release: not defined "NO_CB_RANGECHECK" && defined "CB_RANGECHECK" +//========================================================================= ////////////////////////////////////////////////////////////////////////// template< typename T > class CbVector @@ -194,43 +202,6 @@ public: /*==========================================================*/ CbVectorAllocator<value_type>* getAllocator() const { return allocator; } /*==========================================================*/ - #ifdef CAB_RCF - template<typename Archive> - void serialize(Archive & ar, const unsigned int version) - { - if( ArchiveTools::isWriting(ar) ) - { - ar & allocator; - ar & dataSize; //!!!erst hier - - //old: - //for(size_type i=0; i<dataSize; i++) - // ar & ptrData[i]; - - //new and boosting to the sky: - RCF::ByteBuffer byteBuffer( (char*) &ptrData[0], dataSize*sizeof(value_type) ); - ar & byteBuffer; - } - else - { - CbVectorAllocator<value_type>* tmpCbVectorAllocator(NULL); - size_type tmpInteger; - ar & tmpCbVectorAllocator; - ar & tmpInteger; - this->setAllocator(tmpCbVectorAllocator); - allocator->resize(*this,tmpInteger); - - //old: - //for(size_type i=0; i<dataSize; i++) - // ar & ptrData[i]; - - //new and boosting to the sky: - RCF::ByteBuffer byteBuffer; - ar & byteBuffer; - memcpy( (char*)ptrData, byteBuffer.getPtr(), byteBuffer.getLength() ); - } - } - #endif //CAB_RCF private: value_type* ptrData; @@ -258,13 +229,6 @@ public: virtual bool resize(CbVector< value_type >& vec, const size_type& dataSize, const value_type& value=value_type()) = 0; virtual bool dealloc(CbVector< value_type >& vec) = 0; -#ifdef CAB_RCF - template<class Archive> - void serialize(Archive & ar, const unsigned int version) - { - } -#endif //CAB_RCF - protected: //folgende Methoden ersparen eine friend Deklaierung aller moeglichen Allocatoren //denn durch diese beiden Methoden haben sie exklusive Zugriffsrechte! @@ -282,12 +246,6 @@ protected: } }; -#ifdef RCF_USE_SF_SERIALIZATION -SF_NO_CTOR(CbVectorAllocator<double>); -SF_NO_CTOR(CbVectorAllocator<float>); -#endif //RCF_USE_SF_SERIALIZATION - - ////////////////////////////////////////////////////////////////////////// // CbVectorAllocatorStd ////////////////////////////////////////////////////////////////////////// @@ -342,24 +300,8 @@ public: return true; } /*==========================================================*/ - #ifdef CAB_RCF - template<class Archive> - void serialize(Archive & ar, const unsigned int version) - { - serializeParent< CbVectorAllocator<value_type> >(ar, *this); - } - #endif //CAB_RCF private: }; - -#ifdef RCF_USE_SF_SERIALIZATION - UB_AUTO_RUN_NAMED( SF::registerType< CbVectorAllocatorStd<double> >(" CbVectorAllocatorStd<double> ") , SF_CbVectorAllocatorStd_double ); - UB_AUTO_RUN_NAMED( ( SF::registerBaseAndDerived< CbVectorAllocator<double>, CbVectorAllocatorStd<double> >() ), SF_CbVectorAllocatorStd_double_BD1 ); - - UB_AUTO_RUN_NAMED( SF::registerType< CbVectorAllocatorStd<float> >(" CbVectorAllocatorStd<float> " ) , SF_CbVectorAllocatorStd_float ); - UB_AUTO_RUN_NAMED( ( SF::registerBaseAndDerived< CbVectorAllocator<float> , CbVectorAllocatorStd<float> >() ), SF_CbVectorAllocatorStd_float_BD2 ); -#endif //RCF_USE_SF_SERIALIZATION - #endif //CBVECTOR_H diff --git a/src/basics/basics/container/examples/CbVectorPool/CMakeLists.txt b/src/basics/basics/container/examples/CbVectorPool/CMakeLists.txt deleted file mode 100644 index a5113c6e77b669fb9a1eb824915569841927f806..0000000000000000000000000000000000000000 --- a/src/basics/basics/container/examples/CbVectorPool/CMakeLists.txt +++ /dev/null @@ -1,30 +0,0 @@ -cmake_minimum_required(VERSION 2.6) - -PROJECT(CbVectorPoolTests) - -################################################################# -# MACHINE_SPECIFIC CMAKE_CONFIG_FILE -################################################################# -INCLUDE("../../../../../../../CMake/CMakeCABMacros.txt") - -################################################################# -### PACKAGES ### -################################################################# -INCLUDE(${SOURCE_ROOT}/basics/container/CMakePackage.txt) -INCLUDE(${SOURCE_ROOT}/basics/utilities/CMakePackage.txt) -INCLUDE(${SOURCE_ROOT}/basics/memory/CMakePackage.txt) -INCLUDE(${SOURCE_ROOT}/basics/objects/CMakePackage.txt) - -################################################################# -### OWN DEFINES ### -################################################################# -FILE(GLOB SPECIFIC_FILES ${SOURCE_ROOT}/basics/container/examples/CbVectorPool/*.h - ${SOURCE_ROOT}/basics/container/examples/CbVectorPool/*.cpp ) - -SET(ALL_SOURCES ${ALL_SOURCES} ${SPECIFIC_FILES}) -SOURCE_GROUP(z_specific FILES ${SPECIFIC_FILES}) - -################################################################# -### PROJECT ERSTELLEN ### -################################################################# -CREATE_CAB_PROJECT() diff --git a/src/basics/basics/container/examples/CbVectorPool/functions.h b/src/basics/basics/container/examples/CbVectorPool/functions.h deleted file mode 100644 index c9a49cdf53b8c0bb8c5885e5004968ed9e031e14..0000000000000000000000000000000000000000 --- a/src/basics/basics/container/examples/CbVectorPool/functions.h +++ /dev/null @@ -1,190 +0,0 @@ -#include <iostream> -#include <stdlib.h> -#include <stdio.h> -#include <string> -#include <fstream> - -#include <basics/utilities/UbTuple.h> - -#include <basics/utilities/UbException.h> -#include <basics/utilities/UbSystem.h> -#include <basics/utilities/UbFileOutputASCII.h> -#include <basics/utilities/UbTiming.h> - -#include <basics/memory/MbSmartPtr.h> - -#include <basics/container/CbVector.h> -#include <basics/container/CbVectorPool.h> - -using std::cout; -using std::cerr; -using std::endl; -using std::vector; - -typedef long double value_type; -typedef MbSmartPtr<CbVector< value_type > > CbVectorPtr; -typedef MbSmartPtr<vector< value_type > > StlVectorPtr; - -/*==========================================================*/ -template<typename T> -inline void setValues(vector<T>& stlvec, CbVector<T>& cbvec, CbVector<T>& cbpoolvec) -{ - if(stlvec.size() != cbvec.size() || stlvec.size() != cbpoolvec.size() ) - { - cerr<<"sizes:"<<endl; - cerr<<"stlvec... = "<<(int)stlvec.size()<<endl; - cerr<<"cbvec.... = "<<(int)cbvec.size()<<endl; - cerr<<"cbpoolvec = "<<(int)cbpoolvec.size()<<endl; - throw UB_THROW( UbException("setValues - sizeCheck failed") ); - } - static value_type stlVal = 1; - static value_type cbVal = 1; - static value_type cbPoolVal = 1; - - for(size_t i=0; i<cbvec.size(); i++) stlvec[i] = stlVal ++; - for(size_t i=0; i<cbvec.size(); i++) cbvec[i] = cbVal ++; - for(size_t i=0; i<cbvec.size(); i++) cbpoolvec[i] = cbPoolVal++; -} -/*==========================================================*/ -template<typename T> -inline void setValues(vector< StlVectorPtr >& stlvecs, vector< CbVectorPtr >& cbvecs, vector< CbVectorPtr >& cbpoolvecs) -{ - if(stlvecs.size() != cbvecs.size() || stlvecs.size() != cbpoolvecs.size() ) - { - cerr<<"sizes:"<<endl; - cerr<<"stlvec... = "<<(int)stlvecs.size()<<endl; - cerr<<"cbvec.... = "<<(int)cbvecs.size()<<endl; - cerr<<"cbpoolvec = "<<(int)cbpoolvecs.size()<<endl; - throw UB_THROW( UbException("setValues glob - sizeCheck failed") ); - } - - for(size_t i=0; i<cbvecs.size(); i++) - setValues(*stlvecs[i],*cbvecs[i],*cbpoolvecs[i]); -} -/*==========================================================*/ -template<typename T> -inline void resize(vector<T>& stlvec, CbVector<T>& cbvec, CbVector<T>& cbpoolvec, std::size_t size, const T& val) -{ - stlvec.resize(size,val); - cbvec.resize(size,val); - cbpoolvec.resize(size,val); -} -/*==========================================================*/ -template<typename T> -inline void resize(vector< StlVectorPtr >& stlvecs, vector< CbVectorPtr >& cbvecs, vector< CbVectorPtr >& cbpoolvecs, std::size_t size, const value_type& val, bool timed=false) -{ - if(stlvecs.size() != cbvecs.size() || stlvecs.size() != cbpoolvecs.size() ) - { - cerr<<"sizes:"<<endl; - cerr<<"stlvec... = "<<(int)stlvecs.size()<<endl; - cerr<<"cbvec.... = "<<(int)cbvecs.size()<<endl; - cerr<<"cbpoolvec = "<<(int)cbpoolvecs.size()<<endl; - throw UB_THROW( UbException("resize glob - sizeCheck failed") ); - } - - if(timed) - { - UbTimer timer; - timer.start(); for(size_t i=0; i<cbvecs.size(); i++) stlvecs[i]->resize(size,val); if(timed) cout<<"stl-resize in "<<timer.stop()<<"s"<<endl; - timer.start(); for(size_t i=0; i<cbvecs.size(); i++) cbvecs[i]->resize(size,val); if(timed) cout<<"cbStd-resize in "<<timer.stop()<<"s"<<endl; - timer.start(); for(size_t i=0; i<cbvecs.size(); i++) cbpoolvecs[i]->resize(size,val); if(timed) cout<<"cbPool-resize in "<<timer.stop()<<"s"<<endl; - } - else - { - for(size_t i=0; i<cbvecs.size(); i++) - resize(*stlvecs[i],*cbvecs[i],*cbpoolvecs[i],size,val); - } -} -/*==========================================================*/ -inline void createVecs(size_t number, int size,vector< StlVectorPtr >& stlvecs, vector< CbVectorPtr >& cbvecs, vector< CbVectorPtr >& cbpoolvecs, CbVectorPool<value_type>*& pool, bool timed=false) -{ - UbTimer timer; - timer.start(); for(size_t i=0; i<number; i++) stlvecs.push_back(StlVectorPtr(new vector<value_type>(size))); if(timed) cout<<"stl-createVecs in "<<timer.stop()<<"s"<<endl; - timer.start(); for(size_t i=0; i<number; i++) cbvecs.push_back(CbVectorPtr(new CbVector<value_type>(size))); if(timed) cout<<"cbStd-createVecs in "<<timer.stop()<<"s"<<endl; - timer.start(); for(size_t i=0; i<number; i++) cbpoolvecs.push_back(CbVectorPtr(new CbVector<value_type>(size,new CbVectorAllocatorPool<value_type>(pool)))); if(timed) cout<<"cbPool-createVecs in "<<timer.stop()<<"s"<<endl; - - for(size_t i=0; i<cbvecs.size(); i++) setValues(*stlvecs.back(),*cbvecs.back(),*cbpoolvecs.back()); -} -/*==========================================================*/ -inline void createVecs(size_t number, size_t size, const value_type& val,vector< StlVectorPtr >& stlvecs, vector< CbVectorPtr >& cbvecs, vector< CbVectorPtr >& cbpoolvecs, CbVectorPool<value_type>*& pool, bool timed=false) -{ - UbTimer timer; - timer.start(); for(size_t i=0; i<number; i++) stlvecs.push_back(StlVectorPtr(new vector<value_type>(size,val))); if(timed) cout<<"stl-createVecs in "<<timer.stop()<<"s"<<endl; - timer.start(); for(size_t i=0; i<number; i++) cbvecs.push_back(CbVectorPtr(new CbVector<value_type>(size,new CbVectorAllocatorStd<value_type>(),val))); if(timed) cout<<"cbStd-createVecs in "<<timer.stop()<<"s"<<endl; - timer.start(); for(size_t i=0; i<number; i++) cbpoolvecs.push_back(CbVectorPtr(new CbVector<value_type>(size,new CbVectorAllocatorPool<value_type>(pool),val))); if(timed) cout<<"cbPool-createVecs in "<<timer.stop()<<"s"<<endl; -} -/*==========================================================*/ -template<typename T> -inline void equalCheck(vector<T>& stlvec, CbVector<T>& cbvec, CbVector<T>& cbpoolvec) -{ - if(stlvec.size() != cbvec.size() || stlvec.size() != cbpoolvec.size() ) - { - cerr<<"sizes:"<<endl; - cerr<<"stlvec... = "<<(int)stlvec.size()<<endl; - cerr<<"cbvec.... = "<<(int)cbvec.size()<<endl; - cerr<<"cbpoolvec = "<<(int)cbpoolvec.size()<<endl; - throw UB_THROW( UbException("equalCheck - sizeCheck failed") ); - } - - bool check=true; - for(size_t i=0; i<cbvec.size(); i++) - if(stlvec[i] != cbvec[i] || stlvec[i] != cbpoolvec[i] ) - check=false; - - if(!check) - { - cerr<<"\nstl - "; for(size_t i=0; i<cbvec.size(); i++) cout<<stlvec[i]<<" "; cout<<endl; - cerr<< "cbv - "; for(size_t i=0; i<cbvec.size(); i++) cout<<cbvec[i]<<" "; cout<<endl; - cerr<< "cbp - "; for(size_t i=0; i<cbvec.size(); i++) cout<<cbpoolvec[i]<<" "; cout<<endl; - throw UB_THROW( UbException("equalCheck - equalCheck failed") ); - } -} -/*==========================================================*/ -template<typename T> -void equalCheck(vector< StlVectorPtr >& stlvecs, vector< CbVectorPtr >& cbvecs, vector< CbVectorPtr >& cbpoolvecs) -{ - if(stlvecs.size() != cbvecs.size() || stlvecs.size() != cbpoolvecs.size() ) - { - cerr<<"sizes:"<<endl; - cerr<<"stlvec... = "<<(int)stlvecs.size()<<endl; - cerr<<"cbvec.... = "<<(int)cbvecs.size()<<endl; - cerr<<"cbpoolvec = "<<(int)cbpoolvecs.size()<<endl; - throw UB_THROW( UbException("equalCheck - sizeCheck failed") ); - } - - for(size_t i=0; i<cbvecs.size(); i++) - { - //cout<<"equalCheck i="<<i<<"/"<<cbvecs.size()-1; - equalCheck(*stlvecs[i],*cbvecs[i],*cbpoolvecs[i]); - //cout<<" passed"<<endl; - } -} -/*==========================================================*/ -void accessCheck(int times,vector< StlVectorPtr >& stlvecs, vector< CbVectorPtr >& cbvecs, vector< CbVectorPtr >& cbpoolvecs) -{ - UbTimer timer; - timer.start(); - for(size_t i=0; i<stlvecs.size(); i++) - { - vector<value_type>& vec = *stlvecs[i]; - for(int m=0; m<times; m++) - for(vector<value_type>::size_type k=0; k<vec.size(); k++) vec[k] = k; - } - cout<<"stl-accessCheck in "<<timer.stop()<<"s"<<endl; - timer.start(); - for(size_t i=0; i<cbvecs.size(); i++) - { - CbVector<value_type>& vec = *cbvecs[i]; - for(int m=0; m<times; m++) - for(vector<value_type>::size_type k=0; k<vec.size(); k++) vec[k] = k; - } - cout<<"cbStd-accessCheck in "<<timer.stop()<<"s"<<endl; - timer.start(); - for(size_t i=0; i<cbpoolvecs.size(); i++) - { - CbVector<value_type>& vec = *cbpoolvecs[i]; - for(int m=0; m<times; m++) - for(vector<value_type>::size_type k=0; k<vec.size(); k++) vec[k] = k; - } - cout<<"cbPool-accessCheck in "<<timer.stop()<<"s"<<endl; -} diff --git a/src/basics/basics/container/examples/CbVectorPool/main.cpp b/src/basics/basics/container/examples/CbVectorPool/main.cpp deleted file mode 100644 index ede778c94479a4c8f4aead8a1db707793333aa72..0000000000000000000000000000000000000000 --- a/src/basics/basics/container/examples/CbVectorPool/main.cpp +++ /dev/null @@ -1,277 +0,0 @@ -#include "./functions.h" - -using namespace std; - -////////////////////////////////////////////////////////////////////////// -int main(int argc, char** argv) -{ - try - { - { - CbVectorPool<float>* floatPool = new CbVectorPool<float>(0); - CbVector<float> v1,v2,v3; - CbVector<float> v0(new CbVectorAllocatorPool<float>(104,floatPool) ); - v0.resize(20); - v0[3] = 60000; - v0.resize(40); - v0[3] = 90000; - v1.setAllocator( new CbVectorAllocatorPool<float>(100,floatPool) ); - v2.setAllocator( new CbVectorAllocatorPool<float>(101,floatPool) ); - v3.setAllocator( new CbVectorAllocatorPool<float>(102,floatPool) ); - v1.resize(20, 0.0); - v1.resize(30, 0.0); - v2.resize(0); - v2.resize(40, 0.0); - v3.resize(30, 0.0); - v3.resize(50, 0.0); - - for(CbVector<float>::size_type i=v1.size()-1; i>=15; i--) - v1[i] = (CbVector<float>::value_type)i; - for(CbVector<float>::size_type i=v2.size()-1; i>=35; i--) - v2[i] = (CbVector<float>::value_type)i; - for(CbVector<float>::size_type i=v3.size()-1; i>=10; i--) - v3[i] = (CbVector<float>::value_type)i; - v1.size(); - v2.size(); - v3.size(); - for(CbVector<float>::size_type i=0; i<v1.size(); i++) v1[i]; - v1.size(); - v2.size(); - v3.size(); - for(CbVector<float>::size_type i=0; i<v2.size(); i++) v2[i]; - v1.size(); - v2.size(); - v3.size(); - for(CbVector<float>::size_type i=0; i<v3.size(); i++) v3[i]; - } - - CbVectorPool<value_type>* vectorPool = new CbVectorPool<value_type>(0); - - vector< StlVectorPtr > stlVecs; - vector< CbVectorPtr > cbVecs; - vector< CbVectorPtr > cbPoolVecs; - - cout<<"check"<<__LINE__<<endl; - createVecs(10,12,0,stlVecs,cbVecs,cbPoolVecs,vectorPool); - equalCheck(stlVecs,cbVecs,cbPoolVecs); - - cout<<"check"<<__LINE__<<endl; - resize(stlVecs,cbVecs,cbPoolVecs,0,2); - equalCheck(stlVecs,cbVecs,cbPoolVecs); - - cout<<"check"<<__LINE__<<endl; - resize(stlVecs,cbVecs,cbPoolVecs,3,3); - equalCheck(stlVecs,cbVecs,cbPoolVecs); - - cout<<"check"<<__LINE__<<endl; - setValues(stlVecs,cbVecs,cbPoolVecs); - equalCheck(stlVecs,cbVecs,cbPoolVecs); - - cout<<"check"<<__LINE__<<endl; - createVecs(8,5,stlVecs,cbVecs,cbPoolVecs,vectorPool); - equalCheck(stlVecs,cbVecs,cbPoolVecs); - - cout<<"check"<<__LINE__<<endl; - resize(stlVecs,cbVecs,cbPoolVecs,20,7); - equalCheck(stlVecs,cbVecs,cbPoolVecs); - - cout<<"check"<<__LINE__<<endl; - equalCheck(stlVecs,cbVecs,cbPoolVecs); - - cout<<"check"<<__LINE__<<endl; - setValues(stlVecs,cbVecs,cbPoolVecs); - equalCheck(stlVecs,cbVecs,cbPoolVecs); - - cout<<"check"<<__LINE__<<endl; - resize(stlVecs,cbVecs,cbPoolVecs,20,3); - equalCheck(stlVecs,cbVecs,cbPoolVecs); - - cout<<"check"<<__LINE__<<endl; - setValues(stlVecs,cbVecs,cbPoolVecs); - equalCheck(stlVecs,cbVecs,cbPoolVecs); - - cout<<"check"<<__LINE__<<endl; - resize(stlVecs,cbVecs,cbPoolVecs,0,7); - equalCheck(stlVecs,cbVecs,cbPoolVecs); - - cout<<"check"<<__LINE__<<endl; - setValues(stlVecs,cbVecs,cbPoolVecs); - equalCheck(stlVecs,cbVecs,cbPoolVecs); - - cout<<"check"<<__LINE__<<endl; - resize(stlVecs,cbVecs,cbPoolVecs,20,3); - equalCheck(stlVecs,cbVecs,cbPoolVecs); - - cout<<"check"<<__LINE__<<endl; - setValues(stlVecs,cbVecs,cbPoolVecs); - equalCheck(stlVecs,cbVecs,cbPoolVecs); - - cout<<"check"<<__LINE__<<endl; - createVecs(4,3,stlVecs,cbVecs,cbPoolVecs,vectorPool); - equalCheck(stlVecs,cbVecs,cbPoolVecs); - - cout<<"check"<<__LINE__<<endl; - resize(stlVecs,cbVecs,cbPoolVecs,20,3); - equalCheck(stlVecs,cbVecs,cbPoolVecs); - - cout<<"check"<<__LINE__<<endl; - setValues(stlVecs,cbVecs,cbPoolVecs); - equalCheck(stlVecs,cbVecs,cbPoolVecs); - - cout<<"check"<<__LINE__<<endl; - resize(stlVecs,cbVecs,cbPoolVecs,0,7); - equalCheck(stlVecs,cbVecs,cbPoolVecs); - - cout<<"check"<<__LINE__<<endl; - setValues(stlVecs,cbVecs,cbPoolVecs); - equalCheck(stlVecs,cbVecs,cbPoolVecs); - - cout<<"check"<<__LINE__<<endl; - resize(stlVecs,cbVecs,cbPoolVecs,20,3); - equalCheck(stlVecs,cbVecs,cbPoolVecs); - - cout<<"check"<<__LINE__<<endl; - //dealloc check - stlVecs.resize(5); - cbVecs.resize(5); - cbPoolVecs.resize(5); - - cout<<"check"<<__LINE__<<endl; - createVecs(4,3,stlVecs,cbVecs,cbPoolVecs,vectorPool); - equalCheck(stlVecs,cbVecs,cbPoolVecs); - - cout<<"check"<<__LINE__<<endl; - setValues(stlVecs,cbVecs,cbPoolVecs); - equalCheck(stlVecs,cbVecs,cbPoolVecs); - - cout<<"check"<<__LINE__<<endl; - createVecs(4,3,stlVecs,cbVecs,cbPoolVecs,vectorPool); - equalCheck(stlVecs,cbVecs,cbPoolVecs); - - - //operator= check - CbVector<value_type> testPool1(10, new CbVectorAllocatorPool<value_type>(vectorPool)); - CbVector<value_type> testPool2(1 , new CbVectorAllocatorPool<value_type>(vectorPool)); - CbVector<value_type> testPool3(8 , new CbVectorAllocatorPool<value_type>(vectorPool)); - CbVector<value_type> testPool4(8 , new CbVectorAllocatorPool<value_type>(vectorPool)); - CbVector<value_type> testStd1(10); - - for(CbVector<value_type>::size_type i=0; i<testStd1.size(); i++ ) - testStd1[i] = (value_type)i*10; - - testPool1 = testStd1; - testPool4 = testStd1; - testPool3 = testPool4; - testPool2 = testPool3; - - for(CbVector<value_type>::size_type i=0; i<testStd1.size(); i++ ) - cout<<testStd1[i]<<" "; cout<<endl; - for(CbVector<value_type>::size_type i=0; i<testPool1.size(); i++ ) - cout<<testPool1[i]<<" "; cout<<endl; - for(CbVector<value_type>::size_type i=0; i<testPool2.size(); i++ ) - cout<<testPool2[i]<<" "; cout<<endl; - for(CbVector<value_type>::size_type i=0; i<testPool3.size(); i++ ) - cout<<testPool3[i]<<" "; cout<<endl; - for(CbVector<value_type>::size_type i=0; i<testPool4.size(); i++ ) - cout<<testPool4[i]<<" "; cout<<endl; - ///end - - - cout<<"//////////////////////////////////////////////////////////////////////////"<<endl; - cout<<"// access test - start"<<endl; - cout<<"//////////////////////////////////////////////////////////////////////////"<<endl; - cout<<"check"<<__LINE__<<endl; - createVecs(1000,1000,stlVecs,cbVecs,cbPoolVecs,vectorPool,true); - - CbVectorPool<value_type>* pool2 = new CbVectorPool<value_type>(1); - vector< StlVectorPtr > stlVecs2; - vector< CbVectorPtr > cbVecs2; - vector< CbVectorPtr > cbPoolVecs2; - createVecs(1000,1000,stlVecs2,cbVecs2,cbPoolVecs2,pool2,true); - - cout<<"access check\n"; - //accessCheck(1000,stlVecs,cbVecs,cbPoolVecs); - - cout<<"check"<<__LINE__<<endl; - setValues(stlVecs,cbVecs,cbPoolVecs); - equalCheck(stlVecs,cbVecs,cbPoolVecs); - - cout<<"check"<<__LINE__<<endl; - resize(stlVecs,cbVecs,cbPoolVecs,120,3,true); - equalCheck(stlVecs,cbVecs,cbPoolVecs); - - cout<<"//////////////////////////////////////////////////////////////////////////"<<endl; - cout<<"// access test - end"<<endl; - cout<<"//////////////////////////////////////////////////////////////////////////"<<endl; - - cout<<"//////////////////////////////////////////////////////////////////////////"<<endl; - cout<<"// EXCEPTION TEST - start"<<endl; - cout<<"//////////////////////////////////////////////////////////////////////////"<<endl; - delete vectorPool; - vectorPool = NULL; - try - { - resize(stlVecs,cbVecs,cbPoolVecs,20,3); - } - catch(UbException& e) - { - cout<<"if exception tells something about \"vectorPool==NULL\" -> test successfully passed:"<<endl; - cout<<e<<endl; - } - cout<<"//////////////////////////////////////////////////////////////////////////"<<endl; - cout<<"// EXCEPTION TEST - end"<<endl; - cout<<"//////////////////////////////////////////////////////////////////////////"<<endl; - - cout<<"\n\n\nALL TESTS PASSED\n"; - } - catch(UbException& e) - { - std::cerr<<e<<std::endl; - } - catch(const std::exception &e) - { - std::cerr << "Caught exception:\n"; - std::cerr << "Type: " << typeid(e).name() << "\n"; - std::cerr << "What: " << e.what() << "\n"; - } - catch(...) - { - std::cerr<<" ** Verdammte Scheisse - mal wieder Mist gebaut! **"<<endl; - } - return 0; -} - -// #include <functional> -// #include <iostream> -// #include <vector> -// #include <algorithm> -// #include <typeinfo> -// -// struct bar -// { -// bar() -// : data(0) -// {} -// -// void foo(const std::size_t value) { std::cout << "data = " << value << " (old: " << data << ");" << std::endl; data = value; } -// -// private: -// std::size_t data; -// }; -// -// int main() -// { -// std::vector<bar> data(10); -// -// /* operator[] => Indexoperator */ -// for (std::size_t i(0); i < data.size(); ++i) -// data[i].foo(2); -// -// /* begin(), end() => Iterator */ -// const std::vector<bar>::iterator it_end(data.end()); -// for (std::vector<bar>::iterator it(data.begin()); it != it_end; ++it) -// it->foo(3); -// -// /* for_each => Algorithm | Iterator */ -// std::for_each(data.begin(), data.end(), std::bind2nd(std::mem_fun_ref(&bar::foo), 2)); -// } diff --git a/src/basics/basics/container/package.include b/src/basics/basics/container/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/basics/basics/memory/MbChessMemPool2D.h b/src/basics/basics/memory/MbChessMemPool2D.h deleted file mode 100644 index 3ae46d2a52a8271bda3534fa26eaf477d05967a9..0000000000000000000000000000000000000000 --- a/src/basics/basics/memory/MbChessMemPool2D.h +++ /dev/null @@ -1,519 +0,0 @@ -// _ ___ __ __________ _ __ -// | | / (_)____/ /___ ______ _/ / ____/ /_ __(_)___/ /____ -// | | / / / ___/ __/ / / / __ `/ / /_ / / / / / / __ / ___/ -// | |/ / / / / /_/ /_/ / /_/ / / __/ / / /_/ / / /_/ (__ ) -// |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/ -// -#ifndef MBCHESSMEMPOOL2D_H -#define MBCHESSMEMPOOL2D_H - -#include <map> -#include <vector> -#include <iostream> -#include <iomanip> -#include <string> -#include <sstream> -#include <fstream> -#include <cmath> -#include <typeinfo> - -#include <basics/utilities/UbException.h> - - -template <class TData, std::size_t cachSize> -class MbChessMemPool2D; - -////////////////////////////////////////////////////////////////////////// -//class MbChessMap2DKey -//key zum Auffinden der ChessMem2DBlocks -class MbChessMap2DKey -{ -public: - ////////////////////////////////////////////////////////////////////////// - //Konstruktoren - MbChessMap2DKey(): mVectorPos(0),mFirstCriteria(0),mSecondCriteria(0) - { - - } - /*==========================================================*/ - MbChessMap2DKey(std::size_t vectorPos, std::size_t firstCriteria, std::size_t secondCriteria) - : mVectorPos(vectorPos), mFirstCriteria(firstCriteria), mSecondCriteria(secondCriteria) - { - } - /*==========================================================*/ - MbChessMap2DKey& operator=(const MbChessMap2DKey& srcKey) - { - if(this == &srcKey ) return *this; - - mVectorPos = srcKey.mVectorPos; - mFirstCriteria = srcKey.mFirstCriteria; - mSecondCriteria = srcKey.mSecondCriteria; - - return *this; - } - - ////////////////////////////////////////////////////////////////////////// - //global ueberladene Operatoren - friend inline bool operator<(const MbChessMap2DKey& lhsKey,const MbChessMap2DKey& rhsKey) - { - if(lhsKey.mFirstCriteria < rhsKey.mFirstCriteria ) return true; - if(lhsKey.mFirstCriteria > rhsKey.mFirstCriteria ) return false; - if(lhsKey.mSecondCriteria < rhsKey.mSecondCriteria) return true; - - return false; - } - /*==========================================================*/ - friend inline bool operator==(const MbChessMap2DKey& lhsKey,const MbChessMap2DKey& rhsKey) - { - if(lhsKey.mVectorPos != rhsKey.mVectorPos ) return false; - if(lhsKey.mFirstCriteria != rhsKey.mFirstCriteria ) return false; - if(lhsKey.mSecondCriteria != rhsKey.mSecondCriteria ) return false; - - return true; - } - //ueberladene Operatoren - friend inline bool operator!=(const MbChessMap2DKey& lhsKey,const MbChessMap2DKey& rhsKey) - { - return !(lhsKey==rhsKey); - } - //ueberladene Operatoren - /*==========================================================*/ - friend inline std::ostream& operator << (std::ostream& os, const MbChessMap2DKey& key) - { - os<<"VectorPos,first-,second-,third Criteria) ("; - os<<key.mVectorPos<<","<<key.mFirstCriteria<<","<<key.mSecondCriteria<<")"; - return os; - } - - ////////////////////////////////////////////////////////////////////////// - //public Methoden - std::size_t getVectorPos() {return mVectorPos;} -private: - ////////////////////////////////////////////////////////////////////////// - //private Member - std::size_t mVectorPos; - std::size_t mFirstCriteria; - std::size_t mSecondCriteria; -}; - - - -template<class T,std::size_t cachSize> -class MbChessMem2DBlock -{ - friend class MbChessMemPool2D<T,cachSize>; -public: - ////////////////////////////////////////////////////////////////////////// - //Konstruktoren - MbChessMem2DBlock() - { - mUsedElements = 0; - std::size_t arrayLength = mBlockWidth*mBlockWidth; - //mDataElements = new T[arrayLength]; - mDataElements = operator new(arrayLength*sizeof(T)); - mFlagVector = new bool[arrayLength]; - for(std::size_t i=0;i<arrayLength;i++) mFlagVector[i] = false; - } - ////////////////////////////////////////////////////////////////////////// - //Destruktor - ~MbChessMem2DBlock() - { - //if(mDataElements) delete[] mDataElements; - if(mDataElements) operator delete(mDataElements); - if(mFlagVector) delete[] mFlagVector; - } - -private: - ////////////////////////////////////////////////////////////////////////// - //private Methoden - void* getReference(std::size_t chessX1, std::size_t chessX2) - { - std::size_t arrayIndex = chessX2*mBlockWidth + chessX1; - #ifdef _DEBUG - if(arrayIndex>=mBlockWidth*mBlockWidth) UB_THROW( UbException(UB_EXARGS,"index out of range") ); - #endif - - if(mFlagVector[arrayIndex]==true) UB_THROW( UbException(UB_EXARGS,"memory already allocated!") ); - - mUsedElements++; - mFlagVector[arrayIndex]=true; - - return (void*)((T*)(mDataElements)+arrayIndex);//&(mDataElements[arrayIndex]); - } - /*==========================================================*/ - std::size_t freeReference(void* p) - { - //std::size_t arrayIndex = static_cast<std::size_t>(static_cast<T*>(p) - mDataElements); //mDataElements = &mDataElements[0] - std::size_t arrayIndex = static_cast<std::size_t>(static_cast<T*>(p) - static_cast<T*>(mDataElements)); - - #ifdef _DEBUG - if(arrayIndex>=mBlockWidth*mBlockWidth) UB_THROW( UbException(UB_EXARGS,"index out of range") ); - #endif - - if(mFlagVector[arrayIndex]==false) UB_THROW( UbException(UB_EXARGS,"memory not allocated!") ); - - mFlagVector[arrayIndex]=false; - - return --mUsedElements; - } - /*==========================================================*/ - std::size_t getNofUsedElements() { return mUsedElements; } - /*==========================================================*/ - void addPointerToTElementsToVector(std::vector<T*>& tdataVector) - { - std::size_t arrayLength = mBlockWidth*mBlockWidth; - for(std::size_t arrayIndex=0;arrayIndex<arrayLength;arrayIndex++) - { - //if(mFlagVector[arrayIndex]) tdataVector.push_back(&mDataElements[arrayIndex]); - if(mFlagVector[arrayIndex]) tdataVector.push_back(static_cast<T*>(mDataElements)+arrayIndex); - } - } - /*==========================================================*/ - template<typename Pred> - void addPointerToTElementsToVector(std::vector<T*>& tdataVector, Pred& pred) - { - std::size_t arrayLength = mBlockWidth*mBlockWidth; - T* tmp; - for(std::size_t arrayIndex=0;arrayIndex<arrayLength;arrayIndex++) - { - if(mFlagVector[arrayIndex]) - { - //tmp = &mDataElements[arrayIndex]; - tmp = (static_cast<T*>(mDataElements))+arrayIndex; - if( pred(*tmp) ) tdataVector.push_back(tmp); - } - } - } -private: - ////////////////////////////////////////////////////////////////////////// - //static Member - static const std::size_t mBlockWidth; - - ////////////////////////////////////////////////////////////////////////// - //private Member - std::size_t mUsedElements; - //T* mDataElements; - void* mDataElements; - bool* mFlagVector; - -}; - -////////////////////////////////////////////////////////////////////////// -//class MbChessMemPool2D -//zum Verwalten von TData Elementen in einer Schabrett-artigen Struktur -//die ChessMemBloecke haben hier eine Groesse von ~cachSize -template <class TData, std::size_t cachSize> -class MbChessMemPool2D -{ -private: - ////////////////////////////////////////////////////////////////////////// - //protected static const Member - const static std::size_t mCacheSize; - - ////////////////////////////////////////////////////////////////////////// - //protected Member - static std::vector< std::map< MbChessMap2DKey , MbChessMem2DBlock< TData,cachSize >* > > mMapVector; - static std::map< void*, MbChessMap2DKey > mPointerKeyMap; - - ////////////////////////////////////////////////////////////////////////// - //protected Konstrukoren - MbChessMemPool2D() //protected, um max einmal vererbt werden zu koennen!!! - { //zudem kann man so keine elmente von TreeBasedMemPool erstellen - - } - ////////////////////////////////////////////////////////////////////////// - //Destruktor - ~MbChessMemPool2D() - { - } - -public: - - ////////////////////////////////////////////////////////////////////////// - //static public Methoden - static void* getReference(std::size_t level, std::size_t ix1, std::size_t ix2) - { - if(!MbChessMem2DBlock< TData,cachSize >::mBlockWidth) - { - std::stringstream ss; - ss<<"TreeBasedMemPool() - InitialisationError\n"; - ss<<"\t size of StorageData ("<<typeid(TData).name()<<", "<<sizeof(TData)<<" byte)\n"; - ss<<"\t exceeds user-specifyed cache-zize ("<<mCacheSize<<" byte)\n"; - ss<<"\t cache-size has to be larger than data-size"; - UB_THROW( UbException(ss.str()) ); - } - - if( mMapVector.size()<=level ) mMapVector.resize(level+1); - - std::size_t chessX1 = ix1/(MbChessMem2DBlock<TData,cachSize>::mBlockWidth); - std::size_t chessX2 = ix2/(MbChessMem2DBlock<TData,cachSize>::mBlockWidth); - - MbChessMap2DKey mapKey(level,chessX1,chessX2); - - typename std::map<MbChessMap2DKey,MbChessMem2DBlock<TData,cachSize>* >::iterator pos = mMapVector[level].find(mapKey); - - MbChessMem2DBlock<TData,cachSize>* memBlock = NULL; - - if(pos==mMapVector[level].end()) - { - memBlock = new MbChessMem2DBlock<TData,cachSize>; - (mMapVector[level])[mapKey] = memBlock; - } - else memBlock = pos->second; - - std::size_t internalChessX1 = ix1%(MbChessMem2DBlock<TData,cachSize>::mBlockWidth); - std::size_t internalChessX2 = ix2%(MbChessMem2DBlock<TData,cachSize>::mBlockWidth); - - void* p = memBlock->getReference(internalChessX1,internalChessX2); - - mPointerKeyMap[p]=mapKey; - - return p; - } - /*==========================================================*/ - static void freeReference(void *p) - { - typename std::map<void*,MbChessMap2DKey>::iterator posPointerKeyMap = mPointerKeyMap.find(p); - - if(posPointerKeyMap==mPointerKeyMap.end()) UB_THROW( UbException(UB_EXARGS,"pointer not in map") ); - - MbChessMap2DKey mapKey = posPointerKeyMap->second; - mPointerKeyMap.erase(posPointerKeyMap); - - typename std::map<MbChessMap2DKey,MbChessMem2DBlock<TData,cachSize>* >::iterator posMemBlockMap; - posMemBlockMap = mMapVector[mapKey.getVectorPos()].find(mapKey); - - if(posMemBlockMap == mMapVector[mapKey.getVectorPos()].end()) - UB_THROW( UbException(UB_EXARGS,"mapKey not in ChessMem2DBlockMap") ); - - std::size_t leftElements = posMemBlockMap->second->freeReference(p); - if(!leftElements) - { - MbChessMem2DBlock<TData,cachSize>* tmp = posMemBlockMap->second; - mMapVector[mapKey.getVectorPos()].erase(posMemBlockMap); - delete tmp; - } - } - /*==========================================================*/ - static void fillVectorWithPointerToTDataElements(std::size_t level,std::vector<TData*>& tdataVector) - { - tdataVector.clear(); - - if(level>=mMapVector.size()) return; - typename std::map<MbChessMap2DKey,MbChessMem2DBlock<TData,cachSize>* >::iterator pos; - for(pos=mMapVector[level].begin();pos!=mMapVector[level].end();++pos) - { - pos->second->addPointerToTElementsToVector(tdataVector); - } - } - /*==========================================================*/ - static void fillVectorWithPointerToTDataElements(std::vector<TData*>& tdataVector) - { - tdataVector.clear(); - - typename std::map<MbChessMap2DKey,MbChessMem2DBlock<TData,cachSize>* >::iterator pos; - - for(std::size_t vecIndex=0; vecIndex<mMapVector.size(); vecIndex++ ) - { - for(pos=mMapVector[vecIndex].begin();pos!=mMapVector[vecIndex].end();++pos) - { - pos->second->addPointerToTElementsToVector(tdataVector); - } - } - } - /*==========================================================*/ - template<typename Pred> - static void fillVectorWithPointerToTDataElements(std::size_t level,std::vector<TData*>& tdataVector, Pred pred) - { - tdataVector.clear(); - - if(level>=mMapVector.size()) return; - typename std::map<MbChessMap2DKey,MbChessMem2DBlock<TData,cachSize>* >::iterator pos; - for(pos=mMapVector[level].begin();pos!=mMapVector[level].end();++pos) - { - pos->second->addPointerToTElementsToVector(tdataVector,pred); - } - } - /*==========================================================*/ - template<typename Pred> - static void fillVectorWithPointerToTDataElements(std::vector<TData*>& tdataVector, Pred pred) - { - tdataVector.clear(); - - typename std::map<MbChessMap2DKey,MbChessMem2DBlock<TData,cachSize>* >::iterator pos; - - for(std::size_t vecIndex=0; vecIndex<mMapVector.size(); vecIndex++ ) - { - for(pos=mMapVector[vecIndex].begin();pos!=mMapVector[vecIndex].end();++pos) - { - pos->second->addPointerToTElementsToVector(tdataVector,pred); - } - } - } - /*==========================================================*/ - static std::size_t getNumberOfChessMemoryBlocks() - { - std::size_t nofElements = 0; - for(std::size_t i=0; i<mMapVector.size(); i++) - { - nofElements+=mMapVector[i].size(); - } - return nofElements; - } - /*==========================================================*/ - static std::size_t getNumberOfChessMemoryBlocks(std::size_t level) - { - if(level<mMapVector.size() )return mMapVector[level].size(); - return 0; - } - /*==========================================================*/ - static std::size_t getNumberOfStoredDataElements() - { - return mPointerKeyMap.size(); - } - /*==========================================================*/ - static std::size_t getNumberOfStoredDataElements(std::size_t level) - { - if(level<mMapVector.size() ) - { - std::size_t nofElements = 0; - typename std::map< MbChessMap2DKey , MbChessMem2DBlock< TData,cachSize >* >::iterator pos; - - for(pos=mMapVector[level].begin(); pos!=mMapVector[level].end(); ++pos) - { - nofElements += pos->second->getNofUsedElements(); - } - return nofElements; - } - return 0; - - } - /*==========================================================*/ - static std::string toString() - { - long double capaticityPerBlock = (std::size_t)pow((double)MbChessMem2DBlock<TData,cachSize>::mBlockWidth,2.0); - std::size_t storedElements = MbChessMemPool2D<TData,cachSize>::getNumberOfStoredDataElements(); - std::size_t initialisedMemBlocks = MbChessMemPool2D<TData,cachSize>::getNumberOfChessMemoryBlocks(); - - std::stringstream ss; - ss<<std::endl; - ss<<"****************** MbChessMemPool2D-Info (BEGIN) ******************"<<std::endl; - ss<<"type of Storage-Data.................. : "<<typeid(TData).name()<<std::endl; - ss<<"size of Storage-Data........... [bytes]: "<<sizeof(TData)<<std::endl; - ss<<"specified cache-size........... [bytes]: "<<mCacheSize<<std::endl; - ss<<"#elements per MbChessMem2DBlock [bytes]: "<<capaticityPerBlock<<std::endl; - ss<<"mem per MbChessMem2DBlock...... [bytes]: "<<capaticityPerBlock*sizeof(TData)<<std::endl; - ss<<"used cache-size[%]............. [bytes]: "<<capaticityPerBlock*sizeof(TData)/(double)mCacheSize*100<<std::endl; - ss<<"\n"; - ss<<"#stored Elements = "<<storedElements<<std::endl; - ss<<"#ChessMem2DBlocks = "<<initialisedMemBlocks<<std::endl; - ss<<std::endl; - ss<<"level | #ChessMem2DBlocks | #stored Elements | used capaticity [%] \n"; - ss<<"----------------------------------------------------------------\n"; - for(std::size_t level=0;level<mMapVector.size();level++) - { - std::size_t nofStoredElements = MbChessMemPool2D<TData,cachSize>::getNumberOfStoredDataElements(level); - std::size_t nofChessMem2DBlocks = MbChessMemPool2D<TData,cachSize>::getNumberOfChessMemoryBlocks(level); - - ss<<std::left<<" "<<std::setw(5)<<level<<"| " - <<std::setw(16)<<nofChessMem2DBlocks<<"| " - <<std::setw(17)<<nofStoredElements<<"| "; - if(nofStoredElements) - ss<<setw(15)<<nofStoredElements/(double)(capaticityPerBlock*nofChessMem2DBlocks)*100<<std::endl; - else ss<<"-"<<std::endl; - } - ss<<std::endl; - ss<<"called memory..... [bytes]: "<<storedElements*sizeof(TData)<<std::endl; - ss<<"initialised memory [bytes]: "<<initialisedMemBlocks*capaticityPerBlock*sizeof(TData)<<std::endl; - double denominator = (double)(initialisedMemBlocks*capaticityPerBlock*sizeof(TData)); - if(fabs(denominator)>1.E-13) ss<<"used.............. [%] : "<<100.*storedElements*sizeof(TData)/denominator<<std::endl; - else ss<<"used.............. [%] : 0.0"<<std::endl; - ss<<"****************** MbChessMemPool2D-Info (END) *******************"<<std::endl; - return ss.str(); - } - /*==========================================================*/ - static void writeStatisticFiles(const std::string& filename) - { - //liefert Statistik ueber aufuellung der einzelnen bloecke (gesamt und pro level) - //x-Achse: 0... max moegliche Anzahl von moeglichen Elementen pro MemBlock - //y-Achse: Anzahl an Bloecken, die die Anzahl an Elementen beinhalten - std::ofstream spreadingFile(((std::string)(filename+"_spreading.txt")).c_str()); - if(!spreadingFile) UB_THROW( UbException(UB_EXARGS,"couldn't open file") ); - - std::size_t initialisedMemBlocks = MbChessMemPool2D<TData,cachSize>::getNumberOfChessMemoryBlocks(); - std::size_t maxNofDataElementsPerBlock = MbChessMem2DBlock<TData,cachSize>::mBlockWidth - * MbChessMem2DBlock<TData,cachSize>::mBlockWidth - * MbChessMem2DBlock<TData,cachSize>::mBlockWidth; - std::vector<std::size_t> spreading; - spreading.resize(maxNofDataElementsPerBlock+1,0); - std::vector< std::vector<std::size_t> > spreadingPerLevel; - spreadingPerLevel.resize(mMapVector.size()); - - typename std::map<MbChessMap2DKey,MbChessMem2DBlock<TData,cachSize>* >::iterator pos; - - for(std::size_t level=0; level<mMapVector.size(); level++ ) - { - spreadingPerLevel[level].resize(maxNofDataElementsPerBlock+1,0); - for(pos=mMapVector[level].begin();pos!=mMapVector[level].end();++pos) - { - std::size_t number = pos->second->getNofUsedElements(); - spreading[number]++; - spreadingPerLevel[level][number]++; - } - } - spreadingFile<<"#BlockUsage nofBlocks(all Level) "; - for(std::size_t level=0; level<mMapVector.size(); level++ ) - spreadingFile<<"nofBlockLevel"<<level<<" "; - spreadingFile<<std::endl; - - for(std::size_t i=0; i<spreading.size(); i++) - { - spreadingFile<<i<<" "<<spreading[i]; - for(std::size_t level=0; level<mMapVector.size(); level++ ) - spreadingFile<<" "<<spreadingPerLevel[level][i]; - spreadingFile<<std::endl; - } - spreadingFile.flush(); - spreadingFile.close(); - } - ////////////////////////////////////////////////////////////////////////// - //ueberladene operatoren - void* operator new(size_t size, std::size_t level, std::size_t ix1, std::size_t ix2) - { - if(level<0) UB_THROW( UbException(UB_EXARGS,"level ist negativ!") ); - void *p = getReference(level,ix1,ix2); - return p; - } - /*==========================================================*/ - void operator delete(void* p, std::size_t level, std::size_t ix1, std::size_t ix2) - { - //ACHTUNG: wenn man hier ne Exception schmeisst, dann gibts einen BoeSEN compilerFehler!!! - //UB_THROW( UbException(UB_EXARGS,"Scheisse noch nicht gerafft, wie das geht!") ); - std::cerr<<"MbChessMemPool2D::delete(void* p, std::size_t level, std::size_t ix1, std::size_t ix2) - Scheisse noch nicht gerafft, wie das geht!\n"; - } - - /*==========================================================*/ - void operator delete(void* p) - { - freeReference(p); - } - -private: - ////////////////////////////////////////////////////////////////////////// - //private statische Methoden -}; - -//statische Variablen initialisieren -template <class TData, std::size_t cachSize> -std::vector< std::map<MbChessMap2DKey,MbChessMem2DBlock<TData,cachSize>* > > MbChessMemPool2D<TData,cachSize>::mMapVector; - -template <class TData, std::size_t cachSize> -std::map<void*,MbChessMap2DKey > MbChessMemPool2D< TData, cachSize>::mPointerKeyMap; - -template <class TData, std::size_t cachSize> -const std::size_t MbChessMemPool2D<TData,cachSize>::mCacheSize=cachSize; - -template <class TData,std::size_t cachSize> -const std::size_t MbChessMem2DBlock<TData,cachSize>::mBlockWidth=static_cast<std::size_t>(pow(static_cast<double>(static_cast<std::size_t>(cachSize/sizeof(TData))),1./3.)); - -#endif diff --git a/src/basics/basics/memory/MbChessMemPool3D.h b/src/basics/basics/memory/MbChessMemPool3D.h deleted file mode 100644 index ffc74a8d6d39cffa4b7c23c73dafda1597d9fffe..0000000000000000000000000000000000000000 --- a/src/basics/basics/memory/MbChessMemPool3D.h +++ /dev/null @@ -1,537 +0,0 @@ -// _ ___ __ __________ _ __ -// | | / (_)____/ /___ ______ _/ / ____/ /_ __(_)___/ /____ -// | | / / / ___/ __/ / / / __ `/ / /_ / / / / / / __ / ___/ -// | |/ / / / / /_/ /_/ / /_/ / / __/ / / /_/ / / /_/ (__ ) -// |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/ -// -#ifndef MBCHESSMEMPOOL3D_H -#define MBCHESSMEMPOOL3D_H - -#include <map> -#include <vector> -#include <iostream> -#include <iomanip> -#include <string> -#include <sstream> -#include <fstream> -#include <cmath> - -#include <basics/utilities/UbException.h> - -template <class TData, std::size_t cachSize> -class MbChessMemPool3D; - -////////////////////////////////////////////////////////////////////////// -//class MbChessMap3DKey -//key zum Auffinden der ChessMem3DBlocks -class MbChessMap3DKey -{ -public: - ////////////////////////////////////////////////////////////////////////// - //Konstruktoren - MbChessMap3DKey(): mVectorPos(0),mFirstCriteria(0),mSecondCriteria(0),mThirdCriteria(0) - { - } - /*==========================================================*/ - MbChessMap3DKey(std::size_t vectorPos,std::size_t firstCriteria,std::size_t secondCriteria,std::size_t thirdCriteria) - : mVectorPos(vectorPos), mFirstCriteria(firstCriteria), mSecondCriteria(secondCriteria), mThirdCriteria(thirdCriteria) - { - } - /*==========================================================*/ - MbChessMap3DKey& operator=(const MbChessMap3DKey& srcKey) - { - if(this == &srcKey ) return *this; - - mVectorPos = srcKey.mVectorPos; - mFirstCriteria = srcKey.mFirstCriteria; - mSecondCriteria = srcKey.mSecondCriteria; - mThirdCriteria = srcKey.mThirdCriteria; - - return *this; - } - - ////////////////////////////////////////////////////////////////////////// - //global ueberladene Operatoren - friend inline bool operator<(const MbChessMap3DKey& lhsKey,const MbChessMap3DKey& rhsKey) - { - if(lhsKey.mFirstCriteria < rhsKey.mFirstCriteria ) return true; - if(lhsKey.mFirstCriteria > rhsKey.mFirstCriteria ) return false; - if(lhsKey.mSecondCriteria < rhsKey.mSecondCriteria) return true; - if(lhsKey.mSecondCriteria > rhsKey.mSecondCriteria) return false; - if(lhsKey.mThirdCriteria < rhsKey.mThirdCriteria ) return true; - - return false; - } - /*==========================================================*/ - friend inline bool operator==(const MbChessMap3DKey& lhsKey,const MbChessMap3DKey& rhsKey) - { - if(lhsKey.mVectorPos != rhsKey.mVectorPos ) return false; - if(lhsKey.mFirstCriteria != rhsKey.mFirstCriteria ) return false; - if(lhsKey.mSecondCriteria != rhsKey.mSecondCriteria ) return false; - if(lhsKey.mThirdCriteria != rhsKey.mThirdCriteria ) return false; - - return true; - } - //ueberladene Operatoren - friend inline bool operator!=(const MbChessMap3DKey& lhsKey,const MbChessMap3DKey& rhsKey) - { - return !(lhsKey==rhsKey); - } - //ueberladene Operatoren - /*==========================================================*/ - friend inline std::ostream& operator << (std::ostream& os, const MbChessMap3DKey& key) - { - os<<"VectorPos,first-,second-,third Criteria) ("; - os<<key.mVectorPos<<","<<key.mFirstCriteria<<","<<key.mSecondCriteria<<","<<key.mThirdCriteria<<")"; - return os; - } - - ////////////////////////////////////////////////////////////////////////// - //public Methoden - std::size_t getVectorPos() {return mVectorPos;} -private: - ////////////////////////////////////////////////////////////////////////// - //private Member - std::size_t mVectorPos; - std::size_t mFirstCriteria; - std::size_t mSecondCriteria; - std::size_t mThirdCriteria; -}; - - - -template<class T,std::size_t cachSize> -class MbChessMem3DBlock -{ - friend class MbChessMemPool3D<T,cachSize>; -public: - ////////////////////////////////////////////////////////////////////////// - //Konstruktoren - MbChessMem3DBlock() - { - mUsedElements = 0; - std::size_t arrayLength = mBlockWidth*mBlockWidth*mBlockWidth; - //mDataElements = new T[arrayLength]; - mDataElements = operator new(arrayLength*sizeof(T)); - if(!mDataElements) UB_THROW( UbException(UB_EXARGS,"out of memeory!") ); - mFlagVector = new bool[arrayLength]; - if(!mFlagVector) UB_THROW( UbException(UB_EXARGS,"out of memeory!") ); - for(std::size_t i=0;i<arrayLength;i++) mFlagVector[i] = false; - } - ////////////////////////////////////////////////////////////////////////// - //Destruktor - ~MbChessMem3DBlock() - { - //if(mDataElements) delete[] mDataElements; - if(mDataElements) operator delete(mDataElements); - if(mFlagVector) delete[] mFlagVector; - } - -private: - ////////////////////////////////////////////////////////////////////////// - //private Methoden - void* getReference(std::size_t chessX1, std::size_t chessX2, std::size_t chessX3) - { - //std::size_t arrayIndex = (chessX1*mBlockWidth+chessX2)*mBlockWidth + chessX3; - std::size_t arrayIndex = (chessX3*mBlockWidth+chessX2)*mBlockWidth + chessX1; - #ifdef _DEBUG - if(arrayIndex>=mBlockWidth*mBlockWidth*mBlockWidth) UB_THROW( UbException(UB_EXARGS,"index out of range") ); - #endif - - if(mFlagVector[arrayIndex]==true) UB_THROW( UbException(UB_EXARGS,"memory already allocated!") ); - - mUsedElements++; - mFlagVector[arrayIndex]=true; - - return (void*)((T*)(mDataElements)+arrayIndex);//&(mDataElements[arrayIndex]); - } - /*==========================================================*/ - std::size_t freeReference(void* p) - { - //std::size_t arrayIndex = static_cast<std::size_t>(static_cast<T*>(p) - mDataElements); //mDataElements = &mDataElements[0] - std::size_t arrayIndex = static_cast<std::size_t>(static_cast<T*>(p) - static_cast<T*>(mDataElements)); - - #ifdef _DEBUG - if(arrayIndex>=mBlockWidth*mBlockWidth*mBlockWidth) UB_THROW( UbException(UB_EXARGS,"index out of range") ); - #endif - - if(mFlagVector[arrayIndex]==false) UB_THROW( UbException(UB_EXARGS,"memory not allocated!") ); - - mFlagVector[arrayIndex]=false; - - return --mUsedElements; - } - /*==========================================================*/ - std::size_t getNofUsedElements() { return mUsedElements; } - /*==========================================================*/ - void addPointerToTElementsToVector(std::vector<T*>& tdataVector) - { - std::size_t arrayLength = mBlockWidth*mBlockWidth*mBlockWidth; - for(std::size_t arrayIndex=0; arrayIndex<arrayLength; arrayIndex++) - { - //if(mFlagVector[arrayIndex]) tdataVector.push_back(&mDataElements[arrayIndex]); - if(mFlagVector[arrayIndex]) tdataVector.push_back(static_cast<T*>(mDataElements)+arrayIndex); - } - } - /*==========================================================*/ - template<typename Pred> - void addPointerToTElementsToVector(std::vector<T*>& tdataVector,Pred& pred ) - { - std::size_t arrayLength = mBlockWidth*mBlockWidth*mBlockWidth; - T* tmp; - for(std::size_t arrayIndex=0;arrayIndex<arrayLength;arrayIndex++) - { - if(mFlagVector[arrayIndex]) - { - //tmp = &mDataElements[arrayIndex]; - tmp = static_cast<T*>(mDataElements)+arrayIndex; - if( pred(*tmp) ) tdataVector.push_back(tmp); - } - } - } -private: - ////////////////////////////////////////////////////////////////////////// - //static Member - static const std::size_t mBlockWidth; - - ////////////////////////////////////////////////////////////////////////// - //private Member - std::size_t mUsedElements; - //T* mDataElements; - void* mDataElements; - bool* mFlagVector; - -}; - -////////////////////////////////////////////////////////////////////////// -//class MbChessMemPool3D -//zum Verwalten von TData Elementen in einer Schabrett-artigen Struktur -//die ChessMemBloecke haben hier eine Groesse von ~cachSize -template <class TData, std::size_t cachSize> -class MbChessMemPool3D -{ -private: - ////////////////////////////////////////////////////////////////////////// - //protected static const Member - const static std::size_t mCacheSize; - - ////////////////////////////////////////////////////////////////////////// - //protected Member - static std::vector< std::map< MbChessMap3DKey , MbChessMem3DBlock< TData,cachSize >* > > mMapVector; - static std::map< void*, MbChessMap3DKey > mPointerKeyMap; - - ////////////////////////////////////////////////////////////////////////// - //protected Konstrukoren - MbChessMemPool3D() //private, da NUR static erlaubt!!! - { - - } - ////////////////////////////////////////////////////////////////////////// - //Destruktor - ~MbChessMemPool3D() - { - } - -public: - ////////////////////////////////////////////////////////////////////////// - //static public Methoden - static void* getReference(std::size_t level, std::size_t ix1, std::size_t ix2, std::size_t ix3) - { - if(!MbChessMem3DBlock< TData,cachSize >::mBlockWidth) - { - std::stringstream ss; - ss<<"TreeBasedMemPool() - InitialisationError\n"; - ss<<"\t size of StorageData ("<<typeid(TData).name()<<", "<<sizeof(TData)<<" byte)\n"; - ss<<"\t exceeds user-specifyed cache-zize ("<<mCacheSize<<" byte)\n"; - ss<<"\t cache-size has to be larger than data-size"; - UB_THROW( UbException(UB_EXARGS,ss.str()) ); - } - - if( mMapVector.size()<=level ) mMapVector.resize(level+1); - - std::size_t chessX1 = ix1/(MbChessMem3DBlock<TData,cachSize>::mBlockWidth); - std::size_t chessX2 = ix2/(MbChessMem3DBlock<TData,cachSize>::mBlockWidth); - std::size_t chessX3 = ix3/(MbChessMem3DBlock<TData,cachSize>::mBlockWidth); - - MbChessMap3DKey mapKey(level,chessX1,chessX2,chessX3); - - typename std::map<MbChessMap3DKey,MbChessMem3DBlock<TData,cachSize>* >::iterator pos = mMapVector[level].find(mapKey); - - MbChessMem3DBlock<TData,cachSize>* memBlock = NULL; - - if(pos==mMapVector[level].end()) - { - memBlock = new MbChessMem3DBlock<TData,cachSize>; - (mMapVector[level])[mapKey] = memBlock; - } - else memBlock = pos->second; - - std::size_t internalChessX1 = ix1%(MbChessMem3DBlock<TData,cachSize>::mBlockWidth); - std::size_t internalChessX2 = ix2%(MbChessMem3DBlock<TData,cachSize>::mBlockWidth); - std::size_t internalChessX3 = ix3%(MbChessMem3DBlock<TData,cachSize>::mBlockWidth); - - void* p = memBlock->getReference(internalChessX1,internalChessX2,internalChessX3); - - mPointerKeyMap[p]=mapKey; - - return p; - } - static void freeReference(void *p) - { - typename std::map<void*,MbChessMap3DKey>::iterator posPointerKeyMap = mPointerKeyMap.find(p); - - if(posPointerKeyMap==mPointerKeyMap.end()) UB_THROW( UbException(UB_EXARGS,"pointer not in map") ); - - MbChessMap3DKey mapKey = posPointerKeyMap->second; - mPointerKeyMap.erase(posPointerKeyMap); - - - typename std::map<MbChessMap3DKey,MbChessMem3DBlock<TData,cachSize>* >::iterator posMemBlockMap; - posMemBlockMap = mMapVector[mapKey.getVectorPos()].find(mapKey); - - - if(posMemBlockMap == mMapVector[mapKey.getVectorPos()].end()) - UB_THROW( UbException(UB_EXARGS,"mapKey not in ChessMem3DBlockMap") ); - - std::size_t leftElements = posMemBlockMap->second->freeReference(p); - if(!leftElements) - { - MbChessMem3DBlock<TData,cachSize>* tmp = posMemBlockMap->second; - mMapVector[mapKey.getVectorPos()].erase(posMemBlockMap); - try{ delete tmp; } - catch(...){UB_THROW( UbException(UB_EXARGS,"could not delete MbChessMem3DBlock") );} - } - } - /*==========================================================*/ - static void fillVectorWithPointerToTDataElements(std::size_t level,std::vector<TData*>& tdataVector) - { - tdataVector.clear(); - - if(level>=mMapVector.size()) return; - typename std::map<MbChessMap3DKey,MbChessMem3DBlock<TData,cachSize>* >::iterator pos; - for(pos=mMapVector[level].begin();pos!=mMapVector[level].end();++pos) - { - pos->second->addPointerToTElementsToVector(tdataVector); - } - } - /*==========================================================*/ - static void fillVectorWithPointerToTDataElements(std::vector<TData*>& tdataVector) - { - tdataVector.clear(); - - typename std::map<MbChessMap3DKey,MbChessMem3DBlock<TData,cachSize>* >::iterator pos; - - for(std::size_t vecIndex=0; vecIndex<mMapVector.size(); vecIndex++ ) - { - for(pos=mMapVector[vecIndex].begin();pos!=mMapVector[vecIndex].end();++pos) - { - pos->second->addPointerToTElementsToVector(tdataVector); - } - } - } - /*==========================================================*/ - template<class Pred> - static void fillVectorWithPointerToTDataElements(std::size_t level,std::vector<TData*>& tdataVector, Pred pred) - { - tdataVector.clear(); - - if(level>=mMapVector.size()) return; - typename std::map<MbChessMap3DKey,MbChessMem3DBlock<TData,cachSize>* >::iterator pos; - for(pos=mMapVector[level].begin();pos!=mMapVector[level].end();++pos) - { - pos->second->addPointerToTElementsToVector(tdataVector,pred); - } - } - /*==========================================================*/ - template<typename Pred> - static void fillVectorWithPointerToTDataElements(std::vector<TData*>& tdataVector, Pred pred) - { - tdataVector.clear(); - - typename std::map<MbChessMap3DKey,MbChessMem3DBlock<TData,cachSize>* >::iterator pos; - - for(std::size_t vecIndex=0; vecIndex<mMapVector.size(); vecIndex++ ) - { - for(pos=mMapVector[vecIndex].begin();pos!=mMapVector[vecIndex].end();++pos) - { - pos->second->addPointerToTElementsToVector(tdataVector,pred); - } - } - } - /*==========================================================*/ - static std::size_t getNumberOfChessMemoryBlocks() - { - std::size_t nofElements = 0; - for(std::size_t i=0;i<mMapVector.size();i++) - { - nofElements+=mMapVector[i].size(); - } - return nofElements; - } - /*==========================================================*/ - static std::size_t getNumberOfChessMemoryBlocks(std::size_t level) - { - if(level<mMapVector.size() ) return mMapVector[level].size(); - return 0; - } - /*==========================================================*/ - static std::size_t getNumberOfStoredDataElements() - { - return mPointerKeyMap.size(); - } - /*==========================================================*/ - static std::size_t getNumberOfStoredDataElements(std::size_t level) - { - if(level<mMapVector.size() ) - { - std::size_t nofElements = 0; - typename std::map< MbChessMap3DKey , MbChessMem3DBlock< TData,cachSize >* >::iterator pos; - - for(pos=mMapVector[level].begin(); pos!=mMapVector[level].end(); ++pos) - { - nofElements+= pos->second->getNofUsedElements(); - } - return nofElements; - } - return 0; - } - /*==========================================================*/ - static std::string toString() - { - long double capaticityPerBlock = pow((double)MbChessMem3DBlock<TData,cachSize>::mBlockWidth,3.0); - std::size_t storedElements = MbChessMemPool3D<TData,cachSize>::getNumberOfStoredDataElements(); - std::size_t initialisedMemBlocks = MbChessMemPool3D<TData,cachSize>::getNumberOfChessMemoryBlocks(); - - std::stringstream ss; - ss<<std::endl; - ss<<"****************** MbChessMemPool3D-Info (BEGIN) ******************"<<std::endl; - ss<<"type of Storage-Data.................. : "<<typeid(TData).name()<<std::endl; - ss<<"size of Storage-Data........... [bytes]: "<<sizeof(TData)<<std::endl; - ss<<"specified cache-size........... [bytes]: "<<mCacheSize<<std::endl; - ss<<"#elements per MbChessMem3DBlock [bytes]: "<<capaticityPerBlock<<std::endl; - ss<<"mem per MbChessMem3DBlock...... [bytes]: "<<capaticityPerBlock*sizeof(TData)<<std::endl; - ss<<"used cache-size[%]............. [bytes]: "<<capaticityPerBlock*sizeof(TData)/(double)mCacheSize*100<<std::endl; - ss<<"\n"; - ss<<"#stored Elements = "<<storedElements<<std::endl; - ss<<"#ChessMem3DBlocks = "<<initialisedMemBlocks<<std::endl; - ss<<std::endl; - ss<<"level | #ChessMem3DBlocks | #stored Elements | used capaticity [%] \n"; - ss<<"----------------------------------------------------------------\n"; - for(std::size_t level=0;level<mMapVector.size();level++) - { - std::size_t nofStoredElements = MbChessMemPool3D<TData,cachSize>::getNumberOfStoredDataElements(level); - std::size_t nofChessMem3DBlocks = MbChessMemPool3D<TData,cachSize>::getNumberOfChessMemoryBlocks(level); - - ss<<std::left<<" "<<std::setw(5)<<level<<"| " - <<std::setw(16)<<nofChessMem3DBlocks<<"| " - <<std::setw(17)<<nofStoredElements<<"| "; - if(nofStoredElements) - ss<<std::setw(15)<<nofStoredElements/(double)(capaticityPerBlock*nofChessMem3DBlocks)*100<<std::endl; - else ss<<"-"<<std::endl; - } - ss<<std::endl; - ss<<"called memory..... [bytes]: "<<storedElements*sizeof(TData)<<std::endl; - ss<<"initialised memory [bytes]: "<<initialisedMemBlocks*capaticityPerBlock*sizeof(TData)<<std::endl; - double denominator = (double)(initialisedMemBlocks*capaticityPerBlock*sizeof(TData)); - if(fabs(denominator)>1.E-13) ss<<"used.............. [%] : "<<100.*storedElements*sizeof(TData)/denominator<<std::endl; - else ss<<"used.............. [%] : 0.0"<<std::endl; - ss<<"****************** MbChessMemPool3D-Info (END) *******************"<<std::endl; - return ss.str(); - } - /*==========================================================*/ - static void writeStatisticFiles(const std::string& filename) - { - //liefert Statistik ueber aufuellung der einzelnen bloecke (gesamt und pro level) - //x-Achse: 0... max moegliche Anzahl von moeglichen Elementen pro MemBlock - //y-Achse: Anzahl an Bloecken, die die Anzahl an Elementen beinhalten - std::ofstream spreadingFile(((std::string)(filename+"_spreading.txt")).c_str()); - if(!spreadingFile) UB_THROW( UbException(UB_EXARGS,"couldn't open file") ); - - //std::size_t initialisedMemBlocks = MbChessMemPool3D<TData,cachSize>::getNumberOfChessMemoryBlocks(); - std::size_t maxNofDataElementsPerBlock = MbChessMem3DBlock<TData,cachSize>::mBlockWidth - *MbChessMem3DBlock<TData,cachSize>::mBlockWidth - *MbChessMem3DBlock<TData,cachSize>::mBlockWidth; - std::vector<std::size_t> spreading; - spreading.resize(maxNofDataElementsPerBlock+1,0); - std::vector< std::vector<std::size_t> > spreadingPerLevel; - spreadingPerLevel.resize(mMapVector.size()); - - typename std::map<MbChessMap3DKey,MbChessMem3DBlock<TData,cachSize>* >::iterator pos; - - for(std::size_t level=0; level<mMapVector.size(); level++ ) - { - spreadingPerLevel[level].resize(maxNofDataElementsPerBlock+1,0); - for(pos=mMapVector[level].begin();pos!=mMapVector[level].end();++pos) - { - std::size_t number = pos->second->getNofUsedElements(); - spreading[number]++; - spreadingPerLevel[level][number]++; - } - } - spreadingFile<<"#BlockUsage nofBlocks(all Level) "; - for(std::size_t level=0; level<mMapVector.size(); level++ ) - spreadingFile<<"nofBlockLevel"<<level<<" "; - spreadingFile<<std::endl; - - for(std::size_t i=0;i<spreading.size();i++) - { - spreadingFile<<i<<" "<<spreading[i]; - for(std::size_t level=0; level<mMapVector.size(); level++ ) - spreadingFile<<" "<<spreadingPerLevel[level][i]; - spreadingFile<<std::endl; - } - spreadingFile.flush(); - spreadingFile.close(); - } - - //////////////////////////////////////////////////////////////////////////// - ////ueberladene operatoren - //void* operator new(size_t size, std::size_t level, std::size_t ix1, std::size_t ix2, std::size_t ix3) - //{ - // if(level<0) UB_THROW( UbException(UB_EXARGS,"level ist negativ!") ); - // void *p = getReference(level,ix1,ix2,ix3); - // return p; - //} - ///*==========================================================*/ - //void operator delete(void* p, std::size_t level, std::size_t ix1, std::size_t ix2, std::size_t ix3) - //{ - // //ACHTUNG: wenn man hier ne Exception schmeisst, dann gibts einen BoeSEN compilerFehler!!! - // //UB_THROW( UbException(__FILE__, __LINE__, "MbChessMemPool3D::delete - Scheisse noch nicht gerafft, wie das geht!") ); - // cout<<"MbChessMemPool3D::delete(void* p, std::size_t level, std::size_t ix1, std::size_t ix2, std::size_t ix3) - Scheisse noch nicht gerafft, wie das geht!\n"; - //} - - ///*==========================================================*/ - //void operator delete(void* p) - //{ - // freeReference(p); - //} - -private: - ////////////////////////////////////////////////////////////////////////// - //private statische Methoden -}; - - -//statische Variablen initialisieren -template <class TData, std::size_t cachSize> -std::vector< std::map<MbChessMap3DKey,MbChessMem3DBlock<TData,cachSize>* > > MbChessMemPool3D<TData,cachSize>::mMapVector; - -template <class TData, std::size_t cachSize> -std::map<void*,MbChessMap3DKey > MbChessMemPool3D< TData, cachSize>::mPointerKeyMap; - -template <class TData, std::size_t cachSize> -const std::size_t MbChessMemPool3D<TData,cachSize>::mCacheSize=cachSize; - -//template <class TData, std::size_t cachSize> -//const std::size_t MbChessMemPool3D<TData,cachSize>::mNofElementsWidthMemBlock=static_cast<std::size_t>(pow(static_cast<double>(static_cast<std::size_t>(cachSize/sizeof(TData))),1./3.)); - -//template <class TData, std::size_t cachSize> -//const std::size_t MbChessMemPool3D<TData,cachSize>::mNofElementsInMemBlock=static_cast<std::size_t>(pow(static_cast<double>(static_cast<std::size_t>(pow(static_cast<double>(static_cast<std::size_t>(cachSize/sizeof(TData))),1./3.))),3.0)); - -template <class TData,std::size_t cachSize> -const std::size_t MbChessMem3DBlock<TData,cachSize>::mBlockWidth=static_cast<std::size_t>(std::pow(static_cast<double>(static_cast<std::size_t>(cachSize/sizeof(TData))),1./3.)); - -//template <class TData,std::size_t cachSize> -//const std::size_t MbChessMem3DBlock<TData,cachSize>::mMaxElements=static_cast<std::size_t>(pow(static_cast<double>(static_cast<std::size_t>(pow(static_cast<double>(static_cast<std::size_t>(pow(static_cast<double>(static_cast<std::size_t>(cachSize/sizeof(TData))),1.0/3.0))),3.0))),3.0)); - -#endif diff --git a/src/basics/basics/memory/MbMemPool.h b/src/basics/basics/memory/MbMemPool.h deleted file mode 100644 index e2482caa702661ab838e0ce94d2ad9b2195c7ecc..0000000000000000000000000000000000000000 --- a/src/basics/basics/memory/MbMemPool.h +++ /dev/null @@ -1,87 +0,0 @@ -// _ ___ __ __________ _ __ -// | | / (_)____/ /___ ______ _/ / ____/ /_ __(_)___/ /____ -// | | / / / ___/ __/ / / / __ `/ / /_ / / / / / / __ / ___/ -// | |/ / / / / /_/ /_/ / /_/ / / __/ / / /_/ / / /_/ (__ ) -// |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/ -// -#ifndef MBMEMPOOL_H -#define MBMEMPOOL_H - -#include <queue> -#include <list> - - -template <typename TData, int asize> -class MbMemPool -{ - -protected: - MbMemPool(){} - // Alle 3 Attribute sind Singleton-Objekte ! - // Allokiere Blocke der Groesse m_asize - static int m_asize; - // Halte alle freien Pointer (jedes einzelne Element) in eine FIFO Liste - static std::queue<void*> m_queue; - // Pointer auf Bloecke zum Loeschen ! - static std::list<TData*> m_list; - -public: - - - ~MbMemPool(){} - - // Daten-Bloecke Loeschen, damit wird der gesamte Speicher freigegeben, - // erst aufrufen, wenn die objekte nicht mehr gebraucht werden! - static void deallocatePool(); - - void* operator new(std::size_t size) - { - void* pNew; - TData* feld; - int i; - - //i=m_queue.size(); - //pNew = m_queue.front(); - if(m_queue.size()==0) - { - //Wenn kein freier Speicher mehr vorhanden, Block anlegen - feld = new TData[m_asize]; - m_list.push_back(feld); - for(i=0 ; i<m_asize ; i++) - { - pNew = (void*) &(feld[i]); - m_queue.push( pNew ); - } - } - pNew = m_queue.front(); - m_queue.pop(); - return pNew; - - } - - void operator delete(void* p) - { - m_queue.push(p); - } -}; - - -template <typename TData, int asize> -std::queue<void*> MbMemPool<TData,asize>::m_queue; - -template <typename TData, int asize> -std::list<TData*> MbMemPool<TData,asize>::m_list; - -template <typename TData, int asize> -int MbMemPool<TData,asize>::m_asize=asize; - -template <typename TData, int asize> -void MbMemPool<TData,asize>::deallocatePool() -{ - for(typename std::list<TData*>::iterator pos=m_list.begin() ; pos!=m_list.end(); ++pos) - { - delete[] pos; - } -} - -#endif //MBMEMPOOL_H diff --git a/src/basics/basics/memory/MbSharedPointerDefines.h b/src/basics/basics/memory/MbSharedPointerDefines.h deleted file mode 100644 index 5d959e5ef7b1a21dca86903a1e89cee433214ae9..0000000000000000000000000000000000000000 --- a/src/basics/basics/memory/MbSharedPointerDefines.h +++ /dev/null @@ -1,22 +0,0 @@ - -#ifndef MBSHAREDPOINTERDEFINES_H -#define MBSHAREDPOINTERDEFINES_H - - -#include <PointerDefinitions.h> - -//#define VFSharedFromThis std::enable_shared_from_this -//#define VFSharedPtr std::shared_ptr -//#define VFWeakPtr std::weak_ptr -//#define VFDynamicPtrCast std::dynamic_pointer_cast -// -//template<typename T> -//class VFPtrDeleter -//{ -//public: -// void operator()(T* p) { delete p; } -//}; - - - -#endif diff --git a/src/basics/basics/memory/package.include b/src/basics/basics/memory/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/basics/basics/objects/ObCreator.h b/src/basics/basics/objects/ObCreator.h deleted file mode 100644 index 8b9ef047c8d4653225def53978fdefccef59ee2f..0000000000000000000000000000000000000000 --- a/src/basics/basics/objects/ObCreator.h +++ /dev/null @@ -1,112 +0,0 @@ -// _ ___ __ __________ _ __ -// | | / (_)____/ /___ ______ _/ / ____/ /_ __(_)___/ /____ -// | | / / / ___/ __/ / / / __ `/ / /_ / / / / / / __ / ___/ -// | |/ / / / / /_/ /_/ / /_/ / / __/ / / /_/ / / /_/ (__ ) -// |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/ -// -#ifndef OBCREATOR_H -#define OBCREATOR_H - -#include <string> - -/*=========================================================================*/ -/* ObCreator / ObCreatorImpl */ -/* */ -/** -generic factory -<BR><BR> -@author <A HREF="mailto:muffmolch@gmx.de">S. Freudiger</A> -@version 1.0 - 14.06.07 -@version 1.1 - 12.04.08 -*/ - -/* -usage: see bottom of file "./ObFactory.h" -*/ - -////////////////////////////////////////////////////////////////////////// -// ObCreator -// Um in der Factory verschiedene Typen von Creaors in einer -// std::map<std::string,ObCreator<BaseT>*> halten zu koennen -// muss eine gemeinsame Basisklasse existieren -////////////////////////////////////////////////////////////////////////// -template< class BaseT > -class ObCreator -{ -public: - virtual std::string getObjectTypeID()=0; - virtual BaseT* createObject() = 0; - - virtual ~ObCreator() { } - -protected: - ObCreator() {} -private: - ObCreator( const ObCreator< BaseT >& ); //no copy allowed - const ObCreator& operator=( const ObCreator& ); //no copy allowed -}; - -////////////////////////////////////////////////////////////////////////// -// ObCreatorImpl -// Implementierung des speziellen Creators -////////////////////////////////////////////////////////////////////////// -template< class T, class BaseT=T > -class ObCreatorImpl : public ObCreator< BaseT > -{ -public: - static ObCreator<BaseT >* getInstance() - { - static ObCreatorImpl< T, BaseT > instance; - return &instance; - } - -public: - ~ObCreatorImpl() {} - - //aus portabilitaetsgruenden kann man nicht typeinfo nehmen, da diese compilerabhaengig ist - std::string getObjectTypeID() { return T::getStaticClassObjectTypeID(); } - - virtual T* createObject() { return new T(); } - -protected: - ObCreatorImpl() {} -private: - ObCreatorImpl( const ObCreatorImpl< T, BaseT >& ); //no copy allowed - const ObCreatorImpl& operator=( const ObCreatorImpl& ); //no copy allowed -}; - -////////////////////////////////////////////////////////////////////////// -// ObCreatorImpl -// Implementierung des speziellen Creators fuer Singletons -////////////////////////////////////////////////////////////////////////// -template< class T, class BaseT=T > -class ObSingletonCreatorImpl : public ObCreator< BaseT > -{ -public: - static ObCreator<BaseT >* getInstance() - { - static ObSingletonCreatorImpl< T, BaseT > instance; - return &instance; - } -public: - ~ObSingletonCreatorImpl() {} - - //aus portabilitaetsgruenden kann man nicht typeinfo nehmen, da diese compilerabhaengig ist - std::string getObjectTypeID() { return T::getStaticClassObjectTypeID(); } - - virtual T* createObject() { return T::getInstance(); } - -protected: - ObSingletonCreatorImpl() {} -private: - ObSingletonCreatorImpl( const ObSingletonCreatorImpl< T, BaseT >& ); //no copy allowed - const ObSingletonCreatorImpl& operator=( const ObSingletonCreatorImpl& ); //no copy allowed -}; - -//workaround for the not perfect C++ world. typeinfo::name is not usable for this purpose! -//see Andrei Alexandrescu, "Modern C++ Design: Generic Programming and Design Patterns Applied", Chapter 8.5 -#define OBCREATOR_EXT( ClassObject ) \ - static std::string getStaticClassObjectTypeID() { return #ClassObject; } \ - virtual std::string getClassObjectTypeID() { return getStaticClassObjectTypeID(); } - -#endif //OBCREATOR_H diff --git a/src/basics/basics/objects/ObFactory.h b/src/basics/basics/objects/ObFactory.h deleted file mode 100644 index aa522ec5c3bbbc7aa2558ce694068887db06a1ff..0000000000000000000000000000000000000000 --- a/src/basics/basics/objects/ObFactory.h +++ /dev/null @@ -1,174 +0,0 @@ -// _ ___ __ __________ _ __ -// | | / (_)____/ /___ ______ _/ / ____/ /_ __(_)___/ /____ -// | | / / / ___/ __/ / / / __ `/ / /_ / / / / / / __ / ___/ -// | |/ / / / / /_/ /_/ / /_/ / / __/ / / /_/ / / /_/ (__ ) -// |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/ -// -#ifndef OBFACTORY_H -#define OBFACTORY_H - - -#include <string> -#include <map> -#include <sstream> -#include <iomanip> -#include <typeinfo> - -#include <basics/objects/ObCreator.h> - -/*=========================================================================*/ -/* ObFactory */ -/* */ -/** -generic factory -<BR><BR> -@author <A HREF="mailto:muffmolch@gmx.de">S. Freudiger</A> -@version 1.0 - 14.06.07 -@version 1.1 - 12.04.08 -*/ - -/* -usage: T = zu erzeugende Klasse - Creator = Erzeugerklasse -////////////////////////////////////////////////////////////////////////// -//example -////////////////////////////////////////////////////////////////////////// -// class Base{ -// public: -// OBCREATOR_EXT(Base) -// }; -// //automatisches registrieren: -// UB_AUTO_RUN_NAMED(ObFactory<Base>::getInstance()->addObCreator(ObCreatorImpl<Base,Base>::getInstance()), CAB_Base); -// class Derived : public Base -// { -// public: -// OBCREATOR_EXT(Derived) -//}; -// //automatisches registrieren: -// UB_AUTO_RUN_NAMED(ObFactory<Base>::getInstance()->addObCreator(ObCreatorImpl<Base,Derived>::getInstance()), CAB_Derived); -//////////////////////////////////////////////////////////////////////////// -// int main() -// { -// //Alternativ zu UB_AUTO_RUN_NAMED: haendisches registrieren -// ObFactory<Base>::getInstance()->addObCreator(ObCreatorImpl<Base>::getInstance()); -// ObFactory<Base>::getInstance()->addObCreator(ObCreatorImpl<Derived,Base>::getInstance()); -// -// //create objects - method1 -// Base* test1 = ObFactory<Base>::getInstance()->createObject<Base>(); -// Base* test2 = ObFactory<Base>::getInstance()->createObject<Derived>(); -// -// //create objects - method2 -// Base* test1 = ObFactory<Base>::getInstance()->createObject(Base::getStaticClassObjectTypeID() ); -// Base* test2 = ObFactory<Base>::getInstance()->createObject(Derived::getStaticClassObjectTypeID() ); -// //... -// } -*/ - - -template<class T, typename Creator = ObCreator< T > > -class ObFactory -{ - typedef std::map< std::string, Creator* > CreatorMap; - typedef typename CreatorMap::iterator CreatorMapIt; - typedef std::pair< std::string, Creator* > CreatorMapElement; - -protected: - ObFactory() {} //so ist vererbung gewahrleistet - -private: - ObFactory( const ObFactory< T, Creator >& ); //no copy allowed - const ObFactory& operator=( const ObFactory& ); //no copy allowed - - -public: - virtual ~ObFactory() {} - - static ObFactory< T, Creator >* getInstance() - { - static ObFactory< T, Creator > instance; - return &instance; - } - - bool addObCreator(Creator* creator); - bool removeObCreator(Creator* creator); - - T* createObject(const std::string& objectTypeID); - - template< typename T2 > - T* createObject() { return this->createObject( T2::getStaticClassObjectTypeID() ); } - - Creator* getCreator(const std::string& objectTypeID); - - virtual std::string toString(); - -private: - CreatorMap creatorMap; -}; - -////////////////////////////////////////////////////////////////////////// -//Implementation -template<class T, typename Creator > -bool ObFactory< T, Creator >::addObCreator(Creator* creator) -{ - if(creatorMap.insert( CreatorMapElement(creator->getObjectTypeID(), creator) ).second ) - { - //insert succeeded - return true; - } - //insert fails - return false; -} -/*======================================================================*/ -template<class T, typename Creator > -bool ObFactory< T, Creator >::removeObCreator(Creator* creator) -{ - if(creator && creatorMap->erase( creator->getClassObjectTypeID() ) ) - return true; - - return false; -} -/*======================================================================*/ -template<class T, typename Creator > -Creator* ObFactory< T, Creator >::getCreator(const std::string& obtypeID) -{ - CreatorMapIt it = creatorMap.find(obtypeID); - if(it == creatorMap.end()) return NULL; - - Creator* creator = it->second; - if(!creator) return NULL; - - return creator; -} -/*======================================================================*/ - template<class T, typename Creator > - T* ObFactory< T, Creator >::createObject(const std::string& objectTypeID) - { - Creator* creator = this->getCreator(objectTypeID); - - if(!creator) - { - UB_THROW( UbException(UB_EXARGS,"no creator avaivlable for ID="+objectTypeID ) ); - } - - return creator->createObject(); - } -/*======================================================================*/ -template<class T, typename Creator > -std::string ObFactory< T, Creator >::toString() -{ - std::size_t maxL = 6; - for(CreatorMapIt it=creatorMap.begin(); it!=creatorMap.end(); ++it) - if( it->first.size() > maxL ) - maxL = it->first.size(); - - std::stringstream os; - os<<(std::string)typeid(*this).name()<<" - info:"<<std::endl; - os<<" "<<std::left<<std::setw(maxL)<<"object"<<" <-> "<<"creator "<<std::endl; - for(CreatorMapIt it=creatorMap.begin(); it!=creatorMap.end(); ++it) - os<< " - " << std::setw(maxL) << it->first << " <-> " << (std::string)typeid(*it->second).name() << std::endl; - - return os.str(); -} -/*======================================================================*/ - -#endif //OBFACTORY_H diff --git a/src/basics/basics/objects/ObObject.cpp b/src/basics/basics/objects/ObObject.cpp deleted file mode 100644 index e7774e9163d6173e456afeb9d3e91608a431a2f7..0000000000000000000000000000000000000000 --- a/src/basics/basics/objects/ObObject.cpp +++ /dev/null @@ -1,10 +0,0 @@ -//#include <basics/objects/ObObject.h> - -// ObObject::ObObject() -// { -// } -// /*=======================================*/ -// std::string ObObject::getName() -// { -// return name; -// } diff --git a/src/basics/basics/objects/ObObject.h b/src/basics/basics/objects/ObObject.h index addf7e134ef0de98fc4a4d7d1dc65f82caf7e571..c540005212a3798c7cfc773f5032ab5bbc5f1c72 100644 --- a/src/basics/basics/objects/ObObject.h +++ b/src/basics/basics/objects/ObObject.h @@ -1,24 +1,42 @@ -// _ ___ __ __________ _ __ -// | | / (_)____/ /___ ______ _/ / ____/ /_ __(_)___/ /____ -// | | / / / ___/ __/ / / / __ `/ / /_ / / / / / / __ / ___/ -// | |/ / / / / /_/ /_/ / /_/ / / __/ / / /_/ / / /_/ (__ ) -// |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ // +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file ObObject.h +//! \ingroup objects +//! \author Soeren Freudiger, Sebastian Geller +//======================================================================================= #ifndef OBOBJECT_H #define OBOBJECT_H #include <string> -#include <basics/objects/ObObjectCreator.h> #include <basics/utilities/UbObservable.h> -#ifdef CAB_RCF -#include <3rdParty/rcf/RcfSerializationIncludes.h> -#endif - - -class ObObjectCreator; - class ObObject : public UbObservable { public: @@ -28,33 +46,16 @@ public: virtual ~ObObject() { } virtual ObObject* clone()=0; - virtual std::string getTypeID()=0; virtual std::string getName() { return name; } void setName(std::string name) { this->name=name; } virtual std::string toString()=0; - virtual ObObjectCreator* getCreator()=0; - -#ifdef CAB_RCF - template<class Archive> - void SF_SERIALIZE(Archive & ar) - { - //SF::SF_SERIALIZE_PARENT<UbObservable>(ar, *this); - SF_SERIALIZE_PARENT<UbObservable>(ar, *this); - ar & name; - } -#endif //CAB_RCF private: std::string name; }; -#if defined(RCF_USE_SF_SERIALIZATION) && !defined(SWIG) -SF_NO_CTOR(ObObject); -UB_AUTO_RUN_NAMED( ( SF::registerType<ObObject>("ObObject") ), SF_ObObject ); -UB_AUTO_RUN_NAMED( ( SF::registerBaseAndDerived<UbObservable, ObObject >() ), SF_ObObject_BD1 ); -#endif //RCF_USE_SF_SERIALIZATION #endif diff --git a/src/basics/basics/objects/ObObjectCreator.h b/src/basics/basics/objects/ObObjectCreator.h deleted file mode 100644 index 3224466dc34d500e67d381cba2e68e04fe5f474b..0000000000000000000000000000000000000000 --- a/src/basics/basics/objects/ObObjectCreator.h +++ /dev/null @@ -1,58 +0,0 @@ -// _ ___ __ __________ _ __ -// | | / (_)____/ /___ ______ _/ / ____/ /_ __(_)___/ /____ -// | | / / / ___/ __/ / / / __ `/ / /_ / / / / / / __ / ___/ -// | |/ / / / / /_/ /_/ / /_/ / / __/ / / /_/ / / /_/ (__ ) -// |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/ -// -#ifndef OBOBJECTCREATOR_H -#define OBOBJECTCREATOR_H - -#include <string> - -class ObObject; -class ObObjectManager; - -class Presentator; -class QViewer; - -#ifdef CAB_QT -class QObObjectSpecificInstrument; -class QWidget; -class QActionGroup; -#endif - -class ObObjectCreator -{ -public: - virtual ~ObObjectCreator() {} - - virtual ObObject* createObObject()=0; - - virtual std::string getTypeID() { return "ObObject"; } - virtual std::string toString() { return "ObObjectCreator"; } - -#ifdef CAB_QT - //virtual Presentator* createObjectPresentator(ObObject *object)=0; - virtual Presentator* createObjectPresentator(ObObject *object) { return NULL; } - virtual QActionGroup* getSpecificPresentatorGroup(ObObject* object, QViewer *viewer, QWidget* parent) { return NULL; } - virtual QActionGroup* getSpecificActionGroup(ObObjectManager* manager, ObObject* object, QWidget* parent) - { - return NULL; - } - - virtual ObObject* createObObjectWithQt() { return NULL; } - virtual void showSpecificInstrument(ObObject* object, QWidget* parent=0) {} - virtual QObObjectSpecificInstrument* getSpecificInstrument() { return NULL; } - - //virtual QActionGroup *getSpecificContextMenuActionGroup() { return NULL; } -#endif - -protected: - ObObjectCreator() {} - -private: - ObObjectCreator( const ObObjectCreator& ); //no copy allowed - const ObObjectCreator& operator=( const ObObjectCreator& ); //no copy allowed - -}; -#endif diff --git a/src/basics/basics/objects/ObObjectFactory.cpp b/src/basics/basics/objects/ObObjectFactory.cpp deleted file mode 100644 index 49bf03fe3ab159a91a17b9fd4f7b65f6c2dcda9c..0000000000000000000000000000000000000000 --- a/src/basics/basics/objects/ObObjectFactory.cpp +++ /dev/null @@ -1,54 +0,0 @@ -#include <basics/objects/ObObjectFactory.h> - -/**** Eigene ****/ -#include <basics/objects/ObObjectCreator.h> -#include <basics/utilities/UbException.h> - -using namespace std; - -//ObObjectFactory::ObObjectFactory() -//{ -//} -// -//ObObjectFactory::~ObObjectFactory() -//{ -//} -/*======================================================================*/ -//ObObjectFactory* ObObjectFactory::getInstance() -//{ -// static ObObjectFactory instance; -// return &instance; -//} -/*======================================================================*/ -void ObObjectFactory::addObObjectCreator(ObObjectCreator *creator) -{ - //cout<<"Meth:"<<creator->toString()<<" Meth-ID:"<<creator->getTypeID()<<endl; - creatorSet.insert(std::pair<string, ObObjectCreator*>(creator->getTypeID(), creator)); -} -/*======================================================================*/ -void ObObjectFactory::removeObObjectCreator(ObObjectCreator *creator) -{ - UB_THROW( UbException(UB_EXARGS,"not implemented") ); -} -/*======================================================================*/ -ObObjectCreator* ObObjectFactory::getCreator(string objectType) -{ - std::map<string, ObObjectCreator*>::iterator creatorIterator = creatorSet.find(objectType); - if(creatorIterator == creatorSet.end()) UB_THROW( UbException(UB_EXARGS,"factory has no creator for "+objectType) ); - ObObjectCreator *creator = creatorIterator->second; - if(!creator) UB_THROW( UbException(UB_EXARGS,"no time series creator for type available") ); - return creator; -} -/*======================================================================*/ -string ObObjectFactory::toString() -{ - stringstream text; - - std::map<string, ObObjectCreator*>::iterator creatorIterator; - std::map<string, ObObjectCreator*>* creatorSet = this->getCreatorSet(); - - for(creatorIterator = creatorSet->begin(); creatorIterator!=creatorSet->end(); ++creatorIterator) - text<<" - "<<(creatorIterator->second)->toString()<<" for "<<(creatorIterator->first)<<endl; - - return text.str(); -} diff --git a/src/basics/basics/objects/ObObjectFactory.h b/src/basics/basics/objects/ObObjectFactory.h deleted file mode 100644 index 2af7458cdf9fa742b19710a3ab4cc4ca665c6860..0000000000000000000000000000000000000000 --- a/src/basics/basics/objects/ObObjectFactory.h +++ /dev/null @@ -1,42 +0,0 @@ -// _ ___ __ __________ _ __ -// | | / (_)____/ /___ ______ _/ / ____/ /_ __(_)___/ /____ -// | | / / / ___/ __/ / / / __ `/ / /_ / / / / / / __ / ___/ -// | |/ / / / / /_/ /_/ / /_/ / / __/ / / /_/ / / /_/ (__ ) -// |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/ -// -#ifndef OBOBJECTFACTORY_H -#define OBOBJECTFACTORY_H - -#include <string> -#include <map> - -class ObObjectCreator; - -class ObObjectFactory -{ -public: - ObObjectFactory() {} - virtual ~ObObjectFactory() {} - - //static geht nicht, da abgeleitete Factories existieren ... - //static ObObjectFactory* getInstance(); - //virtual ObObjectFactory* getInstance()=0; - - ObObjectCreator* getCreator(std::string objectType); - - void addObObjectCreator(ObObjectCreator* creator); - void removeObObjectCreator(ObObjectCreator* creator); - - std::map<std::string, ObObjectCreator*>* getCreatorSet() { return &creatorSet; } - - virtual std::string toString(); - -private: - ObObjectFactory( const ObObjectFactory& ); //no copy allowed - const ObObjectFactory& operator=( const ObObjectFactory& ); //no copy allowed - - std::map<std::string, ObObjectCreator*> creatorSet; -}; - - -#endif //OBOBJECTFACTORY_H diff --git a/src/basics/basics/objects/ObObjectManager.cpp b/src/basics/basics/objects/ObObjectManager.cpp deleted file mode 100644 index d84f49fc158850203f6ddc2467a1e3fb7c5c6d32..0000000000000000000000000000000000000000 --- a/src/basics/basics/objects/ObObjectManager.cpp +++ /dev/null @@ -1,216 +0,0 @@ -#include <basics/objects/ObObjectManager.h> -#include <basics/objects/ObObject.h> -#include <basics/objects/ObObjectCreator.h> -#include <basics/utilities/UbTableModel.h> -#include <basics/utilities/UbException.h> - -using namespace std; - -ObObjectEntry::ObObjectEntry(ObObjectManager *parent, ObObject *object) -{ - this->parent = parent; - this->object = object; -} -/*======================================================*/ -ObObjectManager::ObObjectManager() -{ - this->selectedObject = NULL; - this->tableModel = NULL; -} - -/*======================================================*/ -ObObjectManager::~ObObjectManager() -{ - //cerr<<"NEIN, notifyObserversObjectWillBeDeleted wird AUSSCHLIESSLICH von BasisKlasse aufgerufen!!!"<<endl; - // cerr<<"das muss so sein, denn ansonsten duerfte diese funktion nur in der speziellen klasse stehen, da\n"; - // cerr<<"virtuelle destruktoren sich rekursiv vom speziellen ins allg. aufrufen --> notify.. wuerde\n"; - // cerr<<"oefters aufgerufen werden...\n"; - - this->objectList.clear(); - if(this->tableModel) delete this->tableModel; -} -/*======================================================*/ -UbTableModel* ObObjectManager::getTableModel() -{ - return tableModel; -} -/*======================================================*/ -//bool ObObjectManager::addObObject(ObObject *object) -//{ -// cout<<"ObObjectManager::addObObject "<<object->toString()<<endl; -// for(int pos=0; pos<(int)this->objectList.size(); pos++) -// if(this->objectList[pos]->object==object) -// return false; -// -// this->objectList.push_back(new ObObjectEntry(this,object)); -// //object->addObserver(this); -// this->selectObObject(object); -// return true; -//} -/*======================================================*/ -bool ObObjectManager::addObObjectEntry(ObObjectEntry* objectEntry) -{ - for(int pos=0; pos<(int)this->objectList.size(); pos++) - if(this->objectList[pos]->object==objectEntry->object) - return false; - - this->objectList.push_back(objectEntry); -// objectEntry->getObject()->addObserver(this); - this->selectObObject(objectEntry->object); - return true; -} -/*======================================================*/ -bool ObObjectManager::removeObObject(ObObject* object) -{ - if (this->selectedObject == object) this->selectedObject=NULL; - for(int pos=0; pos<(int)this->objectList.size(); pos++) - { - - if(this->objectList[pos]->object==object) - { - return this->removeObObject(pos); -// this->objectList.erase(objectList.begin()+pos); -// //this->removeObserver(this); -// return true; - } - } - return false; -} -/*======================================================*/ -bool ObObjectManager::removeObObject(int index) -{ - try - { - if ( objectList[index]->object == this->selectedObject ) this->selectedObject=NULL; - //den entry loeschen ... das object im Entry ??? erstmal ausserhalb ... - delete objectList[index]; - objectList.erase(objectList.begin()+index); - this->notifyObserversObjectChanged(); - return true; - } - catch(const std::exception& e) { cerr<<e.what()<<endl; } - catch(...) { cerr<<"Fehler in ObObjectManager::removeObObject"<<endl; } - return false; -} -/*======================================================*/ -void ObObjectManager::removeAllObObjects() -{ - //TODO: implementieren!! - //foreach grid: - //grid->removeObserver(this); - //vector<ObObject*>::iterator it; - //for(it=objectList.begin(); it!=objectList.end(); it++) - //{ - // it->removeObserver(this); - //} -// for(int i=0; i<(int)objectList.size(); i++) -// { -// delete objectList[i]->object->removeObserver(this); -// } - this->objectList.clear(); - this->selectedObject = NULL; - this->notifyObserversObjectChanged(); -} -/*======================================================*/ -int ObObjectManager::getNumberOfObObjects() -{ - return (int)this->objectList.size(); -} -/*======================================================*/ -vector<ObObject*>* ObObjectManager::getAllObObjects() -{ - UB_THROW( UbException(UB_EXARGS,"hier muss noch was getan werden") ); -// return this->objectList; -} -vector<ObObjectEntry*>* ObObjectManager::getAllObObjectEntries() -{ - return &this->objectList; -} -/*======================================================*/ -ObObject* ObObjectManager::getObObject(int index) -{ - if(index < 0) return NULL; - if(index >= (int)this->objectList.size()) return NULL; - - return(this->objectList[index]->object); -} -/*======================================================*/ -ObObjectEntry* ObObjectManager::getObObjectEntry(int index) -{ - if(index < 0) return NULL; - if(index >= (int)this->objectList.size()) return NULL; - - return(this->objectList[index]); -} -/*====================================================*/ -string ObObjectManager::toString() -{ - stringstream ss; ss<<endl; - - for(int pos=0; pos<(int)this->objectList.size(); pos++) - { - ObObject* object = this->objectList[pos]->object; - ss<<(pos+1)<<". "<<object->toString()<<endl; - } - return ss.str(); -} -/*======================================================*/ -void ObObjectManager::objectChanged(UbObservable* observable) -{ - //cout<<"ObObjectManager::objectChanged ??"; - this->notifyObserversObjectChanged(); -} -/*======================================================*/ -void ObObjectManager::objectWillBeDeleted(UbObservable* observable) -{ - cout<<"ObObjectManager::objectWillBeDeleted ??"; - //observable->removeObserver(this); -} -/*======================================================*/ -bool ObObjectManager::selectObObject(int index) -{ - if((int)this->objectList.size()==0) - { - this->selectedObject = NULL; return false; - } - if (index > (int)this->objectList.size()-1 || index < 0) return false; - if ( this->selectedObject == this->getObObject(index) ) return true; - - this->selectedObject = this->getObObject(index); - //cout<<this->getObserverList()->size()<<endl; - - this->notifyObserversObjectChanged(); - return true; -} -/*======================================================*/ -bool ObObjectManager::selectObObject(ObObject* object) -{ - if((int)this->objectList.size()==0) { this->selectedObject = NULL; return false; } - for(int pos=0; pos<(int)this->objectList.size(); pos++) - { - if(this->objectList[pos]->object==object) - { - return this->selectObObject(pos); - } - } - return false; -} -/*======================================================*/ -ObObject* ObObjectManager::getSelectedObObject() -{ - return this->selectedObject; -} -/*======================================================*/ -int ObObjectManager::getSelectedIndex() -{ - for(int pos=0; pos<(int)this->objectList.size(); pos++) - { - if(this->objectList[pos]->object==this->selectedObject) - { - return pos; - } - } - return -1; -} -/*======================================================*/ - diff --git a/src/basics/basics/objects/ObObjectManager.h b/src/basics/basics/objects/ObObjectManager.h deleted file mode 100644 index 9d5b42df99209527228127eb195122054d550bfd..0000000000000000000000000000000000000000 --- a/src/basics/basics/objects/ObObjectManager.h +++ /dev/null @@ -1,79 +0,0 @@ -// _ ___ __ __________ _ __ -// | | / (_)____/ /___ ______ _/ / ____/ /_ __(_)___/ /____ -// | | / / / ___/ __/ / / / __ `/ / /_ / / / / / / __ / ___/ -// | |/ / / / / /_/ /_/ / /_/ / / __/ / / /_/ / / /_/ (__ ) -// |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/ -// -#ifndef OBOBJECTMANAGER_H -#define OBOBJECTMANAGER_H - -#include <string> -#include <sstream> -#include <vector> - -#include <basics/utilities/UbObservable.h> -#include <basics/utilities/UbObserver.h> - -class UbException; -class UbTableModel; -class ObObjectManager; -class ObObjectFactory; -class ObObject; - - -class ObObjectEntry -{ - friend class ObObjectManager; -public: - ObObjectManager* getParent() { return parent; } - ObObject* getObject() { return object; } - - ObObjectEntry(ObObjectManager* parent, ObObject* object); - virtual ~ObObjectEntry() { } - -protected: - ObObjectManager* parent; - ObObject* object; -}; - - -class ObObjectManager : public UbObservable, public UbObserver -{ -public: - ObObjectManager(); - ~ObObjectManager(); - - //virtual bool addObObject(ObObject* object); - virtual bool addObObjectEntry(ObObjectEntry* objectEntry); - - virtual ObObjectEntry* createNewObObjectEntry(ObObject* obj) { return new ObObjectEntry(this, obj); } - - bool removeObObject(ObObject* object); - bool removeObObject(int index); - void removeAllObObjects(); - bool selectObObject(int index); - bool selectObObject(ObObject* object); - ObObject* getSelectedObObject(); - int getSelectedIndex(); - - int getNumberOfObObjects(); - std::vector<ObObject*>* getAllObObjects(); - std::vector<ObObjectEntry*>* getAllObObjectEntries(); - ObObject* getObObject(int index); - ObObjectEntry* getObObjectEntry(int index); - - std::string toString(); - - virtual void objectChanged(UbObservable* observable); - virtual void objectWillBeDeleted(UbObservable* observable); - - UbTableModel* getTableModel(); - virtual ObObjectFactory* getObObjectFactory()=0; - -protected: - std::vector<ObObjectEntry*> objectList; - ObObject* selectedObject; - UbTableModel* tableModel; -}; - -#endif //OBOBJECTMANAGER_H diff --git a/src/basics/basics/objects/package.include b/src/basics/basics/objects/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/basics/basics/parallel/PbMpiTools.h b/src/basics/basics/parallel/PbMpiTools.h deleted file mode 100644 index 07ea52881f8e0704c3ca0523727ec10fbcd06c8b..0000000000000000000000000000000000000000 --- a/src/basics/basics/parallel/PbMpiTools.h +++ /dev/null @@ -1,303 +0,0 @@ -// _ ___ __ __________ _ __ -// | | / (_)____/ /___ ______ _/ / ____/ /_ __(_)___/ /____ -// | | / / / ___/ __/ / / / __ `/ / /_ / / / / / / __ / ___/ -// | |/ / / / / /_/ /_/ / /_/ / / __/ / / /_/ / / /_/ (__ ) -// |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/ -// -#ifndef PBMPITOOLS_H -#define PBMPITOOLS_H - -#include <vector> -#include <sstream> - -//#undef SEEK_SET -//#undef SEEK_CUR -//#undef SEEK_END -#include <mpi.h> -#include <basics/utilities/UbException.h> - -#ifdef USE_MPI_CXX_SYNTAX - -namespace PbMpiTools -{ - /*======================================================================*/ - // send a single value "value" of MPI_Datatype - template <class T> - inline void sendSingleValue(const T& value, MPI_Datatype datatype, int dest, int tag, MPI::Intracomm comm); - - /*======================================================================*/ - // receives a single value "value" of MPI_Datatype - template <class T> - inline void receiveSingleValue(T& value, MPI_Datatype datatype, int source, int tag, MPI::Intracomm comm); - - /*======================================================================*/ - // receives and returns a single value of MPI_Datatype - // expample: int value = PbMpiTools::receiveSingleValue<int>(MPI::INT,0,10,comm); - template <class T> - inline T receiveSingleValue(MPI_Datatype datatype, int source, int tag, MPI::Intracomm comm); - - /*======================================================================*/ - // sends bool value (doesn't work with template, why ever... stupid MPI) - inline void sendBoolValue(const bool& value,int dest, int tag, MPI::Intracomm comm); - - /*======================================================================*/ - // receives bool value (doesn't work with template, why ever... stupid MPI) - inline bool receiveBoolValue(int source, int tag, MPI::Intracomm comm); - - /*======================================================================*/ - // sends bool value (doesn't work with template, why ever... stupid MPI) - inline void sendStringValue(const std::string& value,int dest, int tag, MPI::Intracomm comm); - - /*======================================================================*/ - // receives bool value (doesn't work with template, why ever... stupid MPI) - inline std::string receiveStringValue(int source, int tag, MPI::Intracomm comm); - - /*======================================================================*/ - // send a vector of MPI_Datatype - template <class T> - inline void sendVector(const std::vector<T>& v, MPI_Datatype datatype, int dest, int tag, MPI::Intracomm comm); - - /*======================================================================*/ - // receive a std::vector of MPI_Datatype - template <class T> - inline void receiveVector(std::vector<T>& v, MPI_Datatype datatype, int source, int tag, MPI::Intracomm comm); - - /*======================================================================*/ - // receive a vector of MPI_Datatype and adds this vector to existing vector - // ans returns number of received elements - template <class T> - inline int receiveVectorAndAddToVector(std::vector<T>& v, MPI_Datatype datatype, int source, int tag, MPI::Intracomm comm); - - /*======================================================================*/ - // send a std::vector of strings - inline void sendStringVector(const std::vector<std::string>& v, int dest, int tag, MPI::Intracomm comm); - - /*======================================================================*/ - // send a vector of strings - inline void receiveStringVector(std::vector<std::string>& v, int dest, int tag, MPI::Intracomm comm); -}; - -/*======================================================================*/ -// send a single value of MPI_Datatype -template <class T> -void PbMpiTools::sendSingleValue(const T& value, MPI_Datatype datatype, int dest, int tag, MPI::Intracomm comm) -{ - try{ comm.Send(&value, 1, datatype, dest, tag); } - catch(MPI::Exception& e){ std::stringstream ss; ss<<"MPI::Exception error_string="<<e.Get_error_string()<<std::endl; - UB_THROW( UbException(UB_EXARGS,"catched with info at send size\n"+ss.str()) ); } - catch(...) { UB_THROW( UbException(UB_EXARGS,"unknown exception at send size") ); } -} -/*======================================================================*/ -template <class T> -void PbMpiTools::receiveSingleValue(T& value, MPI_Datatype datatype, int source, int tag, MPI::Intracomm comm) -{ - try { comm.Recv(&value, 1, datatype, source, tag); } - catch(MPI::Exception& e){ std::stringstream ss;ss<<"MPI::Exception error_string="<<e.Get_error_string()<<std::endl; - UB_THROW( UbException(UB_EXARGS,"MPI:Exception catched with info at receive size\n"+ss.str()) );} - catch(...) { UB_THROW( UbException(UB_EXARGS,"unknown exception at receive size") ); } -} -/*======================================================================*/ -template <class T> -T PbMpiTools::receiveSingleValue(MPI_Datatype datatype, int source, int tag, MPI::Intracomm comm) -{ - T value; - try { comm.Recv(&value, 1, datatype, source, tag); } - catch(MPI::Exception& e){ std::stringstream ss;ss<<"MPI::Exception error_string="<<e.Get_error_string()<<std::endl; - UB_THROW( UbException(UB_EXARGS,"MPI:Exception catched with info at receive size\n"+ss.str()) );} - catch(...) { UB_THROW( UbException(UB_EXARGS,"unknown exception at receive size") ); } - - return value; -} -/*======================================================================*/ -// send a bool value (bool doesn't work with template, why ever) -void PbMpiTools::sendBoolValue(const bool& value,int dest, int tag, MPI::Intracomm comm) -{ - short dummy; - if(value) dummy=1; - else dummy=0; - - try{ comm.Send(&dummy, 1, MPI::SHORT, dest, tag); } - catch(MPI::Exception& e){ std::stringstream ss; ss<<"MPI::Exception error_string="<<e.Get_error_string()<<std::endl; - UB_THROW( UbException(UB_EXARGS,"MPI:Exception catched with info at send size\n"+ss.str()) ); } - catch(...) { UB_THROW( UbException(UB_EXARGS,"unknown exception at send size") ); } -} -/*======================================================================*/ -bool PbMpiTools::receiveBoolValue(int source, int tag, MPI::Intracomm comm) -{ - short dummy; - try { comm.Recv(&dummy, 1, MPI::SHORT, source, tag); } - catch(MPI::Exception& e){ std::stringstream ss;ss<<"MPI::Exception error_string="<<e.Get_error_string()<<std::endl; - UB_THROW( UbException(UB_EXARGS,"MPI:Exception catched with info at receive size\n"+ss.str()) );} - catch(...) { UB_THROW( UbException(UB_EXARGS,"unknown exception at receive size") ); } - - return (dummy==1); -} -/*======================================================================*/ -// sends bool value (doesn't work with template, why ever... stupid MPI) -void PbMpiTools::sendStringValue(const std::string& value,int dest, int tag, MPI::Intracomm comm) -{ - std::vector<char> vec; - for(std::size_t i=0; i<value.size(); i++) - vec.push_back(value[i]); - PbMpiTools::sendVector(vec,MPI::CHAR,dest,tag,comm); -} - -/*======================================================================*/ -// receives bool value (doesn't work with template, why ever... stupid MPI) -std::string PbMpiTools::receiveStringValue(int source, int tag, MPI::Intracomm comm) -{ - std::vector<char> vec; - PbMpiTools::receiveVector(vec,MPI::CHAR,source,tag,comm); - std::string str; - for(std::size_t i=0; i<vec.size(); i++) - str+=vec[i]; - - return str; -} -/*======================================================================*/ -// send a vector of MPI_Datatype -template <class T> -void PbMpiTools::sendVector(const std::vector<T>& v, MPI_Datatype datatype, int dest, int tag, MPI::Intracomm comm) -{ - // send size - int size = (int)v.size(); - - try{ comm.Send(&size, 1, MPI::INT, dest, tag); } - catch(MPI::Exception& e){ std::stringstream ss; ss<<"MPI::Exception error_string="<<e.Get_error_string()<<std::endl; - UB_THROW( UbException(UB_EXARGS,"MPI:Exception catched with info at send size\n"+ss.str()) ); } - catch(...) { UB_THROW( UbException(UB_EXARGS,"unknown exception at send size") ); } - - if(size>0) - { - try{ comm.Send(&v[0], size, datatype, dest, tag); } - catch(MPI::Exception& e){ std::stringstream ss; ss<<"MPI::Exception error_string="<<e.Get_error_string()<<std::endl; - UB_THROW( UbException(UB_EXARGS,"MPI:Exception catched with info at send vector<T>\n"+ss.str()) );} - catch(...) { UB_THROW( UbException(UB_EXARGS,"unknown exception at send vector<T>") ); } - } -} -/*======================================================================*/ -// receive a vector of MPI_Datatype -template <class T> -void PbMpiTools::receiveVector(std::vector<T>& v, MPI_Datatype datatype, int source, int tag, MPI::Intracomm comm) -{ - int size; - - try { comm.Recv(&size, 1, MPI::INT, source, tag); } - catch(MPI::Exception& e){ std::stringstream ss;ss<<"MPI::Exception error_string="<<e.Get_error_string()<<std::endl; - UB_THROW( UbException(UB_EXARGS,"MPI:Exception catched with info at receive size\n"+ss.str()) );} - catch(...) { UB_THROW( UbException(UB_EXARGS,"unknown exception at receive size") ); } - - v.resize(size); - - if( size>0 ) - { - try{ comm.Recv(&v[0], size, datatype, source, tag); } - catch(MPI::Exception& e){ std::stringstream ss; ss<<"MPI::Exception error_string="<<e.Get_error_string()<<std::endl; - UB_THROW( UbException(UB_EXARGS,"MPI:Exception catched with info at receive vector\n"+ss.str()) ); } - catch(...) { UB_THROW( UbException(UB_EXARGS,"unknown exception at receive vector") ); } - } -} -/*======================================================================*/ -// receive a vector of MPI_Datatype and adds this vector to existing vector -// return value is size of received elements -template <class T> -int PbMpiTools::receiveVectorAndAddToVector(std::vector<T>& v, MPI_Datatype datatype, int source, int tag, MPI::Intracomm comm) -{ - int incommingSize; - - try { comm.Recv(&incommingSize, 1, MPI::INT, source, tag); } - catch(MPI::Exception& e){ std::stringstream ss;ss<<"MPI::Exception error_string="<<e.Get_error_string()<<std::endl; - UB_THROW( UbException(UB_EXARGS,"MPI:Exception catched with info at receive size\n"+ss.str()) );} - catch(...) { UB_THROW( UbException(UB_EXARGS,"unknown exception at receive size") ); } - - int oldSize = (int)v.size(); - v.resize(oldSize+incommingSize); - - if( incommingSize>0 ) - { - try{ comm.Recv(&v[oldSize], incommingSize, datatype, source, tag); } - catch(MPI::Exception& e){ std::stringstream ss; ss<<"MPI::Exception error_string="<<e.Get_error_string()<<std::endl; - UB_THROW( UbException(UB_EXARGS,"MPI:Exception catched with info at receive vector\n"+ss.str()) ); } - catch(...) { UB_THROW( UbException(UB_EXARGS,"unknown exception at receive vector") ); } - } - - return incommingSize; -} -/*======================================================================*/ -// send a vector of strings -void PbMpiTools::sendStringVector(const std::vector<std::string>& v, int dest, int tag, MPI::Intracomm comm) -{ - // send size - int stringVectorSize = (int)v.size(); - - try{ comm.Send(&stringVectorSize, 1, MPI::INT, dest, tag); } - catch(MPI::Exception& e){ std::stringstream ss; ss<<"MPI::Exception error_string="<<e.Get_error_string()<<std::endl; - UB_THROW( UbException(UB_EXARGS,"MPI:Exception catched with info at send size\n"+ss.str()) ); } - catch(...) { UB_THROW( UbException(UB_EXARGS,"unknown exception at send size") ); } - - if(stringVectorSize>0) - { - std::vector<int> singleStringSizes(stringVectorSize+1); - int nofChars = 0; - for(int i=0; i<stringVectorSize; i++) - nofChars += singleStringSizes[i] = (int)v[i].length(); - singleStringSizes[stringVectorSize] = nofChars; - - try{ comm.Send(&singleStringSizes[0], stringVectorSize+1, MPI::INT, dest, tag); } - catch(MPI::Exception& e){ std::stringstream ss; ss<<"MPI::Exception error_string="<<e.Get_error_string()<<std::endl; - UB_THROW( UbException(UB_EXARGS,"MPI:Exception catched with info at send vector<T>\n"+ss.str()) );} - catch(...) { UB_THROW( UbException(UB_EXARGS,"unknown exception at send vector<T>") ); } - - std::vector<char> charVector(nofChars); - int pos = 0; - for(int i=0; i<stringVectorSize; i++) - for(int j=0; j<singleStringSizes[i]; j++) - charVector[pos++] = v[i][j]; - - try{ comm.Send(&charVector[0], nofChars, MPI::CHAR, dest, tag); } - catch(MPI::Exception& e){ std::stringstream ss; ss<<"MPI::Exception error_string="<<e.Get_error_string()<<std::endl; - UB_THROW( UbException(UB_EXARGS,"MPI:Exception catched with info at send vector<T>\n"+ss.str()) );} - catch(...) { UB_THROW( UbException(UB_EXARGS,"unknown exception at send vector<T>") ); } - } -} -/*======================================================================*/ -// send a vector of strings -void PbMpiTools::receiveStringVector(std::vector<std::string>& v, int source, int tag, MPI::Intracomm comm) -{ - // send size - int stringVectorSize; - try { comm.Recv(&stringVectorSize, 1, MPI::INT, source, tag); } - catch(MPI::Exception& e){ std::stringstream ss; ss<<"MPI::Exception error_string="<<e.Get_error_string()<<std::endl; - UB_THROW( UbException(UB_EXARGS,"MPI:Exception catched with info at send size\n"+ss.str()) ); } - catch(...) { UB_THROW( UbException(UB_EXARGS,"unknown exception at send size") ); } - - v.clear(); - v.resize(stringVectorSize); - - if(stringVectorSize>0) - { - std::vector<int> singleStringSizes(stringVectorSize+1); - - try{ comm.Recv(&singleStringSizes[0], stringVectorSize+1, MPI::INT, source, tag); } - catch(MPI::Exception& e){ std::stringstream ss; ss<<"MPI::Exception error_string="<<e.Get_error_string()<<std::endl; - UB_THROW( UbException(UB_EXARGS,"MPI:Exception catched with info at send vector<T>\n"+ss.str()) );} - catch(...) { UB_THROW( UbException(UB_EXARGS,"unknown exception at send vector<T>") ); } - - int nofChars = singleStringSizes[stringVectorSize]; - std::vector<char> charVector(nofChars); - - try{ comm.Recv(&charVector[0], nofChars, MPI::CHAR, source, tag); } - catch(MPI::Exception& e){ std::stringstream ss; ss<<"MPI::Exception error_string="<<e.Get_error_string()<<std::endl; - UB_THROW( UbException(UB_EXARGS,"MPI:Exception catched with info at send vector<T>\n"+ss.str()) );} - catch(...) { UB_THROW( UbException(UB_EXARGS,"unknown exception at send vector<T>") ); } - - int pos=0; - for(int i=0; i<stringVectorSize; i++) - for(int j=0; j<singleStringSizes[i]; j++) - v[i].push_back(charVector[pos++]); - } -} - -#endif - -#endif //PBMPITOOLS_H diff --git a/src/basics/basics/parallel/examples/simpleMPI/CMakeLists.txt b/src/basics/basics/parallel/examples/simpleMPI/CMakeLists.txt deleted file mode 100644 index a44b5c76e4b9b5e805f501b94d895a6f7026c039..0000000000000000000000000000000000000000 --- a/src/basics/basics/parallel/examples/simpleMPI/CMakeLists.txt +++ /dev/null @@ -1,64 +0,0 @@ -cmake_minimum_required(VERSION 2.6) - -INCLUDE("../../../../CMakeCABMacros.txt") -INCLUDE("../../../../CMakeSetCompilerFlags.txt") - -CHECK_FOR_VARIABLE(CAB_MACHINE "machine name, e.g. ALTIX, ARWEN") -SET(CMAKE_CONFIG_FILE "${SOURCE_ROOT}/cmake_config_files/${CAB_MACHINE}.config.cmake") - -PROJECT(simpleMPI) - -#erst hier das config file einfügen, ansonsten werden manche settings durch (Project) überschrieben) -INCLUDE(${CMAKE_CONFIG_FILE}) - -SET(EXECUTABLE_NAME simpleMPI) - -################################################################ -## PACKAGES ### -################################################################ -INCLUDE(${SOURCE_ROOT}/basics/utilities/CMakePackage.txt) -INCLUDE(${SOURCE_ROOT}/basics/memory/CMakePackage.txt) -INCLUDE(${SOURCE_ROOT}/basics/parallel/CMakePackage.txt) - -################################################################# -### OWN DEFINES ### -################################################################# -SET(ALL_SOURCES ${ALL_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp ) - -SOURCE_GROUP(main FILES ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp ) - -ADD_CXX_FLAGS("/wd4996") #deprecated strcpy... - -################################################################# -### MPI ### -################################################################# -SET_MPI_STUFF(CAB_MACHINE) -SET(EXECUTABLE_NAME ${EXECUTABLE_NAME}_mpi) - -################################################################# -### EXCECUTABLE ### -################################################################# -ADD_EXECUTABLE(${EXECUTABLE_NAME} ${ALL_SOURCES} ) - -################################################################# -### ADDITIONAL LINK LIBRARIES ### -################################################################# -IF(ADDITIONAL_LINK_LIBRARIES) - TARGET_LINK_LIBRARIES(${EXECUTABLE_NAME} ${ADDITIONAL_LINK_LIBRARIES}) -ENDIF(ADDITIONAL_LINK_LIBRARIES) - -################################################################# -### ADDITIONAL LINK PROPERTIES ### -################################################################# -IF(ADDITIONAL_LINK_PROPS) - SET_TARGET_PROPERTIES(${EXECUTABLE_NAME} PROPERTIES LINK_FLAGS ${ADDITIONAL_LINK_PROPS}) -ENDIF(ADDITIONAL_LINK_PROPS) -IF(ADDITIONAL_LINK_PROPS_DEBUG) - SET_TARGET_PROPERTIES(${EXECUTABLE_NAME} PROPERTIES LINK_FLAGS_DEBUG ${ADDITIONAL_LINK_PROPS_DEBUG}) -ENDIF(ADDITIONAL_LINK_PROPS_DEBUG) -IF(ADDITIONAL_LINK_PROPS_RELEASE) - SET_TARGET_PROPERTIES(${EXECUTABLE_NAME} PROPERTIES LINK_FLAGS_RELEASE ${ADDITIONAL_LINK_PROPS_RELEASE}) -ENDIF(ADDITIONAL_LINK_PROPS_RELEASE) - - - diff --git a/src/basics/basics/parallel/examples/simpleMPI/functions.h b/src/basics/basics/parallel/examples/simpleMPI/functions.h deleted file mode 100644 index 38005eca57b1a61a5a862169716afc49bb3cda5d..0000000000000000000000000000000000000000 --- a/src/basics/basics/parallel/examples/simpleMPI/functions.h +++ /dev/null @@ -1,193 +0,0 @@ -#include <iostream> -#include <stdlib.h> -#include <stdio.h> -#include <string> -#include <fstream> - -#include <basics/utilities/UbTuple.h> - -#include <basics/utilities/UbException.h> -#include <basics/utilities/UbSystem.h> -#include <basics/utilities/UbFileOutputASCII.h> -#include <basics/utilities/UbTiming.h> - -#include <basics/memory/MbSmartPtr.h> - -#include <basics/container/CbVector.h> -#include <basics/container/CbVectorPool.h> - -using std::cout; -using std::cerr; -using std::endl; -using std::vector; - -typedef long double value_type; -typedef MbSmartPtr<CbVector< value_type > > CbVectorPtr; -typedef MbSmartPtr<vector< value_type > > StlVectorPtr; - -/*==========================================================*/ -template<typename T> -inline void setValues(vector<T>& stlvec, CbVector<T>& cbvec, CbVector<T>& cbpoolvec) -{ - if(stlvec.size() != cbvec.size() || stlvec.size() != cbpoolvec.size() ) - { - cerr<<"sizes:"<<endl; - cerr<<"stlvec... = "<<(int)stlvec.size()<<endl; - cerr<<"cbvec.... = "<<(int)cbvec.size()<<endl; - cerr<<"cbpoolvec = "<<(int)cbpoolvec.size()<<endl; - throw UB_THROW( UbException("setValues - sizeCheck failed") ); - } - static value_type stlVal = 1; - static value_type cbVal = 1; - static value_type cbPoolVal = 1; - - for(size_t i=0; i<cbvec.size(); i++) stlvec[i] = stlVal ++; - for(size_t i=0; i<cbvec.size(); i++) cbvec[i] = cbVal ++; - for(size_t i=0; i<cbvec.size(); i++) cbpoolvec[i] = cbPoolVal++; -} -/*==========================================================*/ -template<typename T> -inline void setValues(vector< StlVectorPtr >& stlvecs, vector< CbVectorPtr >& cbvecs, vector< CbVectorPtr >& cbpoolvecs) -{ - if(stlvecs.size() != cbvecs.size() || stlvecs.size() != cbpoolvecs.size() ) - { - cerr<<"sizes:"<<endl; - cerr<<"stlvec... = "<<(int)stlvecs.size()<<endl; - cerr<<"cbvec.... = "<<(int)cbvecs.size()<<endl; - cerr<<"cbpoolvec = "<<(int)cbpoolvecs.size()<<endl; - UB_THROW( UbException("setValues glob - sizeCheck failed") ); - } - - for(size_t i=0; i<cbvecs.size(); i++) - setValues(*stlvecs[i],*cbvecs[i],*cbpoolvecs[i]); -} -/*==========================================================*/ -template<typename T> -inline void resize(vector<T>& stlvec, CbVector<T>& cbvec, CbVector<T>& cbpoolvec, std::size_t size, const T& val) -{ - stlvec.resize(size,val); - cbvec.resize(size,val); - cbpoolvec.resize(size,val); -} -/*==========================================================*/ -template<typename T> -inline void resize(vector< StlVectorPtr >& stlvecs, vector< CbVectorPtr >& cbvecs, vector< CbVectorPtr >& cbpoolvecs, std::size_t size, const value_type& val, bool timed=false) -{ - if(stlvecs.size() != cbvecs.size() || stlvecs.size() != cbpoolvecs.size() ) - { - cerr<<"sizes:"<<endl; - cerr<<"stlvec... = "<<(int)stlvecs.size()<<endl; - cerr<<"cbvec.... = "<<(int)cbvecs.size()<<endl; - cerr<<"cbpoolvec = "<<(int)cbpoolvecs.size()<<endl; - UB_THROW( UbException("resize glob - sizeCheck failed") ); - } - - if(timed) - { - UbTimer timer; - timer.start(); for(size_t i=0; i<cbvecs.size(); i++) stlvecs[i]->resize(size,val); if(timed) cout<<"stl-resize in "<<timer.stop()<<"s"<<endl; - timer.start(); for(size_t i=0; i<cbvecs.size(); i++) cbvecs[i]->resize(size,val); if(timed) cout<<"cbStd-resize in "<<timer.stop()<<"s"<<endl; - timer.start(); for(size_t i=0; i<cbvecs.size(); i++) cbpoolvecs[i]->resize(size,val); if(timed) cout<<"cbPool-resize in "<<timer.stop()<<"s"<<endl; - } - else - { - for(size_t i=0; i<cbvecs.size(); i++) - resize(*stlvecs[i],*cbvecs[i],*cbpoolvecs[i],size,val); - } -} -/*==========================================================*/ -template<typename T> -inline void createVecs(size_t number, int size,vector< StlVectorPtr >& stlvecs, vector< CbVectorPtr >& cbvecs, vector< CbVectorPtr >& cbpoolvecs, CbVectorPool<value_type>*& pool, bool timed=false) -{ - UbTimer timer; - timer.start(); for(size_t i=0; i<number; i++) stlvecs.push_back(StlVectorPtr(new vector<value_type>(size))); if(timed) cout<<"stl-createVecs in "<<timer.stop()<<"s"<<endl; - timer.start(); for(size_t i=0; i<number; i++) cbvecs.push_back(CbVectorPtr(new CbVector<value_type>(size))); if(timed) cout<<"cbStd-createVecs in "<<timer.stop()<<"s"<<endl; - timer.start(); for(size_t i=0; i<number; i++) cbpoolvecs.push_back(CbVectorPtr(new CbVector<value_type>(size,new CbVectorAllocatorPool<value_type>(pool)))); if(timed) cout<<"cbPool-createVecs in "<<timer.stop()<<"s"<<endl; - - for(size_t i=0; i<cbvecs.size(); i++) setValues(*stlvecs.back(),*cbvecs.back(),*cbpoolvecs.back()); -} -/*==========================================================*/ -template<typename T> -inline void createVecs(size_t number, size_t size, const value_type& val,vector< StlVectorPtr >& stlvecs, vector< CbVectorPtr >& cbvecs, vector< CbVectorPtr >& cbpoolvecs, CbVectorPool<value_type>*& pool, bool timed=false) -{ - UbTimer timer; - timer.start(); for(size_t i=0; i<number; i++) stlvecs.push_back(StlVectorPtr(new vector<value_type>(size,val))); if(timed) cout<<"stl-createVecs in "<<timer.stop()<<"s"<<endl; - timer.start(); for(size_t i=0; i<number; i++) cbvecs.push_back(CbVectorPtr(new CbVector<value_type>(size,new CbVectorAllocatorStd<value_type>(),val))); if(timed) cout<<"cbStd-createVecs in "<<timer.stop()<<"s"<<endl; - timer.start(); for(size_t i=0; i<number; i++) cbpoolvecs.push_back(CbVectorPtr(new CbVector<value_type>(size,new CbVectorAllocatorPool<value_type>(pool),val))); if(timed) cout<<"cbPool-createVecs in "<<timer.stop()<<"s"<<endl; -} -/*==========================================================*/ -template<typename T> -inline void equalCheck(vector<T>& stlvec, CbVector<T>& cbvec, CbVector<T>& cbpoolvec) -{ - if(stlvec.size() != cbvec.size() || stlvec.size() != cbpoolvec.size() ) - { - cerr<<"sizes:"<<endl; - cerr<<"stlvec... = "<<(int)stlvec.size()<<endl; - cerr<<"cbvec.... = "<<(int)cbvec.size()<<endl; - cerr<<"cbpoolvec = "<<(int)cbpoolvec.size()<<endl; - throw UB_THROW( UbException("equalCheck - sizeCheck failed") ); - } - - bool check=true; - for(size_t i=0; i<cbvec.size(); i++) - if(stlvec[i] != cbvec[i] || stlvec[i] != cbpoolvec[i] ) - check=false; - - if(!check) - { - cerr<<"\nstl - "; for(size_t i=0; i<cbvec.size(); i++) cout<<stlvec[i]<<" "; cout<<endl; - cerr<< "cbv - "; for(size_t i=0; i<cbvec.size(); i++) cout<<cbvec[i]<<" "; cout<<endl; - cerr<< "cbp - "; for(size_t i=0; i<cbvec.size(); i++) cout<<cbpoolvec[i]<<" "; cout<<endl; - throw UB_THROW( UbException("equalCheck - equalCheck failed") ); - } -} -/*==========================================================*/ -template<typename T> -void equalCheck(vector< StlVectorPtr >& stlvecs, vector< CbVectorPtr >& cbvecs, vector< CbVectorPtr >& cbpoolvecs) -{ - if(stlvecs.size() != cbvecs.size() || stlvecs.size() != cbpoolvecs.size() ) - { - cerr<<"sizes:"<<endl; - cerr<<"stlvec... = "<<(int)stlvecs.size()<<endl; - cerr<<"cbvec.... = "<<(int)cbvecs.size()<<endl; - cerr<<"cbpoolvec = "<<(int)cbpoolvecs.size()<<endl; - UB_THROW( UbException("equalCheck - sizeCheck failed") ); - } - - for(size_t i=0; i<cbvecs.size(); i++) - { - //cout<<"equalCheck i="<<i<<"/"<<cbvecs.size()-1; - equalCheck(*stlvecs[i],*cbvecs[i],*cbpoolvecs[i]); - //cout<<" passed"<<endl; - } -} -/*==========================================================*/ -template<typename T> -void accessCheck(int times,vector< StlVectorPtr >& stlvecs, vector< CbVectorPtr >& cbvecs, vector< CbVectorPtr >& cbpoolvecs) -{ - UbTimer timer; - timer.start(); - for(size_t i=0; i<stlvecs.size(); i++) - { - vector<value_type>& vec = *stlvecs[i]; - for(int m=0; m<times; m++) - for(vector<value_type>::size_type k=0; k<vec.size(); k++) vec[k] = k; - } - cout<<"stl-accessCheck in "<<timer.stop()<<"s"<<endl; - timer.start(); - for(size_t i=0; i<cbvecs.size(); i++) - { - CbVector<value_type>& vec = *cbvecs[i]; - for(int m=0; m<times; m++) - for(vector<value_type>::size_type k=0; k<vec.size(); k++) vec[k] = k; - } - cout<<"cbStd-accessCheck in "<<timer.stop()<<"s"<<endl; - timer.start(); - for(size_t i=0; i<cbpoolvecs.size(); i++) - { - CbVector<value_type>& vec = *cbpoolvecs[i]; - for(int m=0; m<times; m++) - for(vector<value_type>::size_type k=0; k<vec.size(); k++) vec[k] = k; - } - cout<<"cbPool-accessCheck in "<<timer.stop()<<"s"<<endl; -} diff --git a/src/basics/basics/parallel/examples/simpleMPI/main.cpp b/src/basics/basics/parallel/examples/simpleMPI/main.cpp deleted file mode 100644 index 18c2769e02e8ad571eba9a0805996257f4b743f8..0000000000000000000000000000000000000000 --- a/src/basics/basics/parallel/examples/simpleMPI/main.cpp +++ /dev/null @@ -1,101 +0,0 @@ -#include <iostream> -#include <vector> -#include <algorithm> -#include <mpi.h> - -#include <basics/utilities/UbSystem.h> -#include <basics/utilities/UbException.h> -#include <basics/utilities/UbLogger.h> - -using namespace std; - -int randomNumber () { return (rand()%100); } - -struct RankSetter{ - RankSetter(int rank) : rank(rank) {} - - int operator()() - { - return rank; - } - - int rank; -} /*rankSetter*/; - - -////////////////////////////////////////////////////////////////////////// -int main(int argc, char** argv) -{ - MPI::Init(argc, argv); - MPI::COMM_WORLD.Set_errhandler(MPI::ERRORS_THROW_EXCEPTIONS); - - try - { - MPI::Intracomm comm = MPI::COMM_WORLD; - - int rank = comm.Get_rank(); - - vector<int> sendData(1000,0); - generate(sendData.begin(), sendData.end(), RankSetter(rank+1) ); - - vector<int> recvData(1000,0); - - if(rank==0) - { - UBLOG(logINFO,"rank="<<rank<<" - recv request"); - MPI::Request request = comm.Irecv(&recvData[0], (int)recvData.size(), MPI::INT, 1, 100); - UBLOG(logINFO,"rank="<<rank<<" - sendData"); - comm.Ssend(&sendData[0],(int)sendData.size(), MPI::INT, 1, 100); - sendData.back() = 999; - - UBLOG(logINFO,"rank="<<rank<<" - Wait"); - request.Wait(); - UBLOG(logINFO,"rank="<<rank<<" - all data received, last = "<<recvData.back()); - } - else if(rank == 1) - { - UbSystem::sleepS(5); - UBLOG(logINFO,"rank="<<rank<<" - recv request"); - MPI::Request request = comm.Irecv(&recvData[0],(int)recvData.size(), MPI::INT, 0, 100); - - request.Wait(); - UBLOG(logINFO,"rank="<<rank<<" - all data received, last = "<<recvData.back()); - - UbSystem::sleepS(5); - UBLOG(logINFO,"rank="<<rank<<" - sendData"); - comm.Ssend(&sendData[0],(int)sendData.size(), MPI::INT, 0, 100); - sendData.back() = 999; - UBLOG(logINFO,"rank="<<rank<<" - data sent"); - } - else - { - throw UB_THROW( UbException(UB_EXARGS,"only two ranks allwoed") ); - } - - UBLOG(logINFO,"rank="<<rank<<" barrier start"); - MPI::COMM_WORLD.Barrier(); - UBLOG(logINFO,"rank="<<rank<<" barrier done "); - - } - catch(const std::exception& e) - { - UBLOG2( logERROR,std::cerr, "caught exception:" ); - UBLOG2( logERROR,std::cerr, "type: " << typeid(e).name() ); - UBLOG2ML(logERROR,std::cerr, "what: " << e.what() ); - } - catch(MPI::Exception e) - { - UBLOG2ML(logERROR,std::cerr, "caught exception:" << e.Get_error_string()); - - MPI::COMM_WORLD.Abort(99); - } - catch(...) - { - UBLOG2(logERROR,std::cerr,"Verdammte Scheisse - mal wieder Mist gebaut!"); - } - - MPI::Finalize(); - - return 0; -} - diff --git a/src/basics/basics/relation/RbAggregation.h b/src/basics/basics/relation/RbAggregation.h deleted file mode 100644 index c86c07fdddbbe3207888fc4e287bd7862045d212..0000000000000000000000000000000000000000 --- a/src/basics/basics/relation/RbAggregation.h +++ /dev/null @@ -1,70 +0,0 @@ -#ifndef RBAGGREGATION_H -#define RBAGGREGATION_H - -#include <sstream> -#include <iostream> -#include <map> - -using namespace std; - -template <class T1, class T2> -class RbAggregation -{ -private: - string name; - std::multimap<T1,T2> obj1Map; - std::multimap<T2,T1> obj2Map; - -public: - RbAggregation(string name) - { - this->name = name; - } - /*=========================================================================*/ - void insertPair(T1& to1, T2& to2) - { - obj1Map.insert(pair<T1,T2>(to1,to2)); - obj2Map.insert(pair<T2,T1>(to2,to1)); - } - /*=========================================================================*/ - int countObj2forObj1(T1& to1) - { - return((int)obj1Map.count(to1)); - } - - /*=========================================================================*/ - int countObj1forObj2(T2& to2) - { - return((int)obj2Map.count(to2)); - } - /*=========================================================================*/ - vector<T2> getObj2vectorForObj1(T1& to1) - { - vector<T2> obj2vector; - unsigned number = (unsigned)obj1Map.count(to1); - typedef std::multimap<T1, T2>::iterator obj1MapIterator = obj1Map.find(to1); - for(unsigned u =0; u<number; u++) - { - obj2vector.push_back(obj1MapIterator->second); - obj1MapIterator++; - } - return obj2vector; - } - ///*=========================================================================*/ - vector<T1> getObj1vectorForObj2(T2& to2) - { - vector<T1> obj1vector; - unsigned number = (unsigned)obj2Map.count(to2); - typedef std::multimap<T2, T1>::iterator obj2MapIterator = obj2Map.find(to2); - for(unsigned u =0; u<number; u++) - { - obj1vector.push_back(obj2MapIterator->second); - obj2MapIterator++; - } - return obj1vector; - } -}; -/*=========================================================================*/ -#endif - - diff --git a/src/basics/basics/transmitter/package.include b/src/basics/basics/transmitter/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/basics/basics/utilities/UbAutoRun.hpp b/src/basics/basics/utilities/UbAutoRun.hpp deleted file mode 100644 index 50fcf37b648b87502516a34dab93260e619d9d95..0000000000000000000000000000000000000000 --- a/src/basics/basics/utilities/UbAutoRun.hpp +++ /dev/null @@ -1,58 +0,0 @@ -#ifndef UB_AUTORUN_HPP -#define UB_AUTORUN_HPP - -#define UB_AUTO_RUN(func) UB_AUTO_RUN_(func, __LINE__) -#define UB_AUTO_RUN_(func, nID) UB_AUTO_RUN__(func, nID) -#define UB_AUTO_RUN__(func, nID) UB_AUTO_RUN___(func, nID) -#define UB_AUTO_RUN___(func, ID) \ - namespace { \ - struct UbAutoRun##ID { \ - UbAutoRun##ID() { \ - func; \ - } \ - } UbAutoRunInst##ID; \ - } - - // More concise to implement UB_AUTO_RUN using the following, but BCB emits an ICE on it. - //static bool UB_AutoRun##ID = ( func , false); - - -#define UB_AUTO_RUN_1(func) UB_AUTO_RUN_NAMED(func, 1) -#define UB_AUTO_RUN_2(func) UB_AUTO_RUN_NAMED(func, 2) -#define UB_AUTO_RUN_3(func) UB_AUTO_RUN_NAMED(func, 3) -#define UB_AUTO_RUN_4(func) UB_AUTO_RUN_NAMED(func, 4) -#define UB_AUTO_RUN_5(func) UB_AUTO_RUN_NAMED(func, 5) - -#define UB_AUTO_RUN_NAMED(func, name) UB_AUTO_RUN_NAMED_(func, name, __LINE__) -#define UB_AUTO_RUN_NAMED_(func, name, nID) UB_AUTO_RUN_NAMED__(func, name, nID) -#define UB_AUTO_RUN_NAMED__(func, name, nID) UB_AUTO_RUN___(func, _##name##_##nID) - -#define UB_AUTO_RUN_ONCE(func) UB_AUTO_RUN_ONCE_(func, __LINE__) -#define UB_AUTO_RUN_ONCE_(func, nID) UB_AUTO_RUN_ONCE__(func, nID) -#define UB_AUTO_RUN_ONCE__(func, nID) UB_AUTO_RUN_ONCE___(func, nID) -#define UB_AUTO_RUN_ONCE___(func, ID) \ - struct UbAutoRunOnce##ID { \ - UbAutoRunOnce##ID() { \ - if (!init()) { \ - init() = true; \ - func; \ - } \ - } \ - static bool &init() { \ - static bool bInit = false; \ - return bInit; \ - } \ - }; \ - static UbAutoRunOnce##ID AutoRunOnceInst##ID; - -#define UB_AUTO_RUN_ONCE_1(func) UB_AUTO_RUN_ONCE_NAMED(func, 1) -#define UB_AUTO_RUN_ONCE_2(func) UB_AUTO_RUN_ONCE_NAMED(func, 2) -#define UB_AUTO_RUN_ONCE_3(func) UB_AUTO_RUN_ONCE_NAMED(func, 3) -#define UB_AUTO_RUN_ONCE_4(func) UB_AUTO_RUN_ONCE_NAMED(func, 4) -#define UB_AUTO_RUN_ONCE_5(func) UB_AUTO_RUN_ONCE_NAMED(func, 5) - -#define UB_AUTO_RUN_ONCE_NAMED(func, name) UB_AUTO_RUN_ONCE_NAMED_(func, name, __LINE__) -#define UB_AUTO_RUN_ONCE_NAMED_(func, name, nID) UB_AUTO_RUN_ONCE_NAMED__(func, name, nID) -#define UB_AUTO_RUN_ONCE_NAMED__(func, name, nID) UB_AUTO_RUN_ONCE___(func, _##name##_##nID) - -#endif // ! UB_AUTORUN_HPP diff --git a/src/basics/basics/utilities/UbComparators.h b/src/basics/basics/utilities/UbComparators.h index ee809cf1c8ac1ef369ed0a9828401380d7da5300..abde770000e220422f06bae6ba83640ef9c45f15 100644 --- a/src/basics/basics/utilities/UbComparators.h +++ b/src/basics/basics/utilities/UbComparators.h @@ -1,17 +1,40 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file UbComparators.h +//! \ingroup utilities +//! \author Soeren Freudiger, Sebastian Geller +//======================================================================================= #ifndef UBCOMPARATORS_H #define UBCOMPARATORS_H #include <functional> -/*=========================================================================*/ -/* UbComparators */ -/* */ -/** -<BR><BR> -@author <A HREF="mailto:muffmolch@gmx.de">S. Freudiger</A> -@version 1.0 - 16.08.2007 -*/ - namespace UbComparators { //type_traits diff --git a/src/basics/basics/utilities/UbConverter.cpp b/src/basics/basics/utilities/UbConverter.cpp deleted file mode 100644 index dcdf17f5d39f4d8c2be285fb15d3e6c5bae306cd..0000000000000000000000000000000000000000 --- a/src/basics/basics/utilities/UbConverter.cpp +++ /dev/null @@ -1,96 +0,0 @@ -#include <basics/utilities/UbConverter.h> - -const std::string UbConverter::base64_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" - "abcdefghijklmnopqrstuvwxyz" - "0123456789+/"; - - -std::string UbConverter::base64_encode(unsigned char const* bytes_to_encode, unsigned int in_len) -{ - std::string ret; - int i = 0; - int j = 0; - unsigned char char_array_3[3]; - unsigned char char_array_4[4]; - - while (in_len--) - { - char_array_3[i++] = *(bytes_to_encode++); - if( i==3) - { - char_array_4[0] = ( char_array_3[0] & 0xfc) >> 2; - char_array_4[1] = ((char_array_3[0] & 0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4); - char_array_4[2] = ((char_array_3[1] & 0x0f) << 2) + ((char_array_3[2] & 0xc0) >> 6); - char_array_4[3] = char_array_3[2] & 0x3f; - - for( i=0; i<4 ; i++) - ret += base64_chars[char_array_4[i]]; - i=0; - } - } - - if( i ) - { - for( j=i; j<3; j++) - char_array_3[j] = '\0'; - - char_array_4[0] = ( char_array_3[0] & 0xfc) >> 2; - char_array_4[1] = ((char_array_3[0] & 0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4); - char_array_4[2] = ((char_array_3[1] & 0x0f) << 2) + ((char_array_3[2] & 0xc0) >> 6); - char_array_4[3] = char_array_3[2] & 0x3f; - - for ( j=0; j<i+1; j++) - ret += base64_chars[char_array_4[j]]; - - while( i++<3 ) - ret += '='; - } - - return ret; -} -/*=======================================================*/ -std::string UbConverter::base64_decode(std::string const& encoded_string) -{ - int in_len = (int)encoded_string.size(); - int i = 0; - int j = 0; - int in_ = 0; - unsigned char char_array_4[4], char_array_3[3]; - std::string ret; - - while (in_len-- && ( encoded_string[in_] != '=') && is_base64(encoded_string[in_])) - { - char_array_4[i++] = encoded_string[in_]; in_++; - if(i ==4) - { - for (i = 0; i <4; i++) - char_array_4[i] = (unsigned char)base64_chars.find(char_array_4[i]); - - char_array_3[0] = (char_array_4[0] << 2) + ((char_array_4[1] & 0x30) >> 4); - char_array_3[1] = ((char_array_4[1] & 0xf) << 4) + ((char_array_4[2] & 0x3c) >> 2); - char_array_3[2] = ((char_array_4[2] & 0x3) << 6) + char_array_4[3]; - - for (i = 0; (i < 3); i++) - ret += char_array_3[i]; - i = 0; - } - } - - if( i ) - { - for(j = i; j <4; j++) - char_array_4[j] = 0; - - for(j = 0; j <4; j++) - char_array_4[j] = (unsigned char)base64_chars.find(char_array_4[j]); - - char_array_3[0] = (char_array_4[0] << 2) + ((char_array_4[1] & 0x30) >> 4); - char_array_3[1] = ((char_array_4[1] & 0xf) << 4) + ((char_array_4[2] & 0x3c) >> 2); - char_array_3[2] = ((char_array_4[2] & 0x3) << 6) + char_array_4[3]; - - for(j = 0; (j < i - 1); j++) - ret += char_array_3[j]; - } - - return ret; -} diff --git a/src/basics/basics/utilities/UbConverter.h b/src/basics/basics/utilities/UbConverter.h deleted file mode 100644 index 7fd99c689e2098a3422003e658ce91a7cfb958dc..0000000000000000000000000000000000000000 --- a/src/basics/basics/utilities/UbConverter.h +++ /dev/null @@ -1,49 +0,0 @@ -// _ ___ __ __________ _ __ -// | | / (_)____/ /___ ______ _/ / ____/ /_ __(_)___/ /____ -// | | / / / ___/ __/ / / / __ `/ / /_ / / / / / / __ / ___/ -// | |/ / / / / /_/ /_/ / /_/ / / __/ / / /_/ / / /_/ (__ ) -// |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/ -// -#ifndef UBCONVERTER_H -#define UBCONVERTER_H - -#include <cstdlib> -#include <ctime> -#include <cassert> -#include <string> - -/*=========================================================================*/ -/* UBConverter */ -/* */ -// -// encodes vals to e.g. base64 -// dencodes vals from e.g. base64 -// author <A HREF="mailto:muffmolch@gmx.de">S. Freudiger</A> -// version 1.0 - 22.10.2007 - - -class UbConverter -{ -public: - static std::string base64_encode(unsigned char const* , unsigned int len); - static std::string base64_decode(std::string const& s); - - static inline bool is_base64(const unsigned char& c) - { - return (isalnum(c) || (c == '+') || (c == '/')); - } - -protected: - UbConverter() {} - ~UbConverter() {} - -private: - UbConverter(const UbConverter&); // not implemented. - void operator=(const UbConverter&); //not implemented. - - static const std::string base64_chars; -}; - - - -#endif //UBCONVERTER_H diff --git a/src/basics/basics/utilities/UbEqual.h b/src/basics/basics/utilities/UbEqual.h index 8c01318af8a6c750f115466e26f3e86da21e0641..e748bec34fd33b1f14fa694a43e4ffcd26fbfaed 100644 --- a/src/basics/basics/utilities/UbEqual.h +++ b/src/basics/basics/utilities/UbEqual.h @@ -1,30 +1,55 @@ -// _ ___ __ __________ _ __ -// | | / (_)____/ /___ ______ _/ / ____/ /_ __(_)___/ /____ -// | | / / / ___/ __/ / / / __ `/ / /_ / / / / / / __ / ___/ -// | |/ / / / / /_/ /_/ / /_/ / / __/ / / /_/ / / /_/ (__ ) -// |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ // +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file UbEqual.h +//! \ingroup utilities +//! \author Soeren Freudiger, Sebastian Geller +//======================================================================================= #ifndef UBEQUAL_H #define UBEQUAL_H #include<cmath> ////////////////////////////////////////////////////////////////////////// -//isUbEqual<T1,T2>(a,b) -//vergleicht die gleichtheit der beiden werte a und b -// -//std-maessig wird hierfür der operator== verwendet -// -//Ausnahme: floating-points -//hier wird jeweils der "genauere typ zum ungenaueren gecastet und dann verglichen" -//e.g.: double d=1.2; int i=1; bool check = isUbEqual(d,i); -> true -// -//bei klassen muss hier operator== fuer const objecte implementiert sein!!! -//e.g.: bool operator==(const Test&) const { if(blabla) return true; else return false; } // +//! \brief isUbEqual<T1,T2>(a,b) +//! Compares the equality of values a and b. +//! +//! By default operator== is used for this. +//! +//! Execption: floating-point variables +//! In these cases the type with higher precision is casted to the type of lower precision +//! and then the two values are compared. +//! e.g.: double d=1.2; int i=1; bool check = isUbEqual(d,i); -> true +//! +//! For classes operator== must be implemented for const objects! +//! e.g.: bool operator==(const Test&) const { if(blabla) return true; else return false; } // -//author <A HREF="mailto:muffmolch@gmx.de">S. Freudiger</A> -//version 1.0 - 25.03.2008 ////////////////////////////////////////////////////////////////////////// //std-trait, fuer alle nicht spezifischen typen: @@ -43,7 +68,7 @@ struct UbEqualTrait< T, T > typedef T Low; }; -//spezialisierung für diverse Typen-Tuples +//spezialisierung fuer diverse Typen-Tuples template<> struct UbEqualTrait< short, int > { typedef int High; typedef short Low; }; template<> struct UbEqualTrait< short, long > { typedef long High; typedef short Low; }; template<> struct UbEqualTrait< short, float > { typedef float High; typedef short Low; }; diff --git a/src/basics/basics/utilities/UbException.h b/src/basics/basics/utilities/UbException.h index 45b013d11b7237eefd12f7d28f18e55e57789599..f999f8e13f4d37ac88ccfb72b2fcd2f581a0f3e1 100644 --- a/src/basics/basics/utilities/UbException.h +++ b/src/basics/basics/utilities/UbException.h @@ -1,9 +1,35 @@ -// _ ___ __ __________ _ __ -// | | / (_)____/ /___ ______ _/ / ____/ /_ __(_)___/ /____ -// | | / / / ___/ __/ / / / __ `/ / /_ / / / / / / __ / ___/ -// | |/ / / / / /_/ /_/ / /_/ / / __/ / / /_/ / / /_/ (__ ) -// |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ // +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file UbException.h +//! \ingroup utilities +//! \author Soeren Freudiger, Sebastian Geller +//======================================================================================= #ifndef UBEXCEPTION_H #define UBEXCEPTION_H @@ -15,25 +41,15 @@ #include "./UbTuple.h" -/*=========================================================================*/ -/* UbException */ -/* */ -/** -This Class provides the base for exception handling. -<BR><BR> -@author <A HREF="mailto:muffmolch@gmx.de">S. Freudiger</A> -@version 1.0 - 23.11.04 -@version 1.5 - 14.03.08 -@version 1.6 - 31.03.08 derivation from std::run_time_error -@version 1.6a - helper marco UB_EXARGS -*/ - -/* -usage: UB_THROW( UbException("error message") ); - UB_THROW( UbException(__FILE__, __LINE__,"error message") ); - UB_THROW( UbException(__FILE__, __LINE__,UB_FUNCTION,"error message") ); - UB_THROW( UbException(UB_EXARGS,"error") ); //same as above -*/ +//========================================================================= +// +//! \brief UbException +//! usage: UB_THROW( UbException("error message") ); +//! UB_THROW( UbException(__FILE__, __LINE__,"error message") ); +//! UB_THROW( UbException(__FILE__, __LINE__,UB_FUNCTION,"error message") ); +//! UB_THROW( UbException(UB_EXARGS,"error") ); //same as above +// +//========================================================================= //Macro UB_FUNCTION: figures out the method/function name (platform dependant) #if defined(__GNUC__) || (defined(__MWERKS__) && (__MWERKS__ >= 0x3000)) || (defined(__ICC) && (__ICC >= 600)) @@ -100,7 +116,7 @@ public: virtual const char* what() const throw() { exceptionString = this->toString(); - return exceptionString.c_str(); //ansonsten ist das Verhalten anschließend undefiniert! + return exceptionString.c_str(); //ansonsten ist das Verhalten anschliessend undefiniert! } /*==========================================================*/ virtual void addInfo(const std::string& err_str) diff --git a/src/basics/basics/utilities/UbInfinity.h b/src/basics/basics/utilities/UbInfinity.h index 5c889c894285fc7e4191fc44915a23de911692c8..229a14b23c79fc3bc95650bb272209f3b7392d23 100644 --- a/src/basics/basics/utilities/UbInfinity.h +++ b/src/basics/basics/utilities/UbInfinity.h @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file UbInfinity.h +//! \ingroup utilities +//! \author Soeren Freudiger, Sebastian Geller +//======================================================================================= #ifndef UB_INFINITY_H #define UB_INFINITY_H #include <limits> @@ -5,16 +37,14 @@ #include <basics/utilities/UbLimits.h> #include <basics/utilities/UbSystem.h> - ////////////////////////////////////////////////////////////////////////// -// -// UbNegInfinity -// Anm: keine template klasse, da man am Ende eine Instanz "inf" verwendet -// die in "verschiedene"(!!!) Typen konvertiert werden kann und nicht -// nur in den template Typ! -// Note: The UbNegInfinity class cannot be instantiated on its own, but works -// as a base class for the Infinity class. +//! +//! \brief UbNegInfinity +//! \details Note: The UbNegInfinity class cannot be instantiated on its own, but works +//! as a base class for the Infinity class. +//! ////////////////////////////////////////////////////////////////////////// + class UbNegInfinity { public: @@ -29,9 +59,9 @@ class UbNegInfinity inline operator double() const { return UbLimits<double>::ninf(); } inline operator long double() const { return UbLimits<long double>::ninf(); } - // This function compares built-in data types with their largest possible value. The function - // only works for built-in data types. The attempt to compare user-defined class types will - // result in a compile time error. + //! This function compares built-in data types with their largest possible value. The function + //! only works for built-in data types. The attempt to compare user-defined class types will + //! result in a compile time error. template< typename T > inline bool equal( const T& rhs ) const { @@ -81,7 +111,7 @@ inline bool operator!=( const T& lhs, const UbNegInfinity& rhs ) // UbInfinity // ////////////////////////////////////////////////////////////////////////// -class UbInfinity : public UbNegInfinity //um später -UbInfinity leichter zu implementieren!!! +class UbInfinity : public UbNegInfinity //um spaeter -UbInfinity leichter zu implementieren!!! { public: inline UbInfinity() diff --git a/src/basics/basics/utilities/UbKeys.h b/src/basics/basics/utilities/UbKeys.h index 609c08dbe0758e75e83488c9e3a04ebccc1079da..29713e75626aab7c8207f8d2dc73b788ea32a9e7 100644 --- a/src/basics/basics/utilities/UbKeys.h +++ b/src/basics/basics/utilities/UbKeys.h @@ -1,9 +1,35 @@ -// _ ___ __ __________ _ __ -// | | / (_)____/ /___ ______ _/ / ____/ /_ __(_)___/ /____ -// | | / / / ___/ __/ / / / __ `/ / /_ / / / / / / __ / ___/ -// | |/ / / / / /_/ /_/ / /_/ / / __/ / / /_/ / / /_/ (__ ) -// |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ // +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file UbKeys.h +//! \ingroup utilities +//! \author Soeren Freudiger, Sebastian Geller +//======================================================================================= #ifndef UBKEYS_H #define UBKEYS_H @@ -14,19 +40,12 @@ #include <3rdParty/rcf/RcfSerializationIncludes.h> #endif //CAB_RCF -/*=========================================================================*/ -/* UbKeys */ -/* */ -/** -namespace for global Keys (e.g. for STL-maps) -<BR><BR> -@author <A HREF="mailto:muffmolch@gmx.de">S. Freudiger</A> -@version 1.0 - 08.08.07 -*/ - -/* -usage: ... -*/ +////////////////////////////////////////////////////////////////////////// +//! +//! \brief +//! namespace for global Keys (e.g. for STL-maps) +//! +////////////////////////////////////////////////////////////////////////// namespace UbKeys { @@ -189,7 +208,6 @@ namespace UbKeys T1 t1; T2 t2; T3 t3; - }; ////////////////////////////////////////////////////////////////////////// diff --git a/src/basics/basics/utilities/UbLimits.h b/src/basics/basics/utilities/UbLimits.h index 30b03f2d9e494d8a3b42841441cc10bbd3fcac01..282ea2c74a151265957018dc805e4f1c369a86b6 100644 --- a/src/basics/basics/utilities/UbLimits.h +++ b/src/basics/basics/utilities/UbLimits.h @@ -1,9 +1,35 @@ -// _ ___ __ __________ _ __ -// | | / (_)____/ /___ ______ _/ / ____/ /_ __(_)___/ /____ -// | | / / / ___/ __/ / / / __ `/ / /_ / / / / / / __ / ___/ -// | |/ / / / / /_/ /_/ / /_/ / / __/ / / /_/ / / /_/ (__ ) -// |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ // +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file UbLimits.h +//! \ingroup utilities +//! \author Soeren Freudiger, Sebastian Geller +//======================================================================================= #ifndef UB_LIMITS_H #define UB_LIMITS_H diff --git a/src/basics/basics/utilities/UbLogger.cpp b/src/basics/basics/utilities/UbLogger.cpp index 3c433a13030339c656a96d16a19d0f8f9819c7b8..29834020f0fdd85ffc4603a0202e4748582a3e1e 100644 --- a/src/basics/basics/utilities/UbLogger.cpp +++ b/src/basics/basics/utilities/UbLogger.cpp @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file UbLogger.cpp +//! \ingroup utilities +//! \author Soeren Freudiger, Sebastian Geller +//======================================================================================= #include <basics/utilities/UbLogger.h> #if defined(CAB_BOOST) && !defined(NO_THREADSAFE_LOGGING) diff --git a/src/basics/basics/utilities/UbLogger.h b/src/basics/basics/utilities/UbLogger.h index b239621eb6e6ea5f73b33240375059983d3f1b2e..a7bb006c2e7f151c34fa7d3ca9e02e5e3da22581 100644 --- a/src/basics/basics/utilities/UbLogger.h +++ b/src/basics/basics/utilities/UbLogger.h @@ -1,9 +1,35 @@ -// _ ___ __ __________ _ __ -// | | / (_)____/ /___ ______ _/ / ____/ /_ __(_)___/ /____ -// | | / / / ___/ __/ / / / __ `/ / /_ / / / / / / __ / ___/ -// | |/ / / / / /_/ /_/ / /_/ / / __/ / / /_/ / / /_/ (__ ) -// |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ // +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file UbLogger.h +//! \ingroup utilities +//! \author Soeren Freudiger, Sebastian Geller +//======================================================================================= #ifndef UBLOGGER_H #define UBLOGGER_H @@ -12,6 +38,7 @@ #include <iostream> #include <fstream> #include <iomanip> + #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(_WIN64) || defined(__WIN64__) #include <windows.h> #else @@ -22,33 +49,63 @@ #include <boost/thread.hpp> #endif // CAB_BOOST -////////////////////////////////////////////////////////////////////////// -// UbLogger -// C++ Logger -// Funktionsweise: -// pro Logeintrag wird ein UbLogger-Objekt erstellt, der logstring uebergeben und beim "zerstroeren" -// wird der logstring mittels der entsprechenden policy (=template paramter) z.B. in eine Datei -// oder auf dem Bildschirm ausgegeben. Es werden verschiedene LogLevel unterstuetzt -// -// Hilfsmakro: UBLOG -// Bsp1: UBLOG(logINFO) << "Klasse::foo entered"; //endl wir nicht ben�tigt -// --> Eintrag: -// -// Bsp2: siehe Dateiende! -// -//Idee basierend auf: -//Artikel von Dr. Dobbs Portal -//September 05, 2007 -//Logging In C++ -// -//@author <A HREF="mailto:muffmolch@gmx.de">S. Freudiger</A> -//@version 1.0 - 12.10.2008 + enum LogLevel {logERROR, logWARNING, logINFO, logDEBUG, logDEBUG1, logDEBUG2, logDEBUG3, logDEBUG4, logDEBUG5}; ////////////////////////////////////////////////////////////////////////// // template <typename OutputPolicy> class Log - declaration ////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////// +//! +//! \brief +//! C++ Logger +//! \details Functionality: +//! Per logentry an object of type UbLogger is generated, the log string is passed to this object and +//! upon destruction of the object the string is written to a file or the screen depending on +//! the policy (=template paramter). Multiple log level are supported. +//! +//! helpermakro: UBLOG +//! +//! Example 1: +//! \code +//! UBLOG(logINFO) << "Klasse::foo entered"; //endl is not required +//! \endcode +//! +//! Example 2: +//! \code +//! try +//! { +//! UbLog::reportingLevel() = UbLog::logLevelFromString("DEBUG3"); +//! //UbLog::output_policy::setStream(&std::cerr); //<- clog is stdandard +//! UbLog::output_policy::setStream("c:/temp/out.txt"); //you can not open these -> error message -> log is output in cerr +//! +//! int count = 3; +//! UBLOG(logINFO, "A loop with " << count << " iterations"); +//! for (int i = 0; i != count; ++i) +//! { +//! UBLOG(logERROR , "error - the counter i = " << i ); +//! UBLOG(logDEBUG1, "debug1 - the counter i = " << i ); +//! UBLOG(logDEBUG2, "debug2 - the counter i = " << i ); +//! UBLOG(logDEBUG3, "debug3 - the counter i = " << i ); +//! //for MultiLine entries: -> formatting in logfile +//! UBLOGML(logDEBUG3, "debug3 - the counter i = "<<endl<<" 2 zeile "<< "3. Zeile" << i); +//! UBLOGML(logDEBUG3, "debug3 - the counter i = "<<endl<<" 2 zeile "<< "3. Zeile" << i); +//! UBLOG2ML(logDEBUG3,std:cout,"debug3 - the counter i = "<<endl<<" 2 zeile "<< "3. Zeile" << i); +//! } +//! return 0; +//! } +//! catch(const std::exception& e) +//! { +//! UBLOG(logERROR) << e.what(); +//! } +//! \endcode +//! Idee based on: +//! Paper by Dr. Dobbs Portal, +//! September 05, 2007, +//! Logging In C++ +//! +////////////////////////////////////////////////////////////////////////// template <typename OutputPolicy> class UbLogger { @@ -59,7 +116,7 @@ public: virtual ~UbLogger(); std::ostringstream& get(const LogLevel& level = logINFO); public: - //static, weil man so sp�ter die ObjErstellunge ersparen kann, + //static, weil man so spaeter die ObjErstellunge ersparen kann, //falls level kleiner als Level static LogLevel& reportingLevel(); @@ -173,22 +230,18 @@ inline std::string UbLogger<OutputPolicy>::logTimeString() ////////////////////////////////////////////////////////////////////////// -// Output2Stream (=implementation of OutputPolicy) +//! Implementation of OutputPolicy) ////////////////////////////////////////////////////////////////////////// -//Anm: die erste Version mit auto_ptr fuer den stream fuehrte zu -// exceptions bei Verwedung vom Logger in dtors stat. globaler -// Objekte. Aber auch die Pointer-Lsg. ist noch nicht die -// optimale L�sung class Output2Stream // implementation of OutputPolicy { public: static std::ostream*& getStream(); static void output(const std::string& msg); - //creates output-file-stream (of file opening fails -> stream is set to std::cerr) + //!creates output-file-stream (of file opening fails -> stream is set to std::cerr) static void setStream(const std::string& filename); - //direct set outputstream, gcControl = true -> object will be deleted by Output2Stream + //!direct set outputstream, gcControl = true -> object will be deleted by Output2Stream static void setStream(std::ostream* pStream, const bool& gcControl = false); protected: @@ -253,29 +306,18 @@ class UbLog : public UbLogger< Output2Stream > }; -//Makro um compilerseitig maxLevel zu beschr�nken +//Macro to limit compiler-side maxLevel #ifndef UBLOG_MAX_LEVEL #define UBLOG_MAX_LEVEL logDEBUG5 #endif ////////////////////////////////////////////////////////////////////////// -//Hauptmakro fuers Loggen // example UBLOG(logINFO) << "das ist ein log eintrag"; ////////////////////////////////////////////////////////////////////////// #define UBLOG(level, logtext) \ if(level > UBLOG_MAX_LEVEL || level > UbLog::reportingLevel() || !Output2Stream::getStream()) ; \ else UbLog().get(level) << logtext; -//wieso dieses Macro (was der der scheaeaeaesss???) -// z.B. UBLOG(logDEBUG2) << "Ich bin sooo toll " << username; -//also, was macht der praeprozessor draus?: -// if(level > UBLOG_MAX_LEVEL || level > UbLog::reportingLevel() || !Output2Stream::getStream()) ; -// else // Log().Get(logINFO) << "Ich bin sooo toll " << username; -//Ergo: das prinzip des logging beruht auf: Log-Objekt erstellen und rauschreiben beim zerstoeren -// -> ist der zu loggende Level < als der im UBLOG angegebene erspart man sich hier die -// Objekt erstellung -> optimale Performance -> laut Petru Marginean (dem Verfasser des -// Ursprungslogger ist der Performance Unterschied kaum messbar, wenn NICHT geloggt wird! - ////////////////////////////////////////////////////////////////////////// //makro 2 fuer korrekten MultiLineOutput (teuer!!) // example1: UBLOGML(logINFO, "line1"<<endl<<"line2"<<endl<<"line3" ) @@ -296,7 +338,7 @@ class UbLog : public UbLogger< Output2Stream > } \ } ////////////////////////////////////////////////////////////////////////// -//makro3, falls auch bildschirmausgabe erw�nscht +//makro3, falls auch bildschirmausgabe erwuenscht // -> es wird sowohl ins logfile als auch auf den "stream" geschrieben // wenn reporting level und level passen :D //example1: UBLOG2ML(logINFO, std::cout, "line1"<<endl<<"line2"<<endl<<"line3" ) diff --git a/src/basics/basics/utilities/UbMath.cpp b/src/basics/basics/utilities/UbMath.cpp index aabcbb9acbee598531a91a0b1bcf9846b234690f..ffed193fbfc2b269740e213ede6146462f4512b6 100644 --- a/src/basics/basics/utilities/UbMath.cpp +++ b/src/basics/basics/utilities/UbMath.cpp @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file UbMath.cpp +//! \ingroup utilities +//! \author Soeren Freudiger, Sebastian Geller +//======================================================================================= #include <basics/utilities/UbMath.h> #include <basics/utilities/UbInfinity.h> #include <cstring> //for memcmp diff --git a/src/basics/basics/utilities/UbMath.h b/src/basics/basics/utilities/UbMath.h index 98034171b1a5f5defa668e0f974bc862c6058135..659b66cc5d12dab588034e3f7997fe448f769a46 100644 --- a/src/basics/basics/utilities/UbMath.h +++ b/src/basics/basics/utilities/UbMath.h @@ -1,9 +1,35 @@ -// _ ___ __ __________ _ __ -// | | / (_)____/ /___ ______ _/ / ____/ /_ __(_)___/ /____ -// | | / / / ___/ __/ / / / __ `/ / /_ / / / / / / __ / ___/ -// | |/ / / / / /_/ /_/ / /_/ / / __/ / / /_/ / / /_/ (__ ) -// |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ // +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file UbMath.h +//! \ingroup utilities +//! \author Soeren Freudiger, Sebastian Geller +//======================================================================================= #ifndef UBMATH_H #define UBMATH_H @@ -14,20 +40,6 @@ #include <basics/utilities/UbSystem.h> #include <basics/utilities/UbEqual.h> -/*=========================================================================*/ -/* UbMath */ -/* */ -/** -namespace for global math-functions -<BR><BR> -@author <A HREF="mailto:muffmolch@gmx.de">S. Freudiger</A> -@version 1.4 - 04.10.07 -*/ - -/* -usage: ... -*/ - namespace UbMath { extern const double PI; @@ -346,7 +358,7 @@ namespace UbMath return UbMath::calcGgt( UbMath::calcGgt(val1, val2), val3 ); } /*=======================================================*/ - //returns the max of two values + //returns the max of c2 values //to avoid errors at mixed argument-types use: double myMax = max<double>(2,2.3); template< typename T > inline const T& max(const T& a1, const T& a2) @@ -399,7 +411,8 @@ namespace UbMath static const double c2o27 = 2. / 27.; static const double c1o54 = 1. / 54.; static const double c1o216 = 1. / 216.; - static const double c9o2 = 9. / 2.; + static const double c9o2 = 9. / 2.; //4.5 + static const double c9o4 = 9. / 4.; //2.25 static const double c3o9 = 3. / 9.; static const double c3o54 = 3. / 54.; static const double c3o216 = 3. / 216.; @@ -420,6 +433,7 @@ namespace UbMath static const double c1o6 = 1. / 6.; //0.16666666 static const double c1o5 = 1. / 5.; //0.2 static const double c1o4 = 1. / 4.; //0.25 + static const double c1o100 = 1. / 100.; static const double c5o16 = 5. / 16.; //0.3125 static const double c1o3 = 1. / 3.; //0.33333333 static const double c3o8 = 3. / 8.; //0.375 @@ -438,6 +452,29 @@ namespace UbMath static const double sqrt2 = sqrt(2.0); //1.4142135 static const double sqrt3 = sqrt(3.0); //1.7320508 static const double zeroReal = 0.0; + static const double c1 = 1.0; + static const double c2 = 2.0; + static const double c3 = 3.0; + static const double c4 = 4.0; + static const double c5 = 5.0; + static const double c6 = 6.0; + static const double c7 = 7.0; + static const double c8 = 8.0; + static const double c9 = 9.0; + static const double c14 = 14.0; + static const double c15 = 15.0; + static const double c16 = 16.0; + static const double c18 = 18.0; + static const double c21 = 21.0; + static const double c24 = 24.0; + static const double c28 = 28.0; + static const double c29 = 29.0; + static const double c36 = 36.0; + static const double c48 = 48.0; + static const double c50 = 50.0; + static const double c56 = 56.0; + static const double c152 = 152.0; + static const double c130 = 130.0; static const double one = 1.0; static const double two = 2.0; static const double three = 3.0; @@ -457,8 +494,7 @@ namespace UbMath static const double fourtyeight = 48.0; static const double fifty = 50.0; static const double fiftysix = 56.0; - static const double c152 = 152.0; - static const double c130 = 130.0; + } #endif diff --git a/src/basics/basics/utilities/UbObservable.h b/src/basics/basics/utilities/UbObservable.h index 05086076777effdf5462bd8aea85b282f09defe5..56967b904836debbec0f8e5fc785de030824749d 100644 --- a/src/basics/basics/utilities/UbObservable.h +++ b/src/basics/basics/utilities/UbObservable.h @@ -1,51 +1,70 @@ -// _ ___ __ __________ _ __ -// | | / (_)____/ /___ ______ _/ / ____/ /_ __(_)___/ /____ -// | | / / / ___/ __/ / / / __ `/ / /_ / / / / / / __ / ___/ -// | |/ / / / / /_/ /_/ / /_/ / / __/ / / /_/ / / /_/ (__ ) -// |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ // +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file UbObservable.h +//! \ingroup utilities +//! \author Soeren Freudiger, Sebastian Geller +//======================================================================================= #ifndef UBOBSERVABLE_H #define UBOBSERVABLE_H #include <list> #include <iostream> -#ifdef CAB_RCF - #include <3rdParty/rcf/RcfSerializationIncludes.h> -#endif //CAB_RCF - #include <basics/utilities/UbObserver.h> class UbObserver; -/*=========================================================================*/ -/* Beobachtbares Objekt */ -/* */ -/** - This class provides Observables. The Observeres which observe this - Observable are stored in an observerlist. - IMPORTANT: objectWillBeDeleted is called at UbObserver::~UbObserver - this destructor is called AFTER the destructor of the - child classes. if you down_cast the pointer sent with the - objectWillBeDeleted(UbObserver* objpointer) then have to go this: - - if(dynamic_cast<UbObserver*>(observedObj)==objpointer) - (e.g.) observedObj=NULL; - example: see end of file - - a copy of an UbservableObject will NOT copy the observerList - <UL> - <LI><B>Extending:</B> This UbObservable is the observable object itself. Extending should be used - where object types can be extended from UbObservable. - <LI><B>Associating:</B> Initialization is done via the constructor <tt>UbObservable(ObservableObject)</tt>. - Associating may be used, where object types to be observed could not be extended from UbObservable. - </UL> - <BR><BR><HR> - @author <A HREF="mailto:geller@cab.bau.tu-bs.de">S. Geller</A> - @author <A HREF="mailto:muffmolch@gmx.de">S. Freudiger</A> - @version 1.2 - 13.07.05 - @see UbObserver -*/ +////////////////////////////////////////////////////////////////////////// +//! +//! \brief Observable object +//! \details This class provides Observables. The Observeres which observe this +//! Observable are stored in an observerlist. +//! IMPORTANT: objectWillBeDeleted is called at UbObserver::~UbObserver +//! this destructor is called AFTER the destructor of the +//! child classes. if you down_cast the pointer sent with the +//! objectWillBeDeleted(UbObserver* objpointer) then have to go this: +//! +//! if(dynamic_cast<UbObserver*>(observedObj)==objpointer) +//! (e.g.) observedObj=NULL; +//! example: see end of file +//! +//! a copy of an UbservableObject will NOT copy the observerList +//! <UL> +//! <LI><B>Extending:</B> This UbObservable is the observable object itself. Extending should be used +//! where object types can be extended from UbObservable. +//! <LI><B>Associating:</B> Initialization is done via the constructor <tt>UbObservable(ObservableObject)</tt>. +//! Associating may be used, where object types to be observed could not be extended from UbObservable. +//! </UL> +//! +//! see UbObserver +//! +////////////////////////////////////////////////////////////////////////// class UbObservable { @@ -95,7 +114,7 @@ public: /** Adds an UbObserver to the observerlist. - @param observer the observer to add to this observable (note that an observer may observe one observable more than once) + @param observer the observer to add to this observable (note that an observer may observe c1 observable more than once) */ virtual void addObserver(UbObserver* observer) { @@ -164,14 +183,6 @@ public: virtual std::string toString() { return "UbObservable - toString()"; } -#ifdef CAB_RCF - template<typename Archive> - void serialize(Archive & ar, const unsigned int version) - { - //do nothing! - } -#endif //CAB_RCF - private: /** Notifies all of its observers that something happened. Does nothing, if the observed object is null. diff --git a/src/basics/basics/utilities/UbObserver.h b/src/basics/basics/utilities/UbObserver.h index 601e2993acb98e8d5b2f9ad912f1b90662c33fcb..0f2db5270aec44ba41a72f9ac8e6022308a12ecd 100644 --- a/src/basics/basics/utilities/UbObserver.h +++ b/src/basics/basics/utilities/UbObserver.h @@ -1,27 +1,50 @@ -// _ ___ __ __________ _ __ -// | | / (_)____/ /___ ______ _/ / ____/ /_ __(_)___/ /____ -// | | / / / ___/ __/ / / / __ `/ / /_ / / / / / / __ / ___/ -// | |/ / / / / /_/ /_/ / /_/ / / __/ / / /_/ / / /_/ (__ ) -// |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ // +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file UbObserver.h +//! \ingroup utilities +//! \author Soeren Freudiger, Sebastian Geller +//======================================================================================= #ifndef UBOBSERVER_H #define UBOBSERVER_H class UbObservable; -/*=========================================================================*/ -/* Observer */ -/* */ -/** -This interface must be implemented by classes which want to -observe other objects. -IMPORTANT: if you delete an observer, ensure to remove Observer from - all his oberved observable objects before!!! -example: see end of UbObservable.h-file -<BR><BR><HR> -@author <A HREF="mailto:geller@cab.bau.tu-bs.de">S. Geller</A> -@author <A HREF="mailto:muffmolch@gmx.de">S. Freudiger</A> -@version 1.1 - 20.11.04 -*/ + +////////////////////////////////////////////////////////////////////////// +//! +//! \brief Observer +//! \details This interface must be implemented by classes which want to +//! observe other objects. +//! IMPORTANT: if you delete an observer, ensure to remove Observer from +//! all his observed observable objects before!!! +//! example: see end of UbObservable.h-file +//! +////////////////////////////////////////////////////////////////////////// class UbObserver { @@ -34,18 +57,18 @@ public: virtual ~UbObserver(){} /*======================================================================*/ - /* Methoden */ + /* Methods */ /* */ - /** + /*! This function is called when the observable indicated that an object has changed. - @param changedObject Object which has changed + \param changedObject Object which has changed */ virtual void objectChanged(UbObservable* changedObject)=0; - /** + /*! This function is called when the observable indicated that an object should be deleted. - @param objectForDeletion Object which should be deleted + \param objectForDeletion Object which should be deleted */ virtual void objectWillBeDeleted(UbObservable* objectForDeletion)=0; }; diff --git a/src/basics/basics/utilities/UbPointerWrapper.h b/src/basics/basics/utilities/UbPointerWrapper.h deleted file mode 100644 index dbb65d39f08eea99d924026a1ba3604a362fe02f..0000000000000000000000000000000000000000 --- a/src/basics/basics/utilities/UbPointerWrapper.h +++ /dev/null @@ -1,36 +0,0 @@ -// _ ___ __ __________ _ __ -// | | / (_)____/ /___ ______ _/ / ____/ /_ __(_)___/ /____ -// | | / / / ___/ __/ / / / __ `/ / /_ / / / / / / __ / ___/ -// | |/ / / / / /_/ /_/ / /_/ / / __/ / / /_/ / / /_/ (__ ) -// |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/ -// -#ifndef UBPOINTERWRAPPER_H -#define UBPOINTERWRAPPER_H - -//kappselt dynamische Objekte zur remote uebetragung -//bei RCF werden z.B. aufgrund GC alle lokalen Objekte und -//"nackte" Pointer die automatisch als shared_ptr initialisert -//werde nach Methoden-Aufruf zerstoert -//hierfuer kann man dann den UbPointerWrapper verwenden - -template<typename T> -class UbPointerWrapper -{ -public: - UbPointerWrapper() : pointer(NULL) {} - - UbPointerWrapper(T* pointer) : pointer(pointer) {} - - T* get() { return pointer; } - - template<class Archive> - void serialize(Archive& ar, const unsigned int version) - { - ar & pointer; - } - -private: - T* pointer; -}; - -#endif //UBPOINTERWRAPPER_H diff --git a/src/basics/basics/utilities/UbScheduler.h b/src/basics/basics/utilities/UbScheduler.h index f132f9528feb1f3b2f7b53741922ca9d6ba6b901..c927e45b4e4f3c3188b2d1b46a15abc6bd466319 100644 --- a/src/basics/basics/utilities/UbScheduler.h +++ b/src/basics/basics/utilities/UbScheduler.h @@ -1,9 +1,35 @@ -// _ ___ __ __________ _ __ -// | | / (_)____/ /___ ______ _/ / ____/ /_ __(_)___/ /____ -// | | / / / ___/ __/ / / / __ `/ / /_ / / / / / / __ / ___/ -// | |/ / / / / /_/ /_/ / /_/ / / __/ / / /_/ / / /_/ (__ ) -// |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ // +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file UbScheduler.h +//! \ingroup utilities +//! \author Soeren Freudiger, Sebastian Geller, Jan Hegewald +//======================================================================================= #ifndef UBSCHEDULER_H #define UBSCHEDULER_H @@ -19,33 +45,13 @@ #include <basics/utilities/UbMath.h> #include <basics/utilities/UbInfinity.h> #include <basics/utilities/UbComparators.h> -#include <basics/utilities/UbFileOutput.h> -#include <basics/utilities/UbFileInput.h> - -/*=========================================================================*/ -/* UbScheduler */ -/* */ -/** -namespace for global system-functions -<BR><BR> -@author <A HREF="mailto:muffmolch@gmx.de">S. Freudiger</A> -@author <A HREF="mailto:hegewald@cab.bau.tu-bs.de">J. Hegewald</A> -@version 1.0 - 06.09.06 -@version 1.1 - 09.09.06 -@version 1.2 - 03.07.08 - nun auch isDue(t) mehrmals fuer dasselbe t moeglich - isDue(t) auch fuer t < lastUsedT - bug entfernt, der bei Schedule (5,0,500) auch 505 als Due zur�ckgibt! -*/ - -/* -usage: ... -*/ - -// this class is not thread save -// -class UbScheduler; -typedef std::shared_ptr<UbScheduler> UbSchedulerPtr; +////////////////////////////////////////////////////////////////////////// +//! +//! \brief A class implements scheduling. +//! \details This class is not thread save. +//! +////////////////////////////////////////////////////////////////////////// class UbScheduler { @@ -72,20 +78,6 @@ public: return os; } - //------------- implements CAB serialization ----- start - virtual void write(UbFileOutput* out) - { - out->writeDouble( begin ); - out->writeDouble( end ); - out->writeDouble( step ); - } - virtual void read(UbFileInput* in) - { - begin = in->readDouble(); - end = in->readDouble(); - step = in->readDouble(); - } - private: double step, begin, end; }; @@ -200,9 +192,9 @@ public: nextDueTime = tmpNextDueTime; } - //wenn t = der aktuuellen oder gar schon der n�chstm�glichen ist (hierbei wurde + //wenn t = der aktuuellen oder gar schon der naechstmoeglichen ist (hierbei wurde //zuvor actDueTime und nextDueTime ggf. angepasst) - //Bsp.: nextDuTime war 5, aber f�r t=400 gilt andere schedule -> Bsp actDue=350 und nextDue 405 + //Bsp.: nextDuTime war 5, aber fuer t=400 gilt andere schedule -> Bsp actDue=350 und nextDue 405 if( UbMath::equal(t,actDueTime) || UbMath::equal(t,nextDueTime) ) { @@ -212,7 +204,7 @@ public: } else if( UbMath::lessEqual(t, lastDueTime) ) { - if(UbMath::equal(t, lastDueTime) ) return true; //braucht man, wenn man f�r dasselbe t isDue(t) aufruft + if(UbMath::equal(t, lastDueTime) ) return true; //braucht man, wenn man fuer dasselbe t isDue(t) aufruft else { //Fall: Zeit liegt faktisch in der Vergangenheit -> neu initialsisieren @@ -289,27 +281,6 @@ public: return os; } - //------------- implements CAB serialization ----- start - virtual void write(UbFileOutput* out) - { - out->writeSize_t( schedules.size() ); - - for(std::size_t i=0; i<schedules.size(); i++) - schedules[i].write(out); - } - virtual void read(UbFileInput* in) - { - this->initVals(); - - std::size_t nofSchedules = in->readSize_t(); - for(std::size_t i=0; i<nofSchedules; i++) - { - UbSchedule schedule; - schedule.read(in); - this->addSchedule(schedule); - } - } - protected: /*==========================================================*/ void initVals() @@ -348,17 +319,6 @@ protected: }; typedef UbScheduler::UbSchedule UbSchedule; -// inline std::ostream& operator<<( std::ostream& os, const UbScheduler& scheduler ) -// { -// os<<"UbScheduler\n"; -// os<<"Schedule | start | end | intervall "<<std::endl; -// for(std::size_t i=0; i<scheduler.schedules.size(); i++) -// os<<std::setw(9)<<i<<"|" -// <<std::setw(19)<<scheduler.schedules[i].getBegin()<<"|" -// <<std::setw(19)<<scheduler.schedules[i].getEnd() <<"|" -// <<std::setw(19)<<scheduler.schedules[i].getStep() <<std::endl; -// return os; -// } #endif //UBSCHEDULER_H diff --git a/src/basics/basics/utilities/UbStaticPathMap.cpp b/src/basics/basics/utilities/UbStaticPathMap.cpp deleted file mode 100644 index b68cc5ba1445d870e45b57e45ba1eaa5462ca44d..0000000000000000000000000000000000000000 --- a/src/basics/basics/utilities/UbStaticPathMap.cpp +++ /dev/null @@ -1,4 +0,0 @@ -#include <basics/utilities/UbStaticPathMap.h> - -UbStaticPathMap::PathMap UbStaticPathMap::pathMap; -const std::string UbStaticPathMap::GLOBAL = "UbStaticPathMap::GLOBAL"; diff --git a/src/basics/basics/utilities/UbStaticPathMap.h b/src/basics/basics/utilities/UbStaticPathMap.h deleted file mode 100644 index a188843c3a2411fd198b74f71ce0e712fbfcb5ae..0000000000000000000000000000000000000000 --- a/src/basics/basics/utilities/UbStaticPathMap.h +++ /dev/null @@ -1,71 +0,0 @@ -// _ ___ __ __________ _ __ -// | | / (_)____/ /___ ______ _/ / ____/ /_ __(_)___/ /____ -// | | / / / ___/ __/ / / / __ `/ / /_ / / / / / / __ / ___/ -// | |/ / / / / /_/ /_/ / /_/ / / __/ / / /_/ / / /_/ (__ ) -// |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/ -// -#ifndef UBSTATICPATHMAP_H -#define UBSTATICPATHMAP_H - -#include <iostream> -#include <string> -#include <map> - -#include <basics/utilities/UbSystem.h> - -/*=========================================================================*/ -/* UbStaticPathMap */ -/* */ -/** -... -<BR><BR> -@author <A HREF="mailto:muffmolch@gmx.de">S. Freudiger</A> -@version 1.0 - 12.10.2007 -*/ - -/* -stores pathnames for pathIDs (e.g. on different processes different paths with same pathID) -adding an path autom. changes "\" to "/" and removed last "/" if exists - -*/ - -class UbStaticPathMap -{ - typedef std::map< std::string, std::string > PathMap; -public: - static const std::string GLOBAL; -public: - - static std::string addAndMakePath(const std::string& id, const std::string& path) - { - std::string tmpPath = UbStaticPathMap::addPath(id,path); - if( !tmpPath.empty() ) UbSystem::makeDirectory(tmpPath,20); - return tmpPath; - } - static std::string addPath(const std::string& id, const std::string& path) - { - std::string tmpPath = UbSystem::replaceInString(path,"\\","/"); - if(tmpPath.rfind("/") == tmpPath.size()-1) tmpPath.resize(tmpPath.size()-1); - pathMap[id] = tmpPath; - return tmpPath; - } - static std::string getPath(const std::string& id) - { - PathMap::iterator it = pathMap.find(id); - if(it == pathMap.end()) return ""; - return it->second; - } - static void removePath(const std::string& id) - { - pathMap.erase(id); - } - -protected: - static PathMap pathMap; - -private: - UbStaticPathMap() {} - UbStaticPathMap(const UbStaticPathMap&) {} -}; - -#endif //UBSTATICPATHMAP_H diff --git a/src/basics/basics/utilities/UbString.h b/src/basics/basics/utilities/UbString.h deleted file mode 100644 index f93fe7ae6a6243a4bcd48adfd7ce872b2e0b3a36..0000000000000000000000000000000000000000 --- a/src/basics/basics/utilities/UbString.h +++ /dev/null @@ -1,24 +0,0 @@ -//unnoetig: UbSystem::toString() verwenden,... andere Richtung: stringTo... oder am besten boost::lexical_cast - - -//#ifndef UBSTRING_H -//#define UBSTRING_H -//#include <string> -//#include <sstream> -// -//using namespace std; -// -//class UbString -//{ -//public: -// static void IntToString(int i, string& res) -// { -// ostringstream temp; -// temp << i; -// res = temp.str(); -// } -//protected: -//private: -//}; -// -//#endif //end UBSTRING_H diff --git a/src/basics/basics/utilities/UbSystem.h b/src/basics/basics/utilities/UbSystem.h index ec24454808c776df22499c3851b1c89343f6bd1d..dcfa4fc6d4aca45bd1370f2d843259888f7ed11f 100644 --- a/src/basics/basics/utilities/UbSystem.h +++ b/src/basics/basics/utilities/UbSystem.h @@ -1,9 +1,35 @@ -// _ ___ __ __________ _ __ -// | | / (_)____/ /___ ______ _/ / ____/ /_ __(_)___/ /____ -// | | / / / ___/ __/ / / / __ `/ / /_ / / / / / / __ / ___/ -// | |/ / / / / /_/ /_/ / /_/ / / __/ / / /_/ / / /_/ (__ ) -// |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ // +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file UbSystem.h +//! \ingroup utilities +//! \author Soeren Freudiger, Sebastian Geller +//======================================================================================= #ifndef UBSYSTEM_H #define UBSYSTEM_H @@ -26,13 +52,12 @@ #include <sys/syscall.h> #include <sys/stat.h> #include <unistd.h> -#elif (defined(__amd64) || defined(__amd64__) || defined(__unix__) || defined(__CYGWIN__)) && !defined(__AIX__) +#elif (defined(__amd64) || defined(__amd64__) || defined(__unix__)) && !defined(__AIX__) #define UBSYSTEM_LINUX #include "dirent.h" - #include "sys/stat.h" - #include <sys/syscall.h> #include <sys/stat.h> #include <unistd.h> + #include <string.h> #elif defined(__AIX__) #define UBSYSTEM_AIX #include "dirent.h" @@ -43,7 +68,6 @@ #error "UbSystem::UnknownMachine" #endif - #if defined(__unix__) && defined(__CYGWIN__) #define UBSYSTEM_CYGWIN #include <windows.h> @@ -64,7 +88,6 @@ #include <typeinfo> #include <cctype> //for toupper #include <ctime> -#include <cstring> #include <basics/utilities/UbException.h> #include <basics/utilities/UbLogger.h> @@ -98,10 +121,12 @@ namespace UbSystem /*==========================================================*/ inline void sleepMs(const unsigned int& msec) { - #if defined UBSYSTEM_WINDOWS + #if defined(UBSYSTEM_WINDOWS) ::Sleep( (msec==0) ? 1 : msec ); // +1 here causes a context switch if SleepMSec(0) is called - #elif defined(UBSYSTEM_LINUX) || defined(UBSYSTEM_APPLE) || defined(UBSYSTEM_AIX) + #elif (defined(UBSYSTEM_LINUX) || defined(UBSYSTEM_APPLE) || defined(UBSYSTEM_AIX)) && !defined(UBSYSTEM_CYGWIN) ::usleep(1000*msec); + #elif defined(UBSYSTEM_CYGWIN) + ::Sleep( (msec==0) ? 1 : msec ); #else #error "UbSystem::sleepMSec - UnknownMachine" #endif @@ -109,9 +134,9 @@ namespace UbSystem /*==========================================================*/ inline void sleepS(const unsigned int& sec) { - #if defined UBSYSTEM_WINDOWS + #if defined(UBSYSTEM_WINDOWS) || defined(UBSYSTEM_CYGWIN) ::Sleep( (sec==0) ? 1 : sec*1000 ); // +1 here causes a context switch if sleepS(0) is called - #elif defined(UBSYSTEM_LINUX) || defined(UBSYSTEM_APPLE) || defined(UBSYSTEM_AIX) + #elif defined(UBSYSTEM_LINUX) || defined(UBSYSTEM_APPLE) || defined(UBSYSTEM_AIX) && !defined(UBSYSTEM_CYGWIN) ::sleep(sec); #else #error "UbSystem::sleepS - UnknownMachine" @@ -236,7 +261,7 @@ namespace UbSystem if( stat(path.c_str(),&stFileInfo) != 0) { return false; - } + } #endif return true; @@ -372,8 +397,10 @@ namespace UbSystem { #if defined UBSYSTEM_WINDOWS return (unsigned long)GetCurrentThreadId(); - #elif defined(UBSYSTEM_LINUX) || defined(UBSYSTEM_APPLE) + #elif (defined(UBSYSTEM_LINUX) || defined(UBSYSTEM_APPLE)) && !defined(UBSYSTEM_CYGWIN) return (unsigned long)syscall(SYS_gettid); + #elif defined(UBSYSTEM_CYGWIN) + return (unsigned long)GetCurrentThreadId(); #elif defined(UBSYSTEM_AIX) return (unsigned long) getpid(); //WORKAROUND for IBM (for get thread id is another function necessary) #else @@ -432,7 +459,7 @@ namespace UbSystem char Name[150]; int i = 0; -#ifdef UBSYSTEM_WINDOWS +#if defined(UBSYSTEM_WINDOWS) || defined(UBSYSTEM_CYGWIN) TCHAR infoBuf[150]; DWORD bufCharCount = 150; memset(Name, 0, 150); @@ -447,7 +474,7 @@ namespace UbSystem { strcpy(Name, "Unknown_Host_Name"); } -#else +#elif (defined(UBSYSTEM_LINUX) || defined(UBSYSTEM_APPLE) || defined(UBSYSTEM_AIX)) && !defined(UBSYSTEM_CYGWIN) memset(Name, 0, 150); gethostname(Name, 150); #endif diff --git a/src/basics/basics/utilities/UbTableModel.cpp b/src/basics/basics/utilities/UbTableModel.cpp deleted file mode 100644 index 12e69b068646db62f966d14d50b295812e5b05ba..0000000000000000000000000000000000000000 --- a/src/basics/basics/utilities/UbTableModel.cpp +++ /dev/null @@ -1,20 +0,0 @@ -#include <basics/utilities/UbTableModel.h> - -UbTableModel::UbTableModel() -{ -} - -UbTableModel::~UbTableModel() -{ - //this->notifyObserversObjectWillBeDeleted(); -} - -//void UbTableModel::objectChanged(UbObservable* changedObject) -//{ -// this->notifyObserversObjectChanged(); -//} -// -//void UbTableModel::objectWillBeDeleted(UbObservable* objectForDeletion) -//{ -// objectForDeletion->removeObserver(this); -//} diff --git a/src/basics/basics/utilities/UbTableModel.h b/src/basics/basics/utilities/UbTableModel.h deleted file mode 100644 index 957201a5115555402b005708e3e553e172105942..0000000000000000000000000000000000000000 --- a/src/basics/basics/utilities/UbTableModel.h +++ /dev/null @@ -1,37 +0,0 @@ -// _ ___ __ __________ _ __ -// | | / (_)____/ /___ ______ _/ / ____/ /_ __(_)___/ /____ -// | | / / / ___/ __/ / / / __ `/ / /_ / / / / / / __ / ___/ -// | |/ / / / / /_/ /_/ / /_/ / / __/ / / /_/ / / /_/ (__ ) -// |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/ -// -#ifndef UBTABLEMODEL_H -#define UBTABLEMODEL_H - -#include <iostream> - -class UbTableModel -{ -public: - const static int COL_TYPE_STRING = 1; - const static int COL_TYPE_BOOL = 2; - const static int COL_TYPE_INTEGER = 3; - const static int COL_TYPE_DOUBLE = 4; - - UbTableModel(); - virtual ~UbTableModel(); - - ////////////////////////////////////////////////////////////////////////// - //void objectChanged(UbObservable*); - //void objectWillBeDeleted(UbObservable*); - - virtual int getColumnNumber() = 0; - virtual int getRowNumber() = 0; - virtual std::string getColumnLabel(int column) = 0; - virtual int getColumnType(int column) = 0; - virtual std::string getStringValue(int row, int col) = 0; - virtual void setStringValue(int row, int col, std::string str) = 0; - virtual int getSelectedRowIndex() = 0; - //virtual bool GetBoolValue(int row, int col) = 0; -}; - -#endif //UBTABLEMODEL_H diff --git a/src/basics/basics/utilities/UbTiming.h b/src/basics/basics/utilities/UbTiming.h index 2ba786b97fbe56837d4767354c9871dbd9ce9c84..9260892669a7010ef35c75acc81b460646c06243 100644 --- a/src/basics/basics/utilities/UbTiming.h +++ b/src/basics/basics/utilities/UbTiming.h @@ -1,9 +1,35 @@ -// _ ___ __ __________ _ __ -// | | / (_)____/ /___ ______ _/ / ____/ /_ __(_)___/ /____ -// | | / / / ___/ __/ / / / __ `/ / /_ / / / / / / __ / ___/ -// | |/ / / / / /_/ /_/ / /_/ / / __/ / / /_/ / / /_/ (__ ) -// |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ // +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file UbTiming.h +//! \ingroup utilities +//! \author Soeren Freudiger, Sebastian Geller +//======================================================================================= #ifndef UBTIMING_H #define UBTIMING_H @@ -14,27 +40,11 @@ #include <vector> #include <ctime> -#ifdef CAB_RCF - #include <3rdParty/rcf/RcfSerializationIncludes.h> -#endif //CAB_RCF - #ifdef VF_MPI #include <mpi.h> #include <basics/parallel/PbMpi.h> #endif //VF_MPI -/*=========================================================================*/ -// UbTiming - Time Measuring -// -// -// -//This Class provides the base for ... -//<BR><BR> -//@author <A HREF="mailto:muffmolch@gmx.de">S. Freudiger</A> -//@author <A HREF="mailto:geller@cab.bau.tu-bs.de">S. Geller</A> -//@version 1.1 - 14.02.06 -// - class UbTiming { public: @@ -162,16 +172,6 @@ protected: double deltaT; }; -/*=========================================================================*/ -// UbTimer - Time Measuring -// -// -// -//This Class provides the base for ... -//<BR><BR> -//@author <A HREF="mailto:muffmolch@gmx.de">S. Freudiger</A> -//@version 1.0 - 16.08.2007 -// #include <basics/utilities/UbSystem.h> //for definitons of system/OS type #ifdef UBSYSTEM_APPLE //Apple hack @@ -197,22 +197,27 @@ protected: #include <pthread.h> #endif -//example: -//t=0 start -//t=1 -//t=2 stop -> return 2; getLapTime=2; getTotalTime 2; getLapTimes: 2 -//t=3 -//t=4 -//t=5 stop -> return 3; getLapTime=3; getTotalTime 5; getLapTimes: 2,3 -//t=6 stop -> return 1; getLapTime=1; getTotalTime 6; getLapTimes: 2,3,1 -//t=7 -//t=8 start ->no consideration of time 7 and 8 -//t=9 -//t=10 stop -> return 2; getLapTime=2; getTotalTime 8; getLapTimes: 2,3,1,2 -//t=11 resetAndStart timer wird zurueckgestellt und neu gestaret -//t=12 -//t=13 -//t=14 stop -> return 3; getLapTime=3; getTotalTime 3; getLapTimes: 3 +/*=========================================================================*/ +//! \brief Time Measuring +//! \details +//! example: +//! \code +//! t=0 start +//! t=1 +//! t=2 stop -> return 2; getLapTime=2; getTotalTime 2; getLapTimes: 2 +//! t=3 +//! t=4 +//! t=5 stop -> return 3; getLapTime=3; getTotalTime 5; getLapTimes: 2,3 +//! t=6 stop -> return 1; getLapTime=1; getTotalTime 6; getLapTimes: 2,3,1 +//! t=7 +//! t=8 start ->no consideration of time 7 and 8 +//! t=9 +//! t=10 stop -> return 2; getLapTime=2; getTotalTime 8; getLapTimes: 2,3,1,2 +//! t=11 resetAndStart -> Timer is reset and restarted +//! t=12 +//! t=13 +//! t=14 stop -> return 3; getLapTime=3; getTotalTime 3; getLapTimes: 3 +//! \endcode class UbTimer { @@ -348,20 +353,6 @@ public: } -#ifdef CAB_RCF - template<class Archive> - void SF_SERIALIZE(Archive & ar) - { - ar & name; - ar & isMeasuring; - ar & startTime; - ar & totalTime; - ar & lapTime; - ar & lapTimes; - ar & storeLapTimes; - } -#endif //CAB_RCF - protected: std::string name; bool isMeasuring; @@ -376,21 +367,17 @@ protected: /*=========================================================================*/ -// UbProgressTimer - Time Measuring -// -// -// -//UbProressTimer misst die Zeit von seiner Instantiierung bis zur Zerstoerung -//und gib die verstrichene Zeit auf "os" in [s] aus -//example: -// { -// UbProgressTimer timer; -// UbSystem::sleepS(10); -// } //--> 10s -//<BR><BR> -//@author <A HREF="mailto:muffmolch@gmx.de">S. Freudiger</A> -//@version 1.0 - 10.03.2008 -// +//! \brief Time Measuring +//! +//! \details UbProressTimer measures the time from its instantiation to destruction and spend the elapsed time on "os" in [s] +//! example: +//! \code +//! { +//! UbProgressTimer timer; +//! UbSystem::sleepS(10); +//! } //--> 10s +//! \endcode + class UbProgressTimer : public UbTimer { private: diff --git a/src/basics/basics/utilities/UbTuple.cpp b/src/basics/basics/utilities/UbTuple.cpp deleted file mode 100644 index f778fc71a3a5ca12017213db79f3efba88c0761f..0000000000000000000000000000000000000000 --- a/src/basics/basics/utilities/UbTuple.cpp +++ /dev/null @@ -1,2 +0,0 @@ -#include "UbTuple.h" - diff --git a/src/basics/basics/utilities/UbTuple.h b/src/basics/basics/utilities/UbTuple.h index 710aed4df8cd74995ac85e0e448e2d333f9f0556..6b9b8b52aef2cb498c127506125b644113456aad 100644 --- a/src/basics/basics/utilities/UbTuple.h +++ b/src/basics/basics/utilities/UbTuple.h @@ -1,9 +1,35 @@ -// _ ___ __ __________ _ __ -// | | / (_)____/ /___ ______ _/ / ____/ /_ __(_)___/ /____ -// | | / / / ___/ __/ / / / __ `/ / /_ / / / / / / __ / ___/ -// | |/ / / / / /_/ /_/ / /_/ / / __/ / / /_/ / / /_/ (__ ) -// |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ // +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file UbTupel.h +//! \ingroup utilities +//! \author Soeren Freudiger, Sebastian Geller +//======================================================================================= #ifndef UBTUPLE_H #define UBTUPLE_H @@ -11,56 +37,43 @@ #include <string> #include <ostream> -#ifdef CAB_RCF - #include <3rdParty/rcf/RcfSerializationIncludes.h> -#endif //CAB_RCF - -/*=========================================================================*/ -/* UbTuple */ -/* */ -/** -... -<BR><BR> -@author <A HREF="mailto:muffmolch@gmx.de">S. Freudiger</A> -@version 1.0 - 23.10.06 -*/ - -/* -usage: ... -////Advanced UbTuple -//Bsp: -//// create and use tuple with only one field -//UbTuple<int,int,int,int,int> t1; -//val<1>(t1) += 42; -//std::cout << t1.v1() << std::endl; - -//// create and use duo -//UbTuple<bool,int> t2; -//std::cout << val<1>(t2) << ", "; -//std::cout << t2.v1() << std::endl; - -//// create and use triple -//UbTuple<bool,int,double> t3; -//val<1>(t3) = true; // new values via: val< pos >(triple) = ... -//val<2>(t3) = 42; -//val<3>(t3) = 0.2; -//t3 = makeUbTuple(false, 23, 13.13); - -//std::cout << val<1>(t3) << ", "; -//std::cout << val<2>(t3) << ", "; -//std::cout << val<3>(t3) << std::endl; - -//// create and use quadruple -//UbType<bool,int,float,double> t4(true,42,13,1.95583); -//std::cout << val<4>(t4) << std::endl; //<- option 2 (std) -//std::cout << t4.v2().v2().v2() << std::endl; //<- option 2 -*/ - -//typeop.h -// primary template -/********************************** -* typeop1.hpp: -**********************************/ +////////////////////////////////////////////////////////////////////////// +//! \brief A class implements a tuple +//! \details +//! usage: ...<BR> +//! Advanced UbTuple +//! Example: +//! create and use tuple with only c1 field +//! \code +//! UbTuple<int,int,int,int,int> t1; +//! val<1>(t1) += 42; +//! std::cout << t1.v1() << std::endl; +//! \endcode +//! create and use duo: +//! \code +//! UbTuple<bool,int> t2; +//! std::cout << val<1>(t2) << ", "; +//! std::cout << t2.v1() << std::endl; +//! \endcode +//! create and use triple: +//! \code +//! UbTuple<bool,int,double> t3; +//! val<1>(t3) = true; // new values via: val< pos >(triple) = ... +//! val<2>(t3) = 42; +//! val<3>(t3) = 0.2; +//! t3 = makeUbTuple(false, 23, 13.13); +//! +//! std::cout << val<1>(t3) << ", "; +//! std::cout << val<2>(t3) << ", "; +//! std::cout << val<3>(t3) << std::endl; +//! \endcode +//! create and use quadruple: +//! \code +//! UbType<bool,int,float,double> t4(true,42,13,1.95583); +//! std::cout << val<4>(t4) << std::endl; //<- option 2 (std) +//! std::cout << t4.v2().v2().v2() << std::endl; //<- option 2 +//! \endcode + template <typename T> class UbTypeOp // primary template { @@ -165,15 +178,6 @@ public: T2& v2() { return value2; } T2 const& v2() const { return value2; } -#ifdef CAB_RCF - template<class Archive> - void serialize(Archive& ar, const unsigned int version) - { - ar & value1; - ar & value2; - } -#endif //CAB_RCF - private: T1 value1; // value of first field T2 value2; // value of second field @@ -249,15 +253,6 @@ public: T2& v2() { return value2; } T2 const& v2() const { return value2; } -#ifdef CAB_RCF - template<class Archive> - void serialize(Archive & ar, const unsigned int version) - { - ar & value1; - ar & value2; - } -#endif //CAB_RCF - private: T1 value1; // value of first field T2 value2; // value of second field @@ -388,7 +383,7 @@ inline typename UbTypeOp<typename UbDuoT<N, UbDuo<A, B> >::ResultT>::RefConstT v } //duo6.hpp -// partial specialization for UbDuo<> with only one field +// partial specialization for UbDuo<> with only c1 field template <typename A> struct UbDuo<A,void> { @@ -412,13 +407,6 @@ public: void v2() { } void v2() const { } - #ifdef CAB_RCF - template<class Archive> - void serialize(Archive & ar, const unsigned int version) - { - ar & value1; - } - #endif }; //tupel1.hpp @@ -427,7 +415,44 @@ class UbNullT { }; -// UbTuple<> in general derives from UbTuple<> with one more UbNullT +////////////////////////////////////////////////////////////////////////// +//! \brief A class implements a tuple +//! \details +//! usage: ...<BR> +//! Advanced UbTuple +//! Example: +//! create and use tuple with only c1 field +//! \code +//! UbTuple<int,int,int,int,int> t1; +//! val<1>(t1) += 42; +//! std::cout << t1.v1() << std::endl; +//! \endcode +//! create and use duo: +//! \code +//! UbTuple<bool,int> t2; +//! std::cout << val<1>(t2) << ", "; +//! std::cout << t2.v1() << std::endl; +//! \endcode +//! create and use triple: +//! \code +//! UbTuple<bool,int,double> t3; +//! val<1>(t3) = true; // new values via: val< pos >(triple) = ... +//! val<2>(t3) = 42; +//! val<3>(t3) = 0.2; +//! t3 = makeUbTuple(false, 23, 13.13); +//! +//! std::cout << val<1>(t3) << ", "; +//! std::cout << val<2>(t3) << ", "; +//! std::cout << val<3>(t3) << std::endl; +//! \endcode +//! create and use quadruple: +//! \code +//! UbType<bool,int,float,double> t4(true,42,13,1.95583); +//! std::cout << val<4>(t4) << std::endl; //<- option 2 (std) +//! std::cout << t4.v2().v2().v2() << std::endl; //<- option 2 +//! \endcode + +// UbTuple<> in general derives from UbTuple<> with c1 more UbNullT template <typename P1, typename P2 = UbNullT, typename P3 = UbNullT, @@ -591,7 +616,7 @@ typedef UbTuple<int,int,int,int> UbTupleInt4; typedef UbTuple<int,int,int,int,int> UbTupleInt5; typedef UbTuple<int,int,int,int,int,int> UbTupleInt6; typedef UbTuple<int,int,int,int,int,int,int,int> UbTupleInt8; -typedef UbTuple<unsigned, unsigned, unsigned, unsigned, unsigned, unsigned, unsigned, unsigned> UbTupleUInt8; +typedef UbTuple<unsigned int,unsigned int,unsigned int,unsigned int,unsigned int,unsigned int,unsigned int,unsigned int> UbTupleUInt8; typedef UbTuple<double,double> UbTupleDouble2; typedef UbTuple<double,double,double> UbTupleDouble3; typedef UbTuple<double,double,double,double> UbTupleDouble4; diff --git a/src/basics/basics/utilities/Vector3D.cpp b/src/basics/basics/utilities/Vector3D.cpp index 34074babdb502451ca967cb0766398438d8624e3..bb8fb46a295205bc7d1cc085623b22ad84a40a90 100644 --- a/src/basics/basics/utilities/Vector3D.cpp +++ b/src/basics/basics/utilities/Vector3D.cpp @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file UbVector3D.cpp +//! \ingroup utilities +//! \author Soeren Freudiger, Sebastian Geller +//======================================================================================= #include <basics/utilities/Vector3D.h> #include <cassert> diff --git a/src/basics/basics/utilities/Vector3D.h b/src/basics/basics/utilities/Vector3D.h index 27d48d2e8b24084fbd2ad05a65b17413d8dcf00a..03f47b033604520ed05cc895e327fe7b34ed32f8 100644 --- a/src/basics/basics/utilities/Vector3D.h +++ b/src/basics/basics/utilities/Vector3D.h @@ -1,30 +1,41 @@ -// _ ___ __ __________ _ __ -// | | / (_)____/ /___ ______ _/ / ____/ /_ __(_)___/ /____ -// | | / / / ___/ __/ / / / __ `/ / /_ / / / / / / __ / ___/ -// | |/ / / / / /_/ /_/ / /_/ / / __/ / / /_/ / / /_/ (__ ) -// |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ // +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file UbVector3D.h +//! \ingroup utilities +//! \author Soeren Freudiger, Sebastian Geller +//======================================================================================= #ifndef VECTOR_3D_H #define VECTOR_3D_H #include <string> -/*=========================================================================*/ -/* Vector3D */ -/* */ -/** -<BR><BR> -@author <A HREF="mailto:muffmolch@gmx.de">S. Freudiger</A> -@version 1.4 - 04.10.07 -*/ - -/* -usage: ... -*/ -#include "basics_export.h" - - - class BASICS_EXPORT Vector3D + class Vector3D { public: // construction @@ -110,14 +121,6 @@ usage: ... static const Vector3D UNIT_X2; static const Vector3D UNIT_X3; - #ifdef CAB_RCF - template<class Archive> - void serialize(Archive & ar, const unsigned int version) - { - ar & m_afTuple; - } - #endif //CAB_RCF - protected: // support for comparisons int CompareArrays (const Vector3D& rkV) const; diff --git a/src/basics/basics/utilities/package.include b/src/basics/basics/utilities/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/basics/basics/writer/WbWriter.h b/src/basics/basics/writer/WbWriter.h index 2bea860d822d14decdbb73bfcb4802ce2f05088d..510c160a9d0bde85fddd0ff1137a81a05130d0a7 100644 --- a/src/basics/basics/writer/WbWriter.h +++ b/src/basics/basics/writer/WbWriter.h @@ -1,19 +1,38 @@ -// _ ___ __ __________ _ __ -// | | / (_)____/ /___ ______ _/ / ____/ /_ __(_)___/ /____ -// | | / / / ___/ __/ / / / __ `/ / /_ / / / / / / __ / ___/ -// | |/ / / / / /_/ /_/ / /_/ / / __/ / / /_/ / / /_/ (__ ) -// |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ // +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file WbWriter.h +//! \ingroup writer +//! \author Soeren Freudiger, Sebastian Geller +//======================================================================================= #ifndef WBWRITER_H #define WBWRITER_H -#ifdef CAB_RCF - #include <3rdParty/rcf/RcfSerializationIncludes.h> -#endif - -#include "basics_export.h" - - #include <vector> #include <string> #include <fstream> @@ -21,19 +40,14 @@ #include <iostream> #include <map> -#include <basics/utilities/UbSystem.h> #include <basics/utilities/UbException.h> +#include <basics/utilities/UbSystem.h> #include <basics/utilities/UbTuple.h> -#include <basics/utilities/UbPointerWrapper.h> -#include <basics/utilities/UbAutoRun.hpp> -#include <basics/objects/ObFactory.h> -class BASICS_EXPORT WbWriter +class WbWriter { public: - OBCREATOR_EXT(WbWriter) - ////////////////////////////////////////////////////////////////////////// virtual ~WbWriter() { @@ -78,8 +92,7 @@ public: virtual std::string writeQuadsWithNodeData(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt4 >& cells, std::vector< std::string >& datanames, std::vector< std::vector< double > >& nodedata){ throw UbException(UB_EXARGS,"not implemented for "+(std::string)typeid(*this).name() ); } virtual std::string writeQuadsWithCellData(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt4 >& cells, std::vector< std::string >& datanames, std::vector< std::vector< double > >& celldata){ throw UbException(UB_EXARGS,"not implemented for "+(std::string)typeid(*this).name() ); } virtual std::string writeQuadsWithNodeAndCellData(const std::string& filename,std::vector< UbTupleFloat3 >& nodes, std::vector< UbTupleInt4 >& cells, - std::vector< std::string >& nodedatanames, std::vector< std::vector< double > >& nodedata, std::vector< std::string >& celldatanames, - std::vector< std::vector< double > >&celldata) { throw UbException(UB_EXARGS,"not implemented for "+(std::string)typeid(*this).name() ); } + std::vector< std::string >& nodedatanames, std::vector< std::vector< double > >& nodedata, std::vector< std::string >& celldatanames, std::vector< std::vector< double > >&celldata) { throw UbException(UB_EXARGS,"not implemented for "+(std::string)typeid(*this).name() ); } ////////////////////////////////////////////////////////////////////////// //octs @@ -98,81 +111,4 @@ private: }; - -#ifdef CAB_RCF -//serialize von singletons muss hier etwas anders erfolgen ;-) -template<class Archive> -inline bool serializeWbWriter(Archive &ar, WbWriter*& writer) -{ - std::string writerID; - - if( ArchiveTools::isReading(ar) ) - { - ar & writerID; - if(writerID!="no_WbWriter") writer = ObFactory<WbWriter>::getInstance()->createObject(writerID); - else writer = NULL; - } - else /* if (ar.isWrite())) if(Archive::is_saving())*/ - { - if(writer) writerID = writer->getClassObjectTypeID(); - else writerID = "no_WbWriter"; - ar & writerID; - } - return true; -} -////////////////// -template<class Archive, class STL_container> -inline bool serializeWbWriter(Archive &ar, STL_container& writers) -{ - int nofCounter; - std::string writerID; - WbWriter* dummy; - - if( ArchiveTools::isReading(ar) ) - { - ar & nofCounter; - for(int i=0; i<nofCounter; i++) - { - serializeWbWriter(ar, dummy); - writers.push_back(dummy); - } - } - else - { - nofCounter = (int)writers.size(); - ar & nofCounter; - typename STL_container::iterator pos; - for(pos=writers.begin(); pos!=writers.end(); ++pos) - serializeWbWriter(ar, *pos); - } - - return true; -} -////////////////////////////////////////////////////////////////////////// -// Spezialisierung des UbPointerWrappers fuer WbWriter... -// da man bei singletons keine serializemethode einbauen kann... -template< > -class UbPointerWrapper< WbWriter > -{ -public: - UbPointerWrapper() : pointer(NULL) {} - - UbPointerWrapper(WbWriter* pointer) : pointer(pointer) {} - - WbWriter* get() { return pointer; } - - template<class Archive> - void serialize(Archive& ar, const unsigned int version) - { - serializeWbWriter(ar, pointer); - } - -private: - WbWriter* pointer; -}; - - -#endif //CAB_RCF - - #endif //WBWRITER_H diff --git a/src/basics/basics/writer/WbWriterAvsASCII.h b/src/basics/basics/writer/WbWriterAvsASCII.h index 8f7f97a759fb4bf9bd414769dcfd7adfbe8858b6..a683ae7a1185c74be9c2b33ce7674eca41f82fef 100644 --- a/src/basics/basics/writer/WbWriterAvsASCII.h +++ b/src/basics/basics/writer/WbWriterAvsASCII.h @@ -12,8 +12,6 @@ class WbWriterAvsASCII : public WbWriter { public: - OBCREATOR_EXT( WbWriterAvsASCII ) - static WbWriterAvsASCII* getInstance() { static WbWriterAvsASCII instance; @@ -71,6 +69,4 @@ public: std::string writeOctsWithNodeData(const std::string& filename, std::vector<UbTupleFloat3 >& nodes, std::vector<UbTupleInt8 >& cells, std::vector<std::string >& datanames, std::vector< std::vector<double > >& nodedata); }; -UB_AUTO_RUN_NAMED(ObFactory<WbWriter>::getInstance()->addObCreator(ObSingletonCreatorImpl<WbWriterAvsASCII ,WbWriter>::getInstance()), CAB_WbWriterAvsASCII); - #endif //WBWRITERAVSASCII_H diff --git a/src/basics/basics/writer/WbWriterAvsBinary.h b/src/basics/basics/writer/WbWriterAvsBinary.h index 2ba0e78420012314f2f286f83d12866ee534cee8..8a31c3e9437f22772781442809d035b191e865f6 100644 --- a/src/basics/basics/writer/WbWriterAvsBinary.h +++ b/src/basics/basics/writer/WbWriterAvsBinary.h @@ -12,8 +12,6 @@ class WbWriterAvsBinary : public WbWriter { public: - OBCREATOR_EXT( WbWriterAvsBinary ) - static WbWriterAvsBinary* getInstance() { static WbWriterAvsBinary instance; @@ -69,6 +67,4 @@ public: std::string writeOctsWithNodeData(const std::string& filename, std::vector<UbTupleFloat3 >& nodes, std::vector<UbTupleInt8 >& cells, std::vector<std::string >& datanames, std::vector< std::vector<double > >& nodedata); }; -UB_AUTO_RUN_NAMED(ObFactory<WbWriter>::getInstance()->addObCreator(ObSingletonCreatorImpl<WbWriterAvsBinary ,WbWriter>::getInstance()), CAB_WbWriterAvsBinary); - #endif //WBWRITERAVSBINARY_H diff --git a/src/basics/basics/writer/WbWriterSunflow.h b/src/basics/basics/writer/WbWriterSunflow.h index a14461b0618557fbef2b2da4b95077b397568f78..726476009f41c4cd8652fc9ae25affb6fdaef0d3 100644 --- a/src/basics/basics/writer/WbWriterSunflow.h +++ b/src/basics/basics/writer/WbWriterSunflow.h @@ -8,8 +8,6 @@ class WbWriterSunflow : public WbWriter { public: - OBCREATOR_EXT( WbWriterSunflow ) - static WbWriterSunflow* getInstance() { static WbWriterSunflow instance; @@ -33,6 +31,4 @@ public: std::string writeTriangles(const std::string& filename,std::vector<UbTupleFloat3 >& nodes, std::vector<UbTupleInt3 >& triangles); }; -UB_AUTO_RUN_NAMED(ObFactory<WbWriter>::getInstance()->addObCreator(ObSingletonCreatorImpl<WbWriterSunflow ,WbWriter>::getInstance()), CAB_WbWriterSunflow); - #endif //WbWriterSunflow_H diff --git a/src/basics/basics/writer/WbWriterTecPlotASCII.h b/src/basics/basics/writer/WbWriterTecPlotASCII.h index 01b067557a9d39ecfe706cb2f266aaaf75d3f016..ef63390327bbd3b14806f8648b9b2243a224bcb3 100644 --- a/src/basics/basics/writer/WbWriterTecPlotASCII.h +++ b/src/basics/basics/writer/WbWriterTecPlotASCII.h @@ -8,10 +8,6 @@ class WbWriterTecPlotASCII : public WbWriter { public: - #ifndef SWIG - OBCREATOR_EXT( WbWriterTecPlotASCII ) - #endif - static WbWriterTecPlotASCII* getInstance() { static WbWriterTecPlotASCII instance; @@ -88,8 +84,4 @@ public: }; -#ifndef SWIG -UB_AUTO_RUN_NAMED(ObFactory<WbWriter>::getInstance()->addObCreator(ObSingletonCreatorImpl<WbWriterTecPlotASCII ,WbWriter>::getInstance()), CAB_WbWriterTecPlotASCII); -#endif - #endif //WBWRITERTECPLOTASCII_H diff --git a/src/basics/basics/writer/WbWriterVtkASCII.h b/src/basics/basics/writer/WbWriterVtkASCII.h index aaa1f563cd252fd95691a0e6039f7cadeabc9e58..75f0da4530df2100b6d47bdc574affc4ace11dbd 100644 --- a/src/basics/basics/writer/WbWriterVtkASCII.h +++ b/src/basics/basics/writer/WbWriterVtkASCII.h @@ -12,8 +12,6 @@ class WbWriterVtkASCII : public WbWriter { public: - OBCREATOR_EXT( WbWriterVtkASCII ) - static WbWriterVtkASCII* getInstance() { static WbWriterVtkASCII instance; @@ -73,6 +71,4 @@ public: }; -UB_AUTO_RUN_NAMED(ObFactory<WbWriter>::getInstance()->addObCreator(ObSingletonCreatorImpl<WbWriterVtkASCII,WbWriter>::getInstance()), CAB_WbWriterVtkASCII); - #endif //WBWRITERVTKASCII_H diff --git a/src/basics/basics/writer/WbWriterVtkBinary.h b/src/basics/basics/writer/WbWriterVtkBinary.h index c67666c2cc5d688f4901ee02c7741b056e55ac33..30dfc923c0a09231c5b878257e377055a2b520e9 100644 --- a/src/basics/basics/writer/WbWriterVtkBinary.h +++ b/src/basics/basics/writer/WbWriterVtkBinary.h @@ -12,8 +12,6 @@ class WbWriterVtkBinary : public WbWriter { public: - OBCREATOR_EXT( WbWriterVtkBinary ) - static WbWriterVtkBinary* getInstance() { static WbWriterVtkBinary instance; @@ -72,6 +70,4 @@ public: }; -UB_AUTO_RUN_NAMED(ObFactory<WbWriter>::getInstance()->addObCreator(ObSingletonCreatorImpl<WbWriterVtkBinary ,WbWriter>::getInstance()), CAB_WbWriterVtkBinary); - #endif //WBWRITERVTKBINARY_H diff --git a/src/basics/basics/writer/WbWriterVtkXmlASCII.cpp b/src/basics/basics/writer/WbWriterVtkXmlASCII.cpp index edf5efea982fe910d68e84e9f521f2b5e2de76cd..47b5d1fb26243d5c8b5d051ba2459e4219d5fe75 100644 --- a/src/basics/basics/writer/WbWriterVtkXmlASCII.cpp +++ b/src/basics/basics/writer/WbWriterVtkXmlASCII.cpp @@ -1,3 +1,35 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file WbWriterVtkXmlASCII.cpp +//! \ingroup writer +//! \author Soeren Freudiger, Sebastian Geller +//======================================================================================= #include <basics/writer/WbWriterVtkXmlASCII.h> #include <basics/utilities/UbLogger.h> #include <cstring> diff --git a/src/basics/basics/writer/WbWriterVtkXmlASCII.h b/src/basics/basics/writer/WbWriterVtkXmlASCII.h index 1d451d8e064d34921790df219704bb3b8fcfed3e..97e60486fc82deee1c634c4c5472781f48924b3a 100644 --- a/src/basics/basics/writer/WbWriterVtkXmlASCII.h +++ b/src/basics/basics/writer/WbWriterVtkXmlASCII.h @@ -1,17 +1,45 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file WbWriterVtkXmlASCII.h +//! \ingroup writer +//! \author Soeren Freudiger, Sebastian Geller +//======================================================================================= #ifndef WBWRITERVTKXMLASCII_H #define WBWRITERVTKXMLASCII_H #include <string> -#include "basics_export.h" - #include <basics/writer/WbWriter.h> -class BASICS_EXPORT WbWriterVtkXmlASCII : public WbWriter +class WbWriterVtkXmlASCII : public WbWriter { public: - OBCREATOR_EXT( WbWriterVtkXmlASCII ) - static WbWriterVtkXmlASCII* getInstance() { static WbWriterVtkXmlASCII instance; @@ -91,6 +119,4 @@ private: }; -UB_AUTO_RUN_NAMED(ObFactory<WbWriter>::getInstance()->addObCreator(ObSingletonCreatorImpl<WbWriterVtkXmlASCII ,WbWriter>::getInstance()), CAB_WbWriterVtkXmlASCII); - #endif //WBWRITERVTKXMLASCII_H diff --git a/src/basics/basics/writer/WbWriterVtkXmlBinary.cpp b/src/basics/basics/writer/WbWriterVtkXmlBinary.cpp index b449433028682ea787d6da3d09681f6a1d776bc3..a1133890e43538affe6d84eaa134b97706198a89 100644 --- a/src/basics/basics/writer/WbWriterVtkXmlBinary.cpp +++ b/src/basics/basics/writer/WbWriterVtkXmlBinary.cpp @@ -1,49 +1,44 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file WbWriterVtkXmlBinary.cpp +//! \ingroup writer +//! \author Soeren Freudiger, Sebastian Geller +//======================================================================================= #include <basics/writer/WbWriterVtkXmlBinary.h> #include <basics/writer/WbWriterVtkXmlASCII.h> #include <basics/utilities/UbLogger.h> -#include <basics/utilities/UbSystem.h> - -#include "buildInfo.h" #include <cstring> using namespace std; /*===============================================================================*/ string WbWriterVtkXmlBinary::pvdEndTag =" </Collection>\n</VTKFile>"; - -std::string WbWriterVtkXmlBinary::getHeaderTag() -{ - std::string header = "<!--- \n"; - - header += "git-commit-hash=\""; - header += buildInfo::gitCommitHash(); - header += "\" \n"; - - header += "git-branch=\""; - header += buildInfo::gitBranch(); - header += "\" \n"; - - header += "compiler-flag=\""; - header += buildInfo::compilerFlags(); - header += "\" \n"; - - header += "buildMachine=\""; - header += buildInfo::buildMachine(); - header += "\" \n"; - - header += "ProjectDir=\""; - header += buildInfo::projectDir(); - header += "\" \n"; - - header += "binaryDir=\""; - header += buildInfo::binaryDir(); - header += "\" \n"; - - - header += "-->\n"; - return header; -} - /*===============================================================================*/ string WbWriterVtkXmlBinary::writeCollection(const string& filename, const vector<string>& filenames, const double& timeStep, const bool& sepGroups) { @@ -1195,7 +1190,6 @@ string WbWriterVtkXmlBinary::writeOctsWithCellData(const string& filename,vector return vtkfilename; } /*===============================================================================*/ - string WbWriterVtkXmlBinary::writeOctsWithNodeData(const string& filename,vector<UbTupleFloat3 >& nodes, vector<UbTupleUInt8 >& cells, vector<string >& datanames, vector<vector<double > >& nodedata) { string vtkfilename = filename+getFileExtension(); @@ -1223,7 +1217,6 @@ string WbWriterVtkXmlBinary::writeOctsWithNodeData(const string& filename,vector unsigned long long offset = 0; //VTK FILE out<<"<?xml version=\"2.0\"?>\n"; - out<< getHeaderTag(); out<<"<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" >"<<"\n"; out<<" <UnstructuredGrid>"<<"\n"; out<<" <Piece NumberOfPoints=\""<<nofNodes<<"\" NumberOfCells=\""<<nofCells<<"\">\n"; @@ -1312,7 +1305,7 @@ string WbWriterVtkXmlBinary::writeOctsWithNodeData(const string& filename,vector //float tmp = (float)nodedata[s][d]; //out.write((char*)&tmp,sizeof(float)); double tmp = nodedata[s][d]; - out.write((char*)&tmp,sizeof(double)); + out.write((char*)&tmp,sizeof(double)); } } out<<"\n</AppendedData>\n"; diff --git a/src/basics/basics/writer/WbWriterVtkXmlBinary.h b/src/basics/basics/writer/WbWriterVtkXmlBinary.h index 81c0a3aeaf43c409cf9b3d2c7d10ae88577a06f7..b4b03cf68efe298d42a64d003ef6cb9d495e95ba 100644 --- a/src/basics/basics/writer/WbWriterVtkXmlBinary.h +++ b/src/basics/basics/writer/WbWriterVtkXmlBinary.h @@ -1,19 +1,45 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file WbWriterVtkXmlBinary.h +//! \ingroup writer +//! \author Soeren Freudiger, Sebastian Geller +//======================================================================================= #ifndef WBWRITERVTKXMLBINARY_H #define WBWRITERVTKXMLBINARY_H #include <string> -#include "basics_export.h" - #include <basics/writer/WbWriter.h> -class BASICS_EXPORT WbWriterVtkXmlBinary : public WbWriter +class WbWriterVtkXmlBinary : public WbWriter { public: -#ifndef SWIG - OBCREATOR_EXT( WbWriterVtkXmlBinary ) -#endif - static WbWriterVtkXmlBinary* getInstance() { static WbWriterVtkXmlBinary instance; @@ -34,8 +60,6 @@ private: public: std::string getFileExtension() { return ".bin.vtu"; } - std::string getHeaderTag(); - //write a metafile std::string writeCollection(const std::string& filename, const std::vector<std::string>& filenames, const double& timestep, const bool& sepGroups); std::string addFilesToCollection(const std::string& filename, const std::vector<std::string>& filenames, const double& timestep, const bool& sepGroups); @@ -94,8 +118,4 @@ private: }; -#ifndef SWIG -UB_AUTO_RUN_NAMED(ObFactory<WbWriter>::getInstance()->addObCreator(ObSingletonCreatorImpl<WbWriterVtkXmlBinary ,WbWriter>::getInstance()), CAB_WbWriterVtkXmlBinary); -#endif - #endif //WBWRITERVTKXMLBINARY_H diff --git a/src/basics/basics/writer/WbWriterX3D.h b/src/basics/basics/writer/WbWriterX3D.h index 6bb503f1c71fbd462a0f36e07e0a270051c48e29..2cea1c46ddc537f080dc8e7081cd92bc406b147c 100644 --- a/src/basics/basics/writer/WbWriterX3D.h +++ b/src/basics/basics/writer/WbWriterX3D.h @@ -8,8 +8,6 @@ class WbWriterX3D : public WbWriter { public: - OBCREATOR_EXT( WbWriterX3D ) - static WbWriterX3D* getInstance() { static WbWriterX3D instance; @@ -33,6 +31,4 @@ public: std::string writeTriangles(const std::string& filename,std::vector<UbTupleFloat3 >& nodes, std::vector<UbTupleInt3 >& triangles); }; -UB_AUTO_RUN_NAMED(ObFactory<WbWriter>::getInstance()->addObCreator(ObSingletonCreatorImpl<WbWriterX3D ,WbWriter>::getInstance()), CAB_WbWriterX3D); - #endif //WBWRITERX3D_H diff --git a/src/basics/basics/writer/package.include b/src/basics/basics/writer/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/basics/numerics/geometry3d/CoordinateTransformation3D.cpp b/src/basics/geometry3d/CoordinateTransformation3D.cpp similarity index 82% rename from src/basics/numerics/geometry3d/CoordinateTransformation3D.cpp rename to src/basics/geometry3d/CoordinateTransformation3D.cpp index ba219df7783bad16901e7f3f5d01ce9913550795..c54d0e1c68865028e6c99b10b4c79e252606d84d 100644 --- a/src/basics/numerics/geometry3d/CoordinateTransformation3D.cpp +++ b/src/basics/geometry3d/CoordinateTransformation3D.cpp @@ -1,4 +1,36 @@ -#include <numerics/geometry3d/CoordinateTransformation3D.h> +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file CoordinateTransformation3D.cpp +//! \ingroup geometry3d +//! \author Soeren Freudiger, Sebastian Geller +//======================================================================================= +#include <geometry3d/CoordinateTransformation3D.h> #include <basics/utilities/UbMath.h> using namespace std; @@ -42,7 +74,9 @@ CoordinateTransformation3D::CoordinateTransformation3D(CoordinateTransformation3 // } /*======================================================*/ -/**==== Set transformation values +/**==== Set transformation values ====**/ +/*! +\brief Set transformation values @param a transformed coordinate system x0 (in global coordinates) @param b transformed coordinate system y0 (in global coordinates) @param c transformed coordinate system z0 (in global coordinates) @@ -52,8 +86,8 @@ CoordinateTransformation3D::CoordinateTransformation3D(CoordinateTransformation3 @param alpha rotation around z angle (positive FROM global TO transformed coordinate system) @param beta rotation around y angle @param gamma rotation around x angle -@exception IllegalArgumentException if one of the scale values is between -1.0E-8 and 1.0E-8 -**/ +@exception IllegalArgumentException if c1 of the scale values is between -1.0E-8 and 1.0E-8 +*/ void CoordinateTransformation3D::setTransformationValues(const double& originX1, const double& originX2, const double& originX3, const double& dx1, const double& dx2, const double& dx3, const double& alpha, const double& beta, const double& gamma) { @@ -124,7 +158,7 @@ void CoordinateTransformation3D::setTransformationValues(const double& originX1, this->transformation = true; } /*======================================================*/ -/** +/*! Set transformation active state (if this IS a transformation) @param active true to be active, false otherwise **/ @@ -134,7 +168,7 @@ void CoordinateTransformation3D::setActive(const bool& active) if(this->transformation) this->active = active; } /*======================================================*/ -/** +/*! Transform FROM global coordinates TO transformed coordinates. @param x1 the global x coordinate @param x2 the global y coordinate @@ -158,7 +192,7 @@ double CoordinateTransformation3D::transformForwardToX3Coordinate(const double& else return x3; } /*======================================================*/ -/** +/*! Transform FROM global coordinates TO transformed coordinates (ignoring rotation). @param x1 the global x coordinate **/ @@ -180,7 +214,7 @@ double CoordinateTransformation3D::transformForwardToX3CoordinateIgnoringRotatio else return x3; } /*======================================================*/ -/** +/*! Transform FROM transformed coordinates TO global coordinates. @param x1 the transformed x coordinate @param x2 the transformed y coordinate @@ -204,7 +238,7 @@ double CoordinateTransformation3D::transformBackwardToX3Coordinate(const double& else return x3; } /*======================================================*/ -/** +/*! Transform FROM transformed coordinates TO global coordinates (ignoring rotation). @param x1 the transformed x coordinate **/ @@ -226,7 +260,7 @@ double CoordinateTransformation3D::transformBackwardToX3CoordinateIgnoringRotati else return x3; } /*======================================================*/ -/** +/*! Returns a string representation of this transformation. @return a string representation of this transformation **/ diff --git a/src/basics/numerics/geometry3d/CoordinateTransformation3D.h b/src/basics/geometry3d/CoordinateTransformation3D.h similarity index 52% rename from src/basics/numerics/geometry3d/CoordinateTransformation3D.h rename to src/basics/geometry3d/CoordinateTransformation3D.h index 3179de328f23d2b6035f9297a54acd203d1402ba..362da6b624a32688841c223b14c5344ae9df5bb9 100644 --- a/src/basics/numerics/geometry3d/CoordinateTransformation3D.h +++ b/src/basics/geometry3d/CoordinateTransformation3D.h @@ -1,46 +1,68 @@ -// _ ___ __ __________ _ __ -// | | / (_)____/ /___ ______ _/ / ____/ /_ __(_)___/ /____ -// | | / / / ___/ __/ / / / __ `/ / /_ / / / / / / __ / ___/ -// | |/ / / / / /_/ /_/ / /_/ / / __/ / / /_/ / / /_/ (__ ) -// |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ // +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file CoordinateTransformation3D.cpp +//! \ingroup geometry3d +//! \author Soeren Freudiger, Sebastian Geller +//======================================================================================= #ifndef COORDINATETRANSFORMATION3D_H #define COORDINATETRANSFORMATION3D_H -#ifdef RCF_USE_BOOST_SERIALIZATION - #include <boost/archive/text_oarchive.hpp> - #include <boost/archive/text_iarchive.hpp> -#endif //RCF_USE_BOOST_SERIALIZATION - #include <cmath> #include <string> #include <sstream> #include <basics/utilities/UbException.h> -#include <basics/utilities/UbFileInput.h> -#include <basics/utilities/UbFileOutput.h> #include <PointerDefinitions.h> -//description: x1/x2/x3 = alt, x1*/x2*/x3* = neu -// x2 -// ^ x* -// | / -// | 2* -// 4 / -// | / -// 3 1* => neues coordsys ist um originX1=originX2=originX3=2 verschoben -// | / neues dx1=dx2=dx2=2 -> skalierung um 2 in x1-,x2- und x3-richtung -// 2 / ERST verdrehung um alpha um "x1" achse -// | \ DANN verdrehung um beta um "x2" achse -// 1 \ DANN verdrehung um gamma um "x3" achse -// | x1* -// |--1--2--3--4--5------------- > x1 -// -// Bemerkung: kann sein, dass die Verdrehung um x1 und x3 vertauschst sind -// - muss mal einer pr�fen ... - - +/////////////////////////////////////////////////////////////////////////////////////// +//! +//! \brief A class provides 3d coordinate transformation +//! \details +//! description: x1/x2/x3 = old, x1*/x2*/x3* = new +//! x2 +//! ^ x* +//! | / +//! | 2* +//! 4 / +//! | / +//! 3 1* => new coordsys is translated by originX1=originX2=originX3=2 +//! | / new dx1=dx2=dx2=2 -> scaling by 2 in x1-,x2- und x3-direction +//! 2 / FIRST rotation by alpha around "x1" axis +//! | \ THEN rotation by beta around "x2" axis +//! 1 \ THEN rotation by gamma around "x3" axis +//! | x1* +//! |--1--2--3--4--5------------- > x1 +//! +//! Remark: It might be that the rotations around x1 and x3 axis are swapped. +//! +////////////////////////////////////////////////////////////////////////////////////// class CoordinateTransformation3D { @@ -61,7 +83,7 @@ public: double getRotationX2Angle() const { return this->beta; } double getRotationX3Angle() const { return this->gamma; } //Rotation - //Achtung die Winkel passen nicht �berein -siehe setTransformationValues + //Achtung die Winkel passen nicht ueberein -siehe setTransformationValues void setRotationX1Angle(double alpha) { this->setTransformationValues(this->Tx1, this->Tx2, this->Tx3, this->Sx1, this->Sx2, this->Sx3, alpha, this->beta, this->gamma); } void setRotationX2Angle(double beta ) { this->setTransformationValues(this->Tx1, this->Tx2, this->Tx3, this->Sx1, this->Sx2, this->Sx3, this->alpha, beta, this->gamma); } void setRotationX3Angle(double gamma) { this->setTransformationValues(this->Tx1, this->Tx2, this->Tx3, this->Sx1, this->Sx2, this->Sx3, this->alpha, this->beta, gamma); } @@ -84,58 +106,6 @@ public: double transformBackwardToX3CoordinateIgnoringRotation(const double& x3) const; std::string toString() const; - //------------- implements CAB serialization ----- start - void write(UbFileOutput* out) const - { - out->writeString("Coordtransfomartion3D"); - out->writeDouble(this->Tx1); - out->writeDouble(this->Tx2); - out->writeDouble(this->Tx3); - out->writeDouble(this->Sx1); - out->writeDouble(this->Sx2); - out->writeDouble(this->Sx3); - out->writeDouble(this->alpha); - out->writeDouble(this->beta ); - out->writeDouble(this->gamma); - } - void read(UbFileInput* in) - { - in->readString(); - this->Tx1 = in->readDouble(); - this->Tx2 = in->readDouble(); - this->Tx3 = in->readDouble(); - this->Sx1 = in->readDouble(); - this->Sx2 = in->readDouble(); - this->Sx3 = in->readDouble(); - this->alpha = in->readDouble(); - this->beta = in->readDouble(); - this->gamma = in->readDouble(); - - this->setTransformationValues(Tx1,Tx2,Tx3,Sx1,Sx2,Sx3,alpha,beta,gamma); - } - //------------- implements CAB serialization ----- end - -#ifdef CAB_RCF - template<class Archive> - void SF_SERIALIZE(Archive & ar) - { - ar & Tx1; ar & Tx2; ar & Tx3; - ar & Sx1; ar & Sx2; ar & Sx3; - ar & alpha; ar & beta; ar & gamma; - - ar & toX1factorX1; ar & toX1factorX2; ar & toX1factorX3; ar & toX1delta; - ar & toX2factorX1; ar & toX2factorX2; ar & toX2factorX3; ar & toX2delta; - ar & toX3factorX1; ar & toX3factorX2; ar & toX3factorX3; ar & toX3delta; - - ar & fromX1factorX1; ar & fromX1factorX2; ar & fromX1factorX3; ar & fromX1delta; - ar & fromX2factorX1; ar & fromX2factorX2; ar & fromX2factorX3; ar & fromX2delta; - ar & fromX3factorX1; ar & fromX3factorX2; ar & fromX3factorX3; ar & fromX3delta; - - ar & active; - ar & transformation; - } -#endif //CAB_RCF - private: double Tx1, Tx2, Tx3, Sx1, Sx2, Sx3, alpha, beta, gamma; @@ -150,11 +120,13 @@ private: bool active; bool transformation; - friend class MPIIOCoProcessor; - friend class MPIIORestartCoProcessor; - friend class MPIIOMigrationCoProcessor; - friend class MPIIOMigrationBECoProcessor; - friend class CheckpointConverter; + friend class MPIIOCoProcessor; + friend class MPIIORestartCoProcessor; + friend class MPIIOMigrationCoProcessor; + friend class MPIIOMigrationBECoProcessor; + friend class CheckpointConverter; + + }; #endif //COORDINATETRANSFORMATION3D_H diff --git a/src/basics/numerics/geometry3d/GbCuboid3D.cpp b/src/basics/geometry3d/GbCuboid3D.cpp similarity index 83% rename from src/basics/numerics/geometry3d/GbCuboid3D.cpp rename to src/basics/geometry3d/GbCuboid3D.cpp index 2fa48953c591304cf326623f73135fe967492a2b..f95e114285d77694c6bd26f6550cd26263af4e3f 100644 --- a/src/basics/numerics/geometry3d/GbCuboid3D.cpp +++ b/src/basics/geometry3d/GbCuboid3D.cpp @@ -1,18 +1,43 @@ -#include <numerics/geometry3d/GbCuboid3D.h> -#include <numerics/geometry3d/creator/GbCuboid3DCreator.h> +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file GbCuboid3D.cpp +//! \ingroup geometry3d +//! \author Soeren Freudiger, Sebastian Geller +//======================================================================================= +#include <GbCuboid3D.h> +#include <GbSystem3D.h> +#include <GbTriangle3D.h> #include <basics/utilities/UbMath.h> -#include <numerics/geometry3d/GbSystem3D.h> -#include <numerics/geometry3d/GbTriangle3D.h> - using namespace std; -/*=======================================================*/ -ObObjectCreator* GbCuboid3D::getCreator() -{ - return GbCuboid3DCreator::getInstance(); -} /*=======================================================*/ // Konstruktor GbCuboid3D::GbCuboid3D() : GbObject3D() @@ -415,23 +440,6 @@ void GbCuboid3D::objectWillBeDeleted(UbObservable* objectForDeletion) //ACHTUNG: eigentlich muessten in allen methoden von GbLine if abfragen fuer NULL pointer hin... toDo } /*=======================================================*/ -void GbCuboid3D::write(UbFileOutput* out) -{ - out->writeString(this->getCreator()->getTypeID()); - p1->write(out); - p2->write(out); -} -/*=======================================================*/ -void GbCuboid3D::read(UbFileInput* in) -{ - in->readString(); - this->p1 = new GbPoint3D; - p1->read(in); - in->readString(); - this->p2 = new GbPoint3D; - p2->read(in); -} -/*=======================================================*/ void GbCuboid3D::translate(const double& tx1, const double& tx2, const double& tx3) { this->p1->translate(tx1, tx2, tx3); @@ -556,78 +564,4 @@ double GbCuboid3D::getIntersectionRaytraceFactor(const double& x1, const double& return maxT[whichPlane] ; /* ray hits box */ } -/*==========================================================*/ -// double GbCuboid3D::getIntersectionRaytraceFactor(const double& x1, const double& x2, const double& x3, const double& rx1, const double& rx2, const double& rx3) -// { -// double absX,absMaxX,absY,absMaxY,absZ,absMaxZ; -// -// if(rx1<0.0) absX = this->getX1Maximum() - x1; -// else absX = this->getX1Minimum() - x1; -// if(1-(rx1<0.0)) absMaxX = this->getX1Maximum() - x1; -// else absMaxX = this->getX1Minimum() - x1; -// -// if(rx2<0.0) absY = this->getX2Maximum() - x2; -// else absY = this->getX2Minimum() - x2; -// if(1-(rx2<0.0)) absMaxY = this->getX2Maximum() - x2; -// else absMaxY = this->getX2Minimum() - x2; -// -// if(rx3<0.0) absZ = this->getX3Maximum() - x3; -// else absZ = this->getX3Minimum() - x3; -// if(1-(rx3<0.0)) absMaxZ = this->getX3Maximum() - x3; -// else absMaxZ = this->getX3Minimum() - x3; -// -// -// //tmin ist die verschneidung des Gerade (Ray) durch die naehere Gerade (MinX oder MaxX) -// //tmax ist die verschneidung des Gerade (Ray) durch die weiteste Gerade (MinX oder MaxX) -// //analog fuer tymin und tymax -// double tmin, tymin, tzmin, tmax, tymax, tzmax; -// -// if(!UbMath::zero(rx1)) tmin = tmax = 1.0/rx1; -// else if(rx1<0.0) tmin = tmax = -UbMath::getPositiveInfinity<double>(); -// else tmin = tmax = UbMath::getPositiveInfinity<double>(); -// -// if(!UbMath::zero(rx2)) tymin = tymax = 1.0/rx2; -// else if(rx2<0.0) tymin = tymax = -UbMath::getPositiveInfinity<double>(); -// else tymin = tymax = UbMath::getPositiveInfinity<double>(); -// -// if(!UbMath::zero(rx3)) tzmin = tzmax = 1.0/rx3; -// else if(rx1<0.0) tzmin = tzmax = -UbMath::getPositiveInfinity<double>(); -// else tzmin = tzmax = UbMath::getPositiveInfinity<double>(); -// -// //tmin *= absX; -// //tmax *= absMaxX; -// //tymin *= absY; -// //tymax *= absMaxY; -// //tzmin *= absZ; -// //tzmax *= absMaxZ; -// -// //0 * 1/0 vermeiden, da es ein Undefined wert produziert -// if( !UbMath::zero(absX) || !UbMath::zero(rx1) ) tmin *= absX; -// else tmin = tymin; -// -// if( !UbMath::zero(absY) || !UbMath::zero(rx2)) tymin *= absY; -// else tymin = tmin; -// -// if( !UbMath::zero(absZ) || !UbMath::zero(rx3)) tzmin *= absZ; -// else tzmin = tymin; -// -// if( !UbMath::zero(absMaxX) || !UbMath::zero(rx1)) tmax *= absMaxX; -// else tmax = tymax; -// -// if( !UbMath::zero(absMaxY) || !UbMath::zero(rx2)) tymax *= absMaxY; -// else tymax = tmax; -// -// if( !UbMath::zero(absMaxZ) || !UbMath::zero(rx3)) tzmax *= absMaxZ; -// else tzmax = tymax; -// -// //in dieser Fall gibt es keine Verschneidung -// if( (tmin > tymax) || (tymin > tmax) ) return -1; -// -// tmin = UbMath::max(tmin,tymin,tzmin); -// tmax = UbMath::min(tmax,tymax,tzmax); -// -// if( (tmin > tzmax) || (tzmin > tmax) ) return -1; -// if(tmin >= 0.0) return tmin ; -// -// return tmax; -//} + diff --git a/src/basics/numerics/geometry3d/GbCuboid3D.h b/src/basics/geometry3d/GbCuboid3D.h similarity index 65% rename from src/basics/numerics/geometry3d/GbCuboid3D.h rename to src/basics/geometry3d/GbCuboid3D.h index fd43768768113b8fbb9933c92f95527c4cd2493a..992e423bca78e4eb0e1d8bc86d9387f26a13b2d0 100644 --- a/src/basics/numerics/geometry3d/GbCuboid3D.h +++ b/src/basics/geometry3d/GbCuboid3D.h @@ -1,20 +1,42 @@ -// _ ___ __ __________ _ __ -// | | / (_)____/ /___ ______ _/ / ____/ /_ __(_)___/ /____ -// | | / / / ___/ __/ / / / __ `/ / /_ / / / / / / __ / ___/ -// | |/ / / / / /_/ /_/ / /_/ / / __/ / / /_/ / / /_/ (__ ) -// |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ // +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file GbCuboid3D.h +//! \ingroup geometry3d +//! \author Soeren Freudiger, Sebastian Geller +//======================================================================================= #ifndef GBCUBOID3D_H #define GBCUBOID3D_H -#ifdef CAB_RCF - #include <3rdParty/rcf/RcfSerializationIncludes.h> -#endif //CAB_RCF - #include <vector> #include <cmath> -#include <numerics/geometry3d/GbPoint3D.h> +#include <GbPoint3D.h> #include <basics/utilities/UbObserver.h> #include <basics/utilities/UbMath.h> @@ -25,7 +47,7 @@ class GbObject3DCreator; class GbCuboid3D; typedef SPtr<GbCuboid3D> GbCuboid3DPtr; - +//! \brief This Class provides basic 3D box objects. class GbCuboid3D : public GbObject3D, public UbObserver { public: @@ -108,10 +130,6 @@ public: std::string toString(); - ObObjectCreator* getCreator(); - void write(UbFileOutput* out); - void read(UbFileInput* in); - //virtuelle Methoden von UbObserver void objectChanged(UbObservable* changedObject); void objectWillBeDeleted(UbObservable* objectForDeletion); @@ -119,26 +137,9 @@ public: using GbObject3D::isPointInGbObject3D; //Grund: dadurch muss man hier isPointInGbObject3D(GbPoint3D*) nicht ausprogrammieren, welche sonst hier "ueberdeckt" waere -#ifdef CAB_RCF - template<class Archive> - void SF_SERIALIZE(Archive & ar) - { - SF_SERIALIZE_PARENT<GbObject3D>(ar, *this); - ar & p1; - ar & p2; - } -#endif //CAB_RCF - protected: GbPoint3D* p1; GbPoint3D* p2; }; -#if defined(RCF_USE_SF_SERIALIZATION) && !defined(SWIG) - UB_AUTO_RUN_NAMED( SF::registerType<GbCuboid3D>("GbCuboid3D") , SF_GbCuboid3D ); - UB_AUTO_RUN_NAMED( ( SF::registerBaseAndDerived< GbObject3D, GbCuboid3D >()), SF_GbCuboid3D_BD1 ); - UB_AUTO_RUN_NAMED( ( SF::registerBaseAndDerived< UbObserver, GbCuboid3D>() ), SF_GbCuboid3D_BD2 ); -#endif //RCF_USE_SF_SERIALIZATION - - #endif diff --git a/src/basics/numerics/geometry3d/GbCylinder3D.cpp b/src/basics/geometry3d/GbCylinder3D.cpp similarity index 98% rename from src/basics/numerics/geometry3d/GbCylinder3D.cpp rename to src/basics/geometry3d/GbCylinder3D.cpp index 1adec348affca3b035a9dea14d2f6856ad6b1d73..f45fe77abe1b3015cbc6b6b3357ddf2c72cc0f90 100644 --- a/src/basics/numerics/geometry3d/GbCylinder3D.cpp +++ b/src/basics/geometry3d/GbCylinder3D.cpp @@ -1,18 +1,11 @@ -#include <numerics/geometry3d/GbCylinder3D.h> -#include <numerics/geometry3d/GbSystem3D.h> -#include <numerics/geometry3d/GbPoint3D.h> -#include <numerics/geometry3d/GbTriangle3D.h> +#include <geometry3d/GbCylinder3D.h> +#include <geometry3d/GbSystem3D.h> +#include <geometry3d/GbPoint3D.h> +#include <geometry3d/GbTriangle3D.h> #include <basics/utilities/UbInfinity.h> -#include <numerics/geometry3d/creator/GbCylinder3DCreator.h> - using namespace std; -/*=======================================================*/ -ObObjectCreator* GbCylinder3D::getCreator() -{ - return GbCylinder3DCreator::getInstance(); -} // Konstruktor /*==========================================================*/ GbCylinder3D::GbCylinder3D() @@ -1049,23 +1042,7 @@ void GbCylinder3D::scale(const double& sx1, const double& sx2, const double& sx3 this->mLine->scale(sx1,sx2,sx3); //notify observer wird automatisch aufgerufen } -/*==========================================================*/ -void GbCylinder3D::write(UbFileOutput* out) -{ - out->writeString(this->getCreator()->getTypeID()); - mLine->write(out); - out->writeDouble(mRad); - out->writeInteger(cylinderType); -} -/*==========================================================*/ -void GbCylinder3D::read(UbFileInput* in) -{ - in->readString(); - mLine = new GbLine3D; - mLine->read(in); - mRad = in->readDouble(); - cylinderType = in->readInteger(); -} + /*==========================================================*/ double GbCylinder3D::getIntersectionRaytraceFactor(const double& x1, const double& x2, const double& x3, const double& rx1, const double& rx2, const double& rx3) { diff --git a/src/basics/numerics/geometry3d/GbCylinder3D.h b/src/basics/geometry3d/GbCylinder3D.h similarity index 83% rename from src/basics/numerics/geometry3d/GbCylinder3D.h rename to src/basics/geometry3d/GbCylinder3D.h index e32d2008f20d50a20be917b431152bf24630d5a2..04cdbb802ed4ce659097e258e341dd92e96c8766 100644 --- a/src/basics/numerics/geometry3d/GbCylinder3D.h +++ b/src/basics/geometry3d/GbCylinder3D.h @@ -7,15 +7,12 @@ #ifndef GBCYLINDER3D_H #define GBCYLINDER3D_H -#ifdef CAB_RCF - #include <3rdParty/rcf/RcfSerializationIncludes.h> -#endif //CAB_RCF #include <vector> #include <cmath> -#include <numerics/geometry3d/GbObject3D.h> -#include <numerics/geometry3d/GbLine3D.h> +#include <geometry3d/GbObject3D.h> +#include <geometry3d/GbLine3D.h> #include <basics/utilities/UbObserver.h> class GbPoint3D; @@ -100,27 +97,11 @@ public: void addSurfaceTriangleSetSegments(std::vector<UbTupleFloat3>& nodes, std::vector<UbTupleInt3>& triangles, int segmentsRound, int segmentsHeight ); std::string toString(); - ObObjectCreator* getCreator(); - void write(UbFileOutput* out); - void read(UbFileInput* in); //virtuelle Methoden von UbObserver void objectChanged(UbObservable* changedObject); void objectWillBeDeleted(UbObservable* objectForDeletion); -#ifdef CAB_RCF - template<class Archive> - void SF_SERIALIZE(Archive & ar) - { - SF_SERIALIZE_PARENT<GbObject3D>(ar, *this); - ar & mLine; - ar & mRad; - ar & cylinderType; - - if( ArchiveTools::isReading(ar) ) - this->calculateValues(); - } -#endif //CAB_RCF using GbObject3D::isPointInGbObject3D; //Grund: dadurch muss man hier isPointInGbObject3D(GbPoint3D*) nicht ausprogrammieren, welche sonst hier "ueberdeckt" waere @@ -144,10 +125,4 @@ protected: static const int X3PARALLEL = (1<<3); //8 }; -#if defined(RCF_USE_SF_SERIALIZATION) && !defined(SWIG) - UB_AUTO_RUN_NAMED( SF::registerType<GbCylinder3D >("GbCylinder3D") , SF_GbCylinder3D ); - UB_AUTO_RUN_NAMED( ( SF::registerBaseAndDerived< GbObject3D, GbCylinder3D >() ), SF_GbCylinder3D_BD1 ); - UB_AUTO_RUN_NAMED( ( SF::registerBaseAndDerived< UbObserver, GbCylinder3D>() ), SF_GbCylinder3D_BD2 ); -#endif //RCF_USE_SF_SERIALIZATION - #endif diff --git a/src/basics/numerics/geometry3d/GbHalfSpace3D.cpp b/src/basics/geometry3d/GbHalfSpace3D.cpp similarity index 98% rename from src/basics/numerics/geometry3d/GbHalfSpace3D.cpp rename to src/basics/geometry3d/GbHalfSpace3D.cpp index cb4ec6c4e41b34f4925552fa2378fe1cb2b81c59..04d8a39d8ea3760610c36089cb52bd968aa3d83e 100644 --- a/src/basics/numerics/geometry3d/GbHalfSpace3D.cpp +++ b/src/basics/geometry3d/GbHalfSpace3D.cpp @@ -1,4 +1,4 @@ -#include <numerics/geometry3d/GbHalfSpace3D.h> +#include <geometry3d/GbHalfSpace3D.h> using namespace std; diff --git a/src/basics/numerics/geometry3d/GbHalfSpace3D.h b/src/basics/geometry3d/GbHalfSpace3D.h similarity index 95% rename from src/basics/numerics/geometry3d/GbHalfSpace3D.h rename to src/basics/geometry3d/GbHalfSpace3D.h index 4e4dd86ebaeca267aa980c9c456571d06284a6e5..b63f550dd6d7e2760e126ce3e945fd41907f93a3 100644 --- a/src/basics/numerics/geometry3d/GbHalfSpace3D.h +++ b/src/basics/geometry3d/GbHalfSpace3D.h @@ -12,9 +12,9 @@ #include <basics/utilities/UbMath.h> -#include <numerics/geometry3d/GbPoint3D.h> -#include <numerics/geometry3d/GbTriangle3D.h> -#include <numerics/geometry3d/GbVector3D.h> +#include <geometry3d/GbPoint3D.h> +#include <geometry3d/GbTriangle3D.h> +#include <geometry3d/GbVector3D.h> #include <PointerDefinitions.h> diff --git a/src/basics/numerics/geometry3d/GbHalfSpaceKrischan3D.cpp b/src/basics/geometry3d/GbHalfSpaceKrischan3D.cpp similarity index 99% rename from src/basics/numerics/geometry3d/GbHalfSpaceKrischan3D.cpp rename to src/basics/geometry3d/GbHalfSpaceKrischan3D.cpp index 522f52f0af1e02434c27781e9d53cd2340ca6544..b8a00c647d335fb13d0031f2908a77ffbada8c62 100644 --- a/src/basics/numerics/geometry3d/GbHalfSpaceKrischan3D.cpp +++ b/src/basics/geometry3d/GbHalfSpaceKrischan3D.cpp @@ -1,4 +1,4 @@ -#include <numerics/geometry3d/GbHalfSpaceKrischan3D.h> +#include <geometry3d/GbHalfSpaceKrischan3D.h> using namespace std; diff --git a/src/basics/numerics/geometry3d/GbHalfSpaceKrischan3D.h b/src/basics/geometry3d/GbHalfSpaceKrischan3D.h similarity index 95% rename from src/basics/numerics/geometry3d/GbHalfSpaceKrischan3D.h rename to src/basics/geometry3d/GbHalfSpaceKrischan3D.h index a9146718bd79bf695023ed1bf3eb248622338477..b51849282b2e6a171b0036fbdac778ea79f58037 100644 --- a/src/basics/numerics/geometry3d/GbHalfSpaceKrischan3D.h +++ b/src/basics/geometry3d/GbHalfSpaceKrischan3D.h @@ -12,10 +12,10 @@ #include <basics/utilities/UbMath.h> -#include <numerics/geometry3d/GbPoint3D.h> -#include <numerics/geometry3d/GbTriangle3D.h> -#include <numerics/geometry3d/GbVector3D.h> -#include <numerics/geometry3d/GbLine3D.h> +#include <geometry3d/GbPoint3D.h> +#include <geometry3d/GbTriangle3D.h> +#include <geometry3d/GbVector3D.h> +#include <geometry3d/GbLine3D.h> /*=========================================================================*/ /* GbHalfSpaceKrischan3D */ @@ -74,7 +74,6 @@ public: } void finalize(){} - ObObjectCreator* getCreator(){ return NULL; } double getX1Centroid(){ return 0.0; } double getX1Minimum() { return -99999.0; } @@ -86,8 +85,6 @@ public: double getX3Minimum() { return -99999.0; } double getX3Maximum() { return 99999.0; } - void write(UbFileOutput* out){} - void read(UbFileInput* in){} GbLine3D* createClippedLine3D (GbPoint3D &point1, GbPoint3D &point2) { diff --git a/src/basics/numerics/geometry3d/GbLine3D.cpp b/src/basics/geometry3d/GbLine3D.cpp similarity index 75% rename from src/basics/numerics/geometry3d/GbLine3D.cpp rename to src/basics/geometry3d/GbLine3D.cpp index cac15fa0591cbb0f1ce57b2fa78afde6fdca7b31..9d4c5a6c4aaeb33535e276fc7a283bae35c1882e 100644 --- a/src/basics/numerics/geometry3d/GbLine3D.cpp +++ b/src/basics/geometry3d/GbLine3D.cpp @@ -1,16 +1,42 @@ -#include <numerics/geometry3d/GbLine3D.h> -#include <numerics/geometry3d/creator/GbLine3DCreator.h> - -#include <numerics/geometry3d/GbSystem3D.h> -#include <numerics/geometry3d/GbCuboid3D.h> -#include <numerics/geometry3d/GbTriangle3D.h> +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file GbLine3D.cpp +//! \ingroup geometry3d +//! \author Soeren Freudiger, Sebastian Geller +//======================================================================================= +#include <GbLine3D.h> +#include <GbSystem3D.h> +#include <GbCuboid3D.h> +#include <GbTriangle3D.h> using namespace std; -ObObjectCreator* GbLine3D::getCreator() -{ - return GbLine3DCreator::getInstance(); -} /*=======================================================*/ GbLine3D::GbLine3D() { @@ -183,26 +209,6 @@ void GbLine3D::objectWillBeDeleted(UbObservable* objectForDeletion) //ACHTUNG: eigentlich muessten in allen methoden von GbLine if abfragen fuer NULL pointer hin... toDo } /*==========================================================*/ -void GbLine3D::write(UbFileOutput* out) -{ - out->writeString(this->getCreator()->getTypeID()); - p1->write(out); - p2->write(out); -} -/*==========================================================*/ -void GbLine3D::read(UbFileInput* in) -{ - p1 = new GbPoint3D; - p2 = new GbPoint3D; - in->readString(); - p1->read(in); - p1->addObserver(this); - in->readString(); - p2->read(in); - p2->addObserver(this); - this->calculateValues(); -} -/*==========================================================*/ void GbLine3D::scale(const double& sx1, const double& sx2, const double& sx3) { double p1X1 = this->p1->getX1Coordinate(); diff --git a/src/basics/numerics/geometry3d/GbLine3D.h b/src/basics/geometry3d/GbLine3D.h similarity index 57% rename from src/basics/numerics/geometry3d/GbLine3D.h rename to src/basics/geometry3d/GbLine3D.h index d338db3e54e3e2a98d653fdc19a14c69ae5487d4..2990282f9509645bf3f841e9fcc296acafc395ad 100644 --- a/src/basics/numerics/geometry3d/GbLine3D.h +++ b/src/basics/geometry3d/GbLine3D.h @@ -1,38 +1,58 @@ -// _ ___ __ __________ _ __ -// | | / (_)____/ /___ ______ _/ / ____/ /_ __(_)___/ /____ -// | | / / / ___/ __/ / / / __ `/ / /_ / / / / / / __ / ___/ -// | |/ / / / / /_/ /_/ / /_/ / / __/ / / /_/ / / /_/ (__ ) -// |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ // +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file GbLine3D.h +//! \ingroup geometry3d +//! \author Soeren Freudiger, Sebastian Geller +//======================================================================================= #ifndef GBLINE3D_H #define GBLINE3D_H -#ifdef CAB_RCF - #include <3rdParty/rcf/RcfSerializationIncludes.h> -#endif //CAB_RCF - #include <sstream> #include <cmath> #include <basics/utilities/UbObserver.h> -#include <numerics/geometry3d/GbObject3D.h> -#include <numerics/geometry3d/GbPoint3D.h> +#include <GbObject3D.h> +#include <GbPoint3D.h> class GbCuboid3D; -class GbObject3DCreator; #include <PointerDefinitions.h> - -/*=========================================================================*/ -/* GbLine3D */ -/* */ -/** - * This Class provides basic 3D line objects. - * The describing points are observed by 3D line objects. - * <BR><BR><HR> -*/ +////////////////////////////////////////////////////////////////////////// +//! +//! \class GbLine3D +//! +//! \brief This Class provides basic 3D line objects. +//! \details The describing points are observed by 3D line objects. +//! +////////////////////////////////////////////////////////////////////////// class GbLine3D : public GbObject3D , public UbObserver { @@ -101,21 +121,6 @@ public: void objectWillBeDeleted(UbObservable* objectForDeletion); std::string toString(); - ObObjectCreator* getCreator(); - void write(UbFileOutput* out); - void read(UbFileInput* in); - -#ifdef CAB_RCF - template<class Archive> - void SF_SERIALIZE(Archive & ar) - { - SF_SERIALIZE_PARENT<GbObject3D>(ar, *this); - ar & p1; - ar & p2; - ar & length; - if( ArchiveTools::isReading(ar) ) this->calculateValues(); - } -#endif //CAB_RCF using GbObject3D::isPointInGbObject3D; //Grund: dadurch muss man hier isPointInGbObject3D(GbPoint3D*) nicht ausprogrammieren, welche sonst hier "ueberdeckt" waere protected: @@ -127,10 +132,4 @@ private: void calculateValues(); }; -#ifdef RCF_USE_SF_SERIALIZATION - UB_AUTO_RUN_NAMED( SF::registerType<GbLine3D>("GbLine3D"), SF_GbLine3D ); - UB_AUTO_RUN_NAMED( ( SF::registerBaseAndDerived< GbObject3D, GbLine3D >()), SF_GbLine3D_BD1 ); - UB_AUTO_RUN_NAMED( ( SF::registerBaseAndDerived< UbObserver, GbLine3D>() ), SF_GbLine3D_BD2 ); -#endif //RCF_USE_SF_SERIALIZATION - #endif diff --git a/src/basics/numerics/geometry3d/GbMeshTools3D.h b/src/basics/geometry3d/GbMeshTools3D.h similarity index 100% rename from src/basics/numerics/geometry3d/GbMeshTools3D.h rename to src/basics/geometry3d/GbMeshTools3D.h diff --git a/src/basics/numerics/geometry3d/GbObject3D.cpp b/src/basics/geometry3d/GbObject3D.cpp similarity index 60% rename from src/basics/numerics/geometry3d/GbObject3D.cpp rename to src/basics/geometry3d/GbObject3D.cpp index b48d256ee86c3a009b223c85672c219505bc28ff..1e96e72f3e00d8d24b717e670e2aff6f622b8413 100644 --- a/src/basics/numerics/geometry3d/GbObject3D.cpp +++ b/src/basics/geometry3d/GbObject3D.cpp @@ -1,14 +1,41 @@ -#include <numerics/geometry3d/GbObject3D.h> -#include <numerics/geometry3d/creator/GbObject3DCreator.h> -#include <numerics/geometry3d/GbPoint3D.h> +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file GbObject3D.cpp +//! \ingroup geometry3d +//! \author Soeren Freudiger, Sebastian Geller +//======================================================================================= +#include <GbObject3D.h> +#include <GbPoint3D.h> #include <basics/utilities/UbMath.h> using namespace std; -string GbObject3D::getTypeID() -{ - return this->getCreator()->getTypeID(); -} /*======================================================================*/ bool GbObject3D::isPointInGbObject3D(GbPoint3D* p) { diff --git a/src/basics/numerics/geometry3d/GbObject3D.h b/src/basics/geometry3d/GbObject3D.h similarity index 68% rename from src/basics/numerics/geometry3d/GbObject3D.h rename to src/basics/geometry3d/GbObject3D.h index 9536a82536ed5a1d863c92927c55f78de19364cc..09a3ef38bcd66d3dc907da2a49c0e5db6ae110a6 100644 --- a/src/basics/numerics/geometry3d/GbObject3D.h +++ b/src/basics/geometry3d/GbObject3D.h @@ -1,9 +1,35 @@ -// _ ___ __ __________ _ __ -// | | / (_)____/ /___ ______ _/ / ____/ /_ __(_)___/ /____ -// | | / / / ___/ __/ / / / __ `/ / /_ / / / / / / __ / ___/ -// | |/ / / / / /_/ /_/ / /_/ / / __/ / / /_/ / / /_/ (__ ) -// |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ // +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file GbObject3D.h +//! \ingroup geometry3d +//! \author Soeren Freudiger, Sebastian Geller +//======================================================================================= #ifndef GBOBJECT3D_H #define GBOBJECT3D_H @@ -11,14 +37,8 @@ #include <vector> -#ifdef CAB_RCF - #include <3rdParty/rcf/RcfSerializationIncludes.h> -#endif //CAB_RCF - #include <basics/utilities/UbSystem.h> #include <basics/utilities/UbException.h> -#include <basics/utilities/UbFileInput.h> -#include <basics/utilities/UbFileOutput.h> #include <basics/utilities/UbObservable.h> #include <basics/utilities/UbTuple.h> #include <basics/objects/ObObject.h> @@ -28,47 +48,23 @@ class GbLine3D; class GbTriangle3D; class GbObject3DCreator; -#ifdef CAB_CTL -#include <ctl.h> -#endif - -#include "basics_export.h" #include <PointerDefinitions.h> +////////////////////////////////////////////////////////////////////////// +//! +//! \class GbObject3D +//! +//! \brief This Interface provides basic 3D geometry objects methods. +//! +////////////////////////////////////////////////////////////////////////// -/*=========================================================================*/ -/* GbObject3D */ -/* */ -/** - * This Interface provides basic 3D geometry objects methods. - * <BR><BR><HR> - * @author <A HREF="mailto:geller@cab.bau.tu-bs.de">S. Geller</A> - * @author <A HREF="mailto:muffmolch@gmx.de">S. Freudiger</A> - * @version 1.0 - 02.02.05 -*/ -class BASICS_EXPORT GbObject3D : public ObObject +class GbObject3D : public ObObject { public: -#ifdef CAB_CTL - virtual ctl::oStream &write(ctl::oStream &os) const - { - return os; - } - virtual ctl::iStream &read(ctl::iStream &is) - { - return is; - } -#endif - virtual ~GbObject3D(){} - //ueberschriebene methode von ObObject - virtual std::string getTypeID(); - //abstract Methods virtual void finalize() =0 ; //detroys also all dynamic objects (e.g. GbPoints in GbLine) - virtual ObObjectCreator* getCreator()=0; - /** * Returns the centroid x1 coordinate of this 3D object. * @return the centroid x1 coordinate of this 3D object @@ -129,9 +125,6 @@ public: virtual void translate(const double& x1, const double& x2, const double& x3) { throw UbException(UB_EXARGS,"not implemented for "+(std::string)typeid(*this).name() ); } virtual void scale(const double& sx1, const double& sx2, const double& sx3) { throw UbException(UB_EXARGS,"not implemented for "+(std::string)typeid(*this).name() ); } - virtual void write(UbFileOutput* out)=0; - virtual void read(UbFileInput* in)=0; - virtual bool isPointInGbObject3D(GbPoint3D* p); virtual bool isPointInGbObject3D(const double& x1, const double& x2, const double& x3, bool& pointIsOnBoundary)=0; virtual bool isPointInGbObject3D(const double& x1, const double& x2, const double& x3)=0; @@ -153,21 +146,7 @@ public: //|r| must be 1! einheitsvector!! //return negativ value oder zero if no intersection virtual double getIntersectionRaytraceFactor(const double& x1, const double& x2, const double& x3, const double& rx1, const double& rx2, const double& rx3) { throw UbException("GbObject3D::getIntersectionRaytraceFactor - not implemented"); } -#ifdef CAB_RCF - template<class Archive> - void SF_SERIALIZE(Archive & ar) - { - SF_SERIALIZE_PARENT<ObObject>(ar, *this); - } -#endif //CAB_RCF }; /*=========================================================================*/ -#if defined(RCF_USE_SF_SERIALIZATION) && !defined(SWIG) - SF_NO_CTOR(GbObject3D); - UB_AUTO_RUN_NAMED(SF::registerType<GbObject3D>("GbObject3D") , SF_GbObject3D); - UB_AUTO_RUN_NAMED( ( SF::registerBaseAndDerived<ObObject, GbObject3D >() ), SF_GbObject3D_BD1 ); -#endif //RCF_USE_SF_SERIALIZATION - - #endif diff --git a/src/basics/numerics/geometry3d/GbObjectGroup3D.cpp b/src/basics/geometry3d/GbObjectGroup3D.cpp similarity index 88% rename from src/basics/numerics/geometry3d/GbObjectGroup3D.cpp rename to src/basics/geometry3d/GbObjectGroup3D.cpp index 4a6301a4d4d48f1627296369e65964fe92f27e9d..54b40d5aed352b1daba03d94abdb35507f514dcc 100644 --- a/src/basics/numerics/geometry3d/GbObjectGroup3D.cpp +++ b/src/basics/geometry3d/GbObjectGroup3D.cpp @@ -1,8 +1,8 @@ -#include <numerics/geometry3d/GbObjectGroup3D.h> -#include <numerics/geometry3d/GbSystem3D.h> -#include <numerics/geometry3d/GbPoint3D.h> -#include <numerics/geometry3d/GbLine3D.h> -#include <numerics/geometry3d/GbTriangle3D.h> +#include <geometry3d/GbObjectGroup3D.h> +#include <geometry3d/GbSystem3D.h> +#include <geometry3d/GbPoint3D.h> +#include <geometry3d/GbLine3D.h> +#include <geometry3d/GbTriangle3D.h> using namespace std; @@ -107,18 +107,6 @@ void GbObjectGroup3D::addSurfaceTriangleSet(vector<UbTupleFloat3>& nodes, vector { } /*=======================================================*/ -void GbObjectGroup3D::write(UbFileOutput* out) -{ - out->writeString(this->getCreator()->getTypeID()); - midPoint->write(out); - out->writeDouble(radius); - out->writeInteger((int)triangulationMode); -} -/*=======================================================*/ -void GbObjectGroup3D::read(UbFileInput* in) -{ -} -/*=======================================================*/ bool GbObjectGroup3D::hasIntersectionWithDirectedLine(GbPoint3D origin, GbPoint3D direction) { return false; diff --git a/src/basics/numerics/geometry3d/GbObjectGroup3D.h b/src/basics/geometry3d/GbObjectGroup3D.h similarity index 83% rename from src/basics/numerics/geometry3d/GbObjectGroup3D.h rename to src/basics/geometry3d/GbObjectGroup3D.h index 49c00da70586ebf1f52a65011a70e4f321de4696..fac78a728de7303a937ecb6db473f5357c7b7b3c 100644 --- a/src/basics/numerics/geometry3d/GbObjectGroup3D.h +++ b/src/basics/geometry3d/GbObjectGroup3D.h @@ -7,9 +7,6 @@ #ifndef GBOBJECTGROUP3D_H #define GBOBJECTGROUP3D_H -#ifdef CAB_RCF - #include <3rdParty/rcf/RcfSerializationIncludes.h> -#endif //CAB_RCF #ifdef CAB_CTL #include <ctl.h> #endif //CAB_CTL @@ -17,9 +14,9 @@ #include <vector> #include <cmath> -#include <numerics/geometry3d/GbObject3D.h> +#include <geometry3d/GbObject3D.h> #include <basics/utilities/UbObserver.h> -#include <numerics/geometry3d/GbPoint3D.h> +#include <geometry3d/GbPoint3D.h> #include <PointerDefinitions.h> @@ -86,9 +83,6 @@ public: std::string toString(); - ObObjectCreator* getCreator(){ return NULL; }; - void write(UbFileOutput* out); - void read(UbFileInput* in); void translate(const double& x1, const double& x2, const double& x3) { @@ -116,17 +110,6 @@ public: std::list< GbObject3D* > getGbObject3DList() { return this->geoobjects; } -#ifdef CAB_RCF - template<class Archive> - void SF_SERIALIZE(Archive & ar) - { - SF_SERIALIZE_PARENT<GbObject3D>(ar, *this); - ar & midPoint; - ar & radius; - ar & triangulationMode; - ar & geoobjects; - } -#endif //CAB_RCF #ifdef CAB_CTL ctl::oStream &write(ctl::oStream &os) const { @@ -148,12 +131,4 @@ private: std::list< GbObject3D* > geoobjects; }; -#if defined(RCF_USE_SF_SERIALIZATION) && !defined(SWIG) - #if defined(RCF_USE_SF_SERIALIZATION) && (CAB_RCF <= 903) - SF_SERIALIZE_ENUM(GbObjectGroup3D::TRIANGULATIONMODE) //bei klassen ausserhalb der klasse;-) - #endif - UB_AUTO_RUN_NAMED( SF::registerType<GbObjectGroup3D>("GbObjectGroup3D") , SF_GbObjectGroup3D ); - UB_AUTO_RUN_NAMED( ( SF::registerBaseAndDerived< GbObject3D, GbObjectGroup3D >()), SF_GbObjectGroup3D_BD1 ); -#endif //RCF_USE_SF_SERIALIZATION - #endif //GbObjectGroup3D_H diff --git a/src/basics/numerics/geometry3d/GbPoint3D.cpp b/src/basics/geometry3d/GbPoint3D.cpp similarity index 65% rename from src/basics/numerics/geometry3d/GbPoint3D.cpp rename to src/basics/geometry3d/GbPoint3D.cpp index e5fec169c8e3e79612f4eee83004d262df200235..6bbc180110c853fb4f70e4c5e4024b4e40f98a90 100644 --- a/src/basics/numerics/geometry3d/GbPoint3D.cpp +++ b/src/basics/geometry3d/GbPoint3D.cpp @@ -1,14 +1,38 @@ -#include <numerics/geometry3d/GbPoint3D.h> -//#include <numerics/geometry3d/GbTriangle3D.h> -#include <numerics/geometry3d/creator/GbPoint3DCreator.h> - +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file GbPoint3D.cpp +//! \ingroup geometry3d +//! \author Soeren Freudiger, Sebastian Geller +//======================================================================================= +#include <GbPoint3D.h> using namespace std; -/*=======================================================*/ -ObObjectCreator* GbPoint3D::getCreator() -{ - return GbPoint3DCreator::getInstance(); -} /*=======================================================*/ GbPoint3D::GbPoint3D() { @@ -77,7 +101,7 @@ vector<GbTriangle3D*> GbPoint3D::getSurfaceTriangleSet() //old: //to avoid unnecessary exceptions a point will generate a triangle with - //three point with same coordinates + //c3 point with same coordinates //vector<GbTriangle3D*> triangles; //GbPoint3D p1(getX1Coordinate(),getX2Coordinate(),getX3Coordinate()); //triangles.push_back(new GbTriangle3D(new GbPoint3D(p1),new GbPoint3D(p1),new GbPoint3D(p1))); @@ -95,31 +119,11 @@ string GbPoint3D::toString() return((ss.str()).c_str()); } /*=======================================================*/ -void GbPoint3D::write(UbFileOutput* out) -{ - out->writeString(this->getCreator()->getTypeID()); - out->writeDouble(x1); - out->writeDouble(x2); - out->writeDouble(x3); -} -/*=======================================================*/ -void GbPoint3D::read(UbFileInput* in) -{ - x1=in->readDouble(); - x2=in->readDouble(); - x3=in->readDouble(); -} -/*=======================================================*/ void GbPoint3D::translate(const double& dx1, const double& dx2, const double& dx3) { this->x1 += dx1; this->x2 += dx2; this->x3 += dx3; - // wenn Notify hier dann nicht im Cuboid oder spher translate ?! - //sollte eigentlich! - //--> hier muss notify aufgerufen werden udn rekuriv dann z.B. Cuboid, etc - - //aber da ist halt einfach daemlich, ich asse es auf gellers way... (erstmal) this->notifyObserversObjectChanged(); } /*=======================================================*/ diff --git a/src/basics/numerics/geometry3d/GbPoint3D.h b/src/basics/geometry3d/GbPoint3D.h similarity index 53% rename from src/basics/numerics/geometry3d/GbPoint3D.h rename to src/basics/geometry3d/GbPoint3D.h index 611e1a036636dc7c6805c87deb92269d16a9eac6..74b8cafaa51b8b2ef2fe8094b6050ce8fafac792 100644 --- a/src/basics/numerics/geometry3d/GbPoint3D.h +++ b/src/basics/geometry3d/GbPoint3D.h @@ -1,31 +1,49 @@ -// _ ___ __ __________ _ __ -// | | / (_)____/ /___ ______ _/ / ____/ /_ __(_)___/ /____ -// | | / / / ___/ __/ / / / __ `/ / /_ / / / / / / __ / ___/ -// | |/ / / / / /_/ /_/ / /_/ / / __/ / / /_/ / / /_/ (__ ) -// |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ // +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file GbPoint3D.h +//! \ingroup geometry3d +//! \author Soeren Freudiger, Sebastian Geller +//======================================================================================= #ifndef GBPOINT3D_H #define GBPOINT3D_H -#ifdef CAB_RCF - #include <3rdParty/rcf/RcfSerializationIncludes.h> -#endif //CAB_RCF - #include <string> #include <sstream> #include <cmath> -#include <numerics/geometry3d/GbObject3D.h> +#include <GbObject3D.h> #include <PointerDefinitions.h> class GbTriangle3D; -class GbObject3DCreator; - -#ifdef CAB_CTL - #include <ctl.h> -#endif +//! \brief This Class provides basic 3D point objects. class GbPoint3D : public GbObject3D { public: @@ -77,33 +95,9 @@ public: std::vector<GbTriangle3D*> getSurfaceTriangleSet(); GbLine3D* createClippedLine3D(GbPoint3D &point1, GbPoint3D &point2); virtual std::string toString(); - ObObjectCreator* getCreator(); - void write(UbFileOutput* out); - void read(UbFileInput* in); using GbObject3D::isPointInGbObject3D; //Grund: dadurch muss man hier isPointInGbObject3D(GbPoint3D*) nicht ausprogrammieren //, welche sonst hier "ueberdeckt" waere,da es dieselbe methode mit anderen args gibt! -#ifdef CAB_RCF - template<class Archive> - void SF_SERIALIZE(Archive & ar) - { - SF_SERIALIZE_PARENT<GbObject3D>(ar, *this); - ar & x1; - ar & x2; - ar & x3; - } -#endif //CAB_RCF - -#ifdef CAB_CTL - ctl::oStream &write(ctl::oStream &os) const - { - return os<<x1<<x2<<x3; - } - ctl::iStream &read(ctl::iStream &is) - { - return is>>x1>>x2>>x3; - } -#endif //member double x1; @@ -112,9 +106,4 @@ public: }; -#if defined(RCF_USE_SF_SERIALIZATION) && !defined(SWIG) - UB_AUTO_RUN_NAMED( SF::registerType<GbPoint3D>("GbPoint3D") , SF_GbPoint3D ); - UB_AUTO_RUN_NAMED( ( SF::registerBaseAndDerived< GbObject3D, GbPoint3D >()), SF_GbPoint3D_BD1 ); -#endif //RCF_USE_SF_SERIALIZATION - #endif diff --git a/src/basics/geometry3d/GbPolygon3D.cpp b/src/basics/geometry3d/GbPolygon3D.cpp new file mode 100644 index 0000000000000000000000000000000000000000..713ce56f072e7017066f7c5a9a1f922bf8d762cf --- /dev/null +++ b/src/basics/geometry3d/GbPolygon3D.cpp @@ -0,0 +1,356 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file GbPolygon3D.cpp +//! \ingroup geometry3d +//! \author Soeren Freudiger, Sebastian Geller +//======================================================================================= +#include <GbPolygon3D.h> + +using namespace std; + +int GbPolygon3D::counter = 0; + +GbPolygon3D::GbPolygon3D() +{ + init(); + counter++; + this->ps = new GbSystem3D::PointSet3(0); +} +void GbPolygon3D::init() +{ + x1s = 0.0; + x2s = 0.0; + x1min = 0.0; + x1max = 0.0; + x2min = 0.0; + x2max = 0.0; + // points = NULL; + consistent = false; + ps = NULL; +} + +/*! +* Creates an empty 3D polygon with the specified capacity. +* @param capacity the initial capacity +*/ +GbPolygon3D::GbPolygon3D(int capacity) +{ + init(); + counter++; + this->ps = new GbSystem3D::PointSet3(capacity); + // this.po = new PointObserver(this); +} +/** +* Creates a 3D polygon with the specified points. +* @param points the initial points of the polygon +*/ +GbPolygon3D::GbPolygon3D(vector<GbPoint3D>& points) +{ + init(); + counter++; + this->ps = new GbSystem3D::PointSet3((int)points.size()); + this->addPoints(points); +} +/** +* Creates a 3D polygon as clone of the specified 3D polygon. +* @param polygon the 3D polygon to be cloned +*/ +GbPolygon3D::GbPolygon3D(GbPolygon3D* polygon) +{ + this->init(); + counter++; + this->ps = new GbSystem3D::PointSet3((int)polygon->size()); + vector<GbPoint3D> temp = polygon->getPoints(); + this->addPoints( temp ); +} + +GbPolygon3D::~GbPolygon3D() +{ + counter--; + //if(points) + //for(unsigned u=0; u<points->size(); u++) + //{ + // delete (*points)[u]; + //} + // delete this->points; + delete this->ps; +} + +/*======================================================================*/ +/** +* Returns the number of points. +* @return the number of points +*/ +int GbPolygon3D::size() +{ + return(this->ps->size()); +} +/** +* Returns the number of times this 3D polygon contains the specified point. +* @param point the point +* @return the number of times this 3D polygon contains the specified point +*/ +int GbPolygon3D::contains(GbPoint3D* point) +{ + return(this->ps->contains(point)); +} +/** +* Returns the number of times this 3D polygon contains a point equal to the specified point. +* @param point the point +* @return the number of times this 3D polygon contains a point equal to the specified point +*/ +int GbPolygon3D::containsEqual(GbPoint3D* point) +{ + return(this->ps->containsEqual(point)); +} +/** +* Returns true, if this 3D polygon contains the specified line. +* @param point1 the first point +* @param point2 the second point +* @return true, if this 3D polygon contains the specified line +*/ +bool GbPolygon3D::containsLine(GbPoint3D* point1, GbPoint3D* point2) +{ + return(this->ps->containsLine(point1, point2)); +} +/** +* Returns true, if this 3D polygon contains the specified line. +* @param line the line +* @return true, if this 3D polygon contains the specified line +*/ +bool GbPolygon3D::containsLine(GbLine3D* line) +{ + return(this->ps->containsLine(line->getPoint1(), line->getPoint2())); +} +/** +* Returns the first point. +* @return the first point +*/ +GbPoint3D* GbPolygon3D::getFirstPoint() +{ + return(this->ps->getFirstPoint()); +} +/** +* Returns the last point. +* @return the last point +*/ +GbPoint3D* GbPolygon3D::getLastPoint() +{ + return(this->ps->getLastPoint()); +} +/** +* Returns the specified point. +* @param index the index +* @return the specified point +* @exception ArrayIndexOutOfBoundsException if the specified index is not valid +*/ +GbPoint3D* GbPolygon3D::getPoint(const int& index) +{ + if(index < 0 || index > this->ps->size()) throw UbException(UB_EXARGS,"ArrayIndexOutOfBoundsException-GbPolygon3D.getPoint()"); + return(this->ps->getPoint(index)); +} +/** +* Returns the points. +* @return the points +*/ +vector<GbPoint3D> GbPolygon3D::getPoints() +{ + if(!this->consistent) this->calculateValues(); + return(this->points); +} +/** +* Returns the points within the specified rectangle. +* @param p1 the 1st point of the rectangle +* @param p2 the 2nd point of the rectangle +* @return the points within the specified rectangle +*/ +vector<GbPoint3D> GbPolygon3D::getPoints(GbPoint3D* p1, GbPoint3D* p2) +{ + return(this->getPoints(p1->x1, p1->x2, p1->x3, p2->x1, p2->x2, p2->x3)); +} +/** +* Returns the points within the specified rectangle. +* @param p1x1 the 1st x1 coordinate of the rectangle +* @param p1x2 the 1st x2 coordinate of the rectangle +* @param p1x3 the 1st x3 coordinate of the rectangle +* @param p2x1 the 2nd x1 coordinate of the rectangle +* @param p2x2 the 2nd x2 coordinate of the rectangle +* @param p2x3 the 2nd x3 coordinate of the rectangle +* @return the points within the specified rectangle +*/ +vector<GbPoint3D> GbPolygon3D::getPoints(const double& p1x1, const double& p1x2, const double& p1x3, const double& p2x1, const double& p2x2, const double& p2x3) +{ + double x1min, x1max, x2min, x2max, x3min, x3max; + + if(UbMath::less(p1x1, p2x1)) { x1min = p1x1; x1max = p2x1; } + else { x1min = p2x1; x1max = p1x1; } + if(UbMath::less(p1x2, p2x2)) { x2min = p1x2; x2max = p2x2; } + else { x2min = p2x2; x2max = p1x2; } + if(UbMath::less(p1x3, p2x3)) { x3min = p1x3; x3max = p2x3; } + else { x3min = p2x3; x3max = p1x3; } + + GbSystem3D::PointSet3 *pts = new GbSystem3D::PointSet3(1); + + if(!this->consistent) this->calculateValues(); + for(int i=this->size()-1; i>=0; i--) + { + if(UbMath::lessEqual(x1min, (this->points)[i].x1) && UbMath::greaterEqual(x1max, (this->points)[i].x1) && + UbMath::lessEqual(x2min, (this->points)[i].x2) && UbMath::greaterEqual(x2max, (this->points)[i].x2) && + UbMath::lessEqual(x3min, (this->points)[i].x3) && UbMath::greaterEqual(x3max, (this->points)[i].x3)) pts->add((this->points)[i]); + } + return(pts->getPoints()); +} +/** +* Returns the area of this polygon. +* The area is positive for positive ordered points, otherwise negative. +* @return the area of this polygon +*/ +//double getArea() +//{ +// if(!this.consistent) this.calculateValues(); +// return(this.area); +//} +double GbPolygon3D::getX1Centroid() +{ + if(!this->consistent) this->calculateValues(); + return(this->x1s); +} +double GbPolygon3D::getX1Minimum() +{ + if(!this->consistent) this->calculateValues(); + return(this->x1min); +} +double GbPolygon3D::getX1Maximum() +{ + if(!this->consistent) this->calculateValues(); + return(this->x1max); +} +double GbPolygon3D::getX2Centroid() +{ + if(!this->consistent) this->calculateValues(); + return(this->x2s); +} +double GbPolygon3D::getX2Minimum() +{ + if(!this->consistent) this->calculateValues(); + return(this->x2min); +} +double GbPolygon3D::getX2Maximum() +{ + if(!this->consistent) this->calculateValues(); + return(this->x2max); +} +double GbPolygon3D::getX3Centroid() +{ + if(!this->consistent) this->calculateValues(); + return(this->x3s); +} +double GbPolygon3D::getX3Minimum() +{ + if(!this->consistent) this->calculateValues(); + return(this->x3min); +} +double GbPolygon3D::getX3Maximum() +{ + if(!this->consistent) this->calculateValues(); + return(this->x3max); +} + +/** +* Adds a point to the end of this polygon. Notifies the observers of this 3D polygon. +* @param point the point +*/ +void GbPolygon3D::addPoint(GbPoint3D* point) +{ + //if((this instanceof GbPolygon3D) && !(point instanceof GbPoint3D)) throw new IllegalArgumentException("GbPolygon3D.addPoint(): points of 3D polygons have to be 3D points!"); + + this->ps->add(point); + //point.addObserver(this.po); + this->consistent = false; + //super.notifyObservers(); +} +/** +* Adds a number of points to the end of this polygon. Notifies the observers of this 3D polygon. +* @param points the points +*/ +void GbPolygon3D::addPoints(vector<GbPoint3D>& points) +{ + //if((this instanceof GbPolygon3D) && (points.getClass().getComponentType() != GbPoint3D.class)) throw new IllegalArgumentException("GbPolygon3D.addPoints(): points of 3D polygons have to be 3D points!"); + + this->ps->add(points); + //for(int i=0; i<points.length; i++) points[i].addObserver(this.po); + this->consistent = false; + //super.notifyObservers(); +} +/** +* Removes all points from this polygon. Notifies the observers of this 3D polygon. +*/ +void GbPolygon3D::clear() +{ + // delete this->points; + this->ps->clearAndTrim(); + delete this->ps; + + //for(int i=points.length-1; i>=0; i--) points[i].removeObserver(this.po); + this->consistent = false; + //super.notifyObservers(); +} +/** +* Returns a string representation of this 3D polygon. +* @return a string representation of this 3D polygon +*/ +string GbPolygon3D::toString() +{ + stringstream ss; + ss<<"GbPolygon3D["; + ss<<this->size()<<" points"; + ss<<"]"<<endl; + for(int u=0; u<this->size(); u++) + ss<<this->ps->getPoint(u)->toString()<<endl; + + return(ss.str()); +} +/*======================================================================*/ + +void GbPolygon3D::calculateValues() +{ + this->x1s = 0.0; + this->x2s = 0.0; + this->x3s = 0.0; + this->x1min = 0.0; + this->x1max = 0.0; + this->x2min = 0.0; + this->x2max = 0.0; + this->x3min = 0.0; + this->x3max = 0.0; + throw UbException(UB_EXARGS,"should be implemented"); +} +/*======================================================================*/ + + diff --git a/src/basics/geometry3d/GbPolygon3D.h b/src/basics/geometry3d/GbPolygon3D.h new file mode 100644 index 0000000000000000000000000000000000000000..e9a499c0f12e040b9427424c03509440c32c7b8d --- /dev/null +++ b/src/basics/geometry3d/GbPolygon3D.h @@ -0,0 +1,285 @@ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file GbPolygon3D.h +//! \ingroup geometry3d +//! \author Soeren Freudiger, Sebastian Geller +//======================================================================================= +#ifndef GBPOLYGON3D_H +#define GBPOLYGON3D_H + +#include <sstream> +#include <iostream> + + +#include <GbObject3D.h> +#include <GbLine3D.h> +#include <GbTriangle3D.h> +#include <GbSystem3D.h> + +#include <PointerDefinitions.h> + + +/*=========================================================================*/ +//! \class GbPolygon2D +/* */ +//! \brief This Class provides basic 3D polygon objects. + +class GbPolygon3D : public GbObject3D +{ +public: + using GbObject3D::isPointInGbObject3D; //Grund: dadurch muss man hier isPointInGbObject3D(GbPoint3D*) nicht ausprogrammieren, welche sonst hier "ueberdeckt" waere +private: + /*======================================================================*/ + double x1s ; + double x2s ; + double x3s ; + double x1min; + double x1max; + double x2min; + double x2max; + double x3min; + double x3max; + + std::vector<GbPoint3D> points; + bool consistent; + + GbSystem3D::PointSet3 *ps; + //private PointObserver po = null; + + void init(); + + /*======================================================================*/ + + + /*======================================================================*/ + /* Construcrors */ + /* */ + /* + * Creates an empty 2D polygon. + */ +public: + static int counter; + GbPolygon3D(); + /* + * Creates an empty 2D polygon with the specified capacity. + * @param capacity the initial capacity + */ + GbPolygon3D(int capacity); + /* + * Creates a 2D polygon with the specified points. + * @param points the initial points of the polygon + */ + GbPolygon3D(std::vector<GbPoint3D> &points); + /* + * Creates a 2D polygon as clone of the specified 2D polygon. + * @param polygon the 2D polygon to be cloned + */ + GbPolygon3D(GbPolygon3D *polygon); + + ~GbPolygon3D(); + + /*======================================================================*/ + + + /*======================================================================*/ + /* Methoden */ + /* */ + /* + * Creates a 2D polygon as clone of this 2D polygon. + */ + GbPolygon3D* clone() { return(new GbPolygon3D(this)); } + void finalize() + { + throw UbException(UB_EXARGS,"toDo"); + } + + /* + * Returns the number of points. + * @return the number of points + */ + int size(); + /* + * Returns the number of times this 2D polygon contains the specified point. + * @param point the point + * @return the number of times this 2D polygon contains the specified point + */ + int contains(GbPoint3D *point); + /* + * Returns the number of times this 2D polygon contains a point equal to the specified point. + * @param point the point + * @return the number of times this 2D polygon contains a point equal to the specified point + */ + int containsEqual(GbPoint3D* point); + /* + * Returns true, if this 2D polygon contains the specified line. + * @param point1 the first point + * @param point2 the second point + * @return true, if this 2D polygon contains the specified line + */ + bool containsLine(GbPoint3D* point1, GbPoint3D* point2); + /* + * Returns true, if this 2D polygon contains the specified line. + * @param line the line + * @return true, if this 2D polygon contains the specified line + */ + bool containsLine(GbLine3D* line); + /* + * Returns the first point. + * @return the first point + */ + GbPoint3D* getFirstPoint(); + /* + * Returns the last point. + * @return the last point + */ + GbPoint3D* getLastPoint(); + /* + * Returns the specified point. + * @param index the index + * @return the specified point + * @exception ArrayIndexOutOfBoundsException if the specified index is not valid + */ + GbPoint3D* getPoint(const int& index); + /* + * Returns the points. + * @return the points + */ + std::vector<GbPoint3D> getPoints(); + /* + * Returns the points within the specified rectangle. + * @param p1 the 1st point of the rectangle + * @param p2 the 2nd point of the rectangle + * @return the points within the specified rectangle + */ + std::vector<GbPoint3D> getPoints(GbPoint3D* p1, GbPoint3D* p2); + /* + * Returns the points within the specified rectangle. + * @param p1x1 the 1st x1 coordinate of the rectangle + * @param p1x2 the 1st x2 coordinate of the rectangle + * @param p2x1 the 2nd x1 coordinate of the rectangle + * @param p2x2 the 2nd x2 coordinate of the rectangle + * @return the points within the specified rectangle + */ + std::vector<GbPoint3D> getPoints(const double& p1x1, const double& p1x2, const double& p1x3, const double& p2x1, const double& p2x2, const double& p2x3); + /* + * Returns the area of this polygon. + * The area is positive for positive ordered points, otherwise negative. + * @return the area of this polygon + */ + //double getArea() + //{ + // if(!this.consistent) this.calculateValues(); + // return(this.area); + //} + double getX1Centroid(); + double getX1Minimum(); + double getX1Maximum(); + double getX2Centroid(); + double getX2Minimum(); + double getX2Maximum(); + double getX3Centroid(); + double getX3Minimum(); + double getX3Maximum(); + + /* + * Adds a point to the end of this polygon. Notifies the observers of this 2D polygon. + * @param point the point + */ + void addPoint(GbPoint3D* point); + /* + * Adds a number of points to the end of this polygon. Notifies the observers of this 2D polygon. + * @param points the points + */ + void addPoints(std::vector<GbPoint3D>& points); + /* + * Removes all points from this polygon. Notifies the observers of this 2D polygon. + */ + void clear(); + + /* + * Returns true if this 2D polygon equals the specified object. + * Two polygon are equal, if their points are equal. + * <BR>Note that the order of points is recognized! + * @return true if this 2D polygon equals the specified object + * @see GbPoint2D#equals(java.lang.Object) + * @see GbPoint3D#equals(java.lang.Object) + */ + // bool equals(Object object) + // { + // try + // { + // GbPolygon2D polygon = (GbPolygon2D) object; + //int n = this.size(); + + //if(n != polygon.size()) return(false); + //for(int i=0; i<n; i++) if(!this.getPoint(i).equals(polygon.getPoint(i))) return(false); + //return(true); + // } + // catch(Exception e){ return(false); } + // } + std::vector<GbTriangle3D*> getSurfaceTriangleSet() + { + std::cout<<"GbPolygon3D::getSurfaceTriangleSet() - not implemented\n"; + std::vector<GbTriangle3D*> tmp; + return tmp; + } + bool isPointInGbObject3D(const double& x1, const double& x2, const double& x3) + { + throw UbException(__FILE__, __LINE__, "GbPolygon3D::isPointInObject3D- not implemented"); + } + bool isPointInGbObject3D(const double& x1, const double& x2, const double& x3, bool& pointIsOnBoundary) + { + throw UbException(__FILE__, __LINE__, "GbPolygon3D::isPointInObject3D- not implemented"); + } + bool isCellInsideGbObject3D(double x11,double x21,double x31,double x12,double x22,double x32) { return false; } + + GbLine3D* createClippedLine3D (GbPoint3D& point1, GbPoint3D &point2) + { + throw UbException(__FILE__, __LINE__, "GbPolygon3D::createClippedLine3D - not implemented"); + } +/* + * Returns a string representation of this 2D polygon. + * @return a string representation of this 2D polygon + */ + std::string toString(); + + /*======================================================================*/ + /* Private Methoden */ + /* */ + void calculateValues(); + /*======================================================================*/ +}; +/*=========================================================================*/ +#endif + + + + + + diff --git a/src/basics/numerics/geometry3d/GbQuadFaceMesh3D.cpp b/src/basics/geometry3d/GbQuadFaceMesh3D.cpp similarity index 82% rename from src/basics/numerics/geometry3d/GbQuadFaceMesh3D.cpp rename to src/basics/geometry3d/GbQuadFaceMesh3D.cpp index 43a72e0c9683016a9eae930716947c3a26ed03cb..3211811370d466a32345772c1fecc6c13bb51e8e 100644 --- a/src/basics/numerics/geometry3d/GbQuadFaceMesh3D.cpp +++ b/src/basics/geometry3d/GbQuadFaceMesh3D.cpp @@ -1,8 +1,7 @@ -#include <numerics/geometry3d/GbQuadFaceMesh3D.h> -#include <numerics/geometry3d/creator/GbQuadFaceMesh3DCreator.h> +#include <geometry3d/GbQuadFaceMesh3D.h> -#include <numerics/geometry3d/GbHalfSpace3D.h> -#include <numerics/geometry3d/GbCuboid3D.h> +#include <geometry3d/GbHalfSpace3D.h> +#include <geometry3d/GbCuboid3D.h> using namespace std; @@ -41,11 +40,6 @@ GbQuadFaceMesh3D::~GbQuadFaceMesh3D() } } /*======================================================================*/ -ObObjectCreator* GbQuadFaceMesh3D::getCreator() -{ - return GbQuadFaceMesh3DCreator::getInstance(); -} -/*======================================================================*/ void GbQuadFaceMesh3D::init() { @@ -298,65 +292,3 @@ GbLine3D* GbQuadFaceMesh3D::createClippedLine3D (GbPoint3D& point1, GbPoint3D& p { throw UbException(UB_EXARGS,"not implemented"); } - -/*======================================================================*/ -void GbQuadFaceMesh3D::writeAVSMesh(UbFileOutput *out, bool normals) -{ - cout<<" - write_ucd ("<<out->getFileName()<<") -> "; - if(!out) - { - cout<<"GbQuadFaceMesh3D::writeAVSMesh() - File konnte nicht geschrieben werden: "<<endl; - return; - } - out->writeLine("# UCD-File created by GbQuadFaceMesh3D"); - - int quadsize = (int)this->quads->size(); - int nodesize = (int)this->nodes->size(); - - out->writeInteger(nodesize); - out->writeInteger(quadsize); - - out->writeInteger(0); - out->writeInteger(0); - out->writeInteger(0); - out->writeLine(); - int nr=1; - Vertex node; - QuadFace face; - for(int i=0;i<nodesize; i++) - { - node = (*nodes)[i]; - out->writeInteger(nr++); - out->writeDouble(node.x); - out->writeDouble(node.y); - out->writeDouble(node.z); - out->writeLine(); - } - - nr=1; - for(int i=0;i<quadsize; i++) - { - face = (*quads)[i]; - out->writeInteger(nr++); - out->writeInteger(2); - out->writeString("quad"); - out->writeInteger(face.vertex1+1); - out->writeInteger(face.vertex2+1); - out->writeInteger(face.vertex3+1); - out->writeInteger(face.vertex4+1); - out->writeLine(); - } - - //out->writeInteger(0); out->writeInteger(1); out->writeLine(); - //out->writeInteger(1); out->writeInteger(1); out->writeLine(); - //out->writeLine("TEST,no_unit"); - //nr=1; - //for(int i=0;i<quadsize; i++) - //{ - // out->writeInteger(nr++); - // out->writeInteger(10); - // out->writeLine(); - //} - cout<<"done\n"; -} - diff --git a/src/basics/numerics/geometry3d/GbQuadFaceMesh3D.h b/src/basics/geometry3d/GbQuadFaceMesh3D.h similarity index 97% rename from src/basics/numerics/geometry3d/GbQuadFaceMesh3D.h rename to src/basics/geometry3d/GbQuadFaceMesh3D.h index 7a993abd74f20aa782b558aeda86f3877f8eae6f..d04c84e1f6a83bf7b4de05e57698fe9835b9ec1b 100644 --- a/src/basics/numerics/geometry3d/GbQuadFaceMesh3D.h +++ b/src/basics/geometry3d/GbQuadFaceMesh3D.h @@ -11,7 +11,7 @@ #include <iostream> -#include <numerics/geometry3d/GbObject3D.h> +#include <geometry3d/GbObject3D.h> #include <basics/utilities/UbException.h> #include <PointerDefinitions.h> @@ -95,7 +95,6 @@ public: virtual GbLine3D* createClippedLine3D (GbPoint3D &point1,GbPoint3D &point2); //virtual std::vector<GbQuad3D*> getSurfaceQuadSet(); virtual std::vector<GbTriangle3D*> getSurfaceTriangleSet(); - virtual ObObjectCreator* getCreator(); virtual void write(UbFileOutput* out) { std::cout<<"GbQuadFaceMesh3D::write - sorry not implemented\n"; } virtual void read(UbFileInput* in) { std::cout<<"GbQuadFaceMesh3D::read - sorry not implemented\n"; } diff --git a/src/basics/numerics/geometry3d/GbSphere3D.cpp b/src/basics/geometry3d/GbSphere3D.cpp similarity index 96% rename from src/basics/numerics/geometry3d/GbSphere3D.cpp rename to src/basics/geometry3d/GbSphere3D.cpp index 40603c33a0d80408ee05a656603cd24f32625c5e..05b634dbe60475aea45099deec32c0f54fdbafd1 100644 --- a/src/basics/numerics/geometry3d/GbSphere3D.cpp +++ b/src/basics/geometry3d/GbSphere3D.cpp @@ -1,17 +1,11 @@ -#include <numerics/geometry3d/GbSphere3D.h> -#include <numerics/geometry3d/GbSystem3D.h> -#include <numerics/geometry3d/GbPoint3D.h> -#include <numerics/geometry3d/GbLine3D.h> -#include <numerics/geometry3d/GbTriangle3D.h> - -#include <numerics/geometry3d/creator/GbSphere3DCreator.h> +#include <geometry3d/GbSphere3D.h> +#include <geometry3d/GbSystem3D.h> +#include <geometry3d/GbPoint3D.h> +#include <geometry3d/GbLine3D.h> +#include <geometry3d/GbTriangle3D.h> using namespace std; -ObObjectCreator* GbSphere3D::getCreator() -{ - return GbSphere3DCreator::getInstance(); -} /*=====================================================*/ GbSphere3D::GbSphere3D() : GbObject3D(), UbObserver() @@ -559,30 +553,6 @@ void GbSphere3D::transform(const double matrix[4][4]) this->notifyObserversObjectChanged(); } /*=======================================================*/ -void GbSphere3D::write(UbFileOutput* out) -{ - out->writeString(this->getCreator()->getTypeID()); - midPoint->write(out); - out->writeDouble(radius); - out->writeInteger((int)triangulationMode); -} -/*=======================================================*/ -void GbSphere3D::read(UbFileInput* in) -{ - if(midPoint) - { - midPoint->removeObserver(this); - midPoint->finalize(); - delete midPoint; - } - midPoint = new GbPoint3D; - in->readString(); - midPoint->read(in); - midPoint->addObserver(this); - radius = in->readDouble(); - triangulationMode = (TRIANGULATIONMODE)in->readInteger(); -} -/*=======================================================*/ bool GbSphere3D::hasIntersectionWithDirectedLine(GbPoint3D origin, GbPoint3D direction) { GbVector3D vecOrigin(origin.getX1Coordinate(),origin.getX2Coordinate(), origin.getX3Coordinate()) ; @@ -891,19 +861,19 @@ double GbSphere3D::getIntersectionRaytraceFactor(const double& x1, const double& double l_sq = lx1*lx1 + lx2*lx2 + lx3*lx3; //l = abstand Punkt(x1,x2,x3)<->kreismittelpunkt double s = lx1*rx1 + lx2*rx2 + lx3*rx3; //s= l*ray_dir) - double r_sq = this->radius * this->radius; // r² =r*r + double r_sq = this->radius * this->radius; // r� =r*r //if (d<0 (fuer die Richtung falls sie gegen das Kreis dann haben wir ein negativer Zahl) - // && l² > r² (point outside )) + // && l� > r� (point outside )) //wenn s<0->Punkt liegt rechts vom mittelpunkt, wenn nun punkt ausserhalb des kreises liegt, kann es keinen SP mehr geben if( s<-1.E-10 && l_sq>r_sq+1.E-10 ) return -1.0; //Pythagor on Triangle Rectangle (point, center of the cercle, intersection of the direction on point and m) - // l² = m² + d² + // l� = m� + d� double m_sq = l_sq - s*s; - // if (m² > r² (dann gibt es kein schnittpunt zwischen direction und circle)) + // if (m� > r� (dann gibt es kein schnittpunt zwischen direction und circle)) if( m_sq > r_sq+1.E-10 ) return -1.0; // Pythagoras on Triangle Rectangle in cercle (direction , m, r) - // r² = m² + h² + // r� = m� + h� //patch: rundungsfehler bei kleinen delta!!! //-> wenn wurzel minimal null-> diff --git a/src/basics/numerics/geometry3d/GbSphere3D.h b/src/basics/geometry3d/GbSphere3D.h similarity index 85% rename from src/basics/numerics/geometry3d/GbSphere3D.h rename to src/basics/geometry3d/GbSphere3D.h index c8e4eee5f94257a21b972f41949ebf5fe5a21955..694225a68df684cc5fc60e569a17322a1b335981 100644 --- a/src/basics/numerics/geometry3d/GbSphere3D.h +++ b/src/basics/geometry3d/GbSphere3D.h @@ -7,9 +7,6 @@ #ifndef GBSPHERE3D_H #define GBSPHERE3D_H -#ifdef CAB_RCF - #include <3rdParty/rcf/RcfSerializationIncludes.h> -#endif //CAB_RCF #ifdef CAB_CTL #include <ctl.h> #endif //CAB_CTL @@ -19,8 +16,8 @@ #include <basics/utilities/UbObserver.h> -#include <numerics/geometry3d/GbObject3D.h> -#include <numerics/geometry3d/GbPoint3D.h> +#include <geometry3d/GbObject3D.h> +#include <geometry3d/GbPoint3D.h> #include <PointerDefinitions.h> @@ -90,10 +87,6 @@ public: std::string toString(); - ObObjectCreator* getCreator(); - void write(UbFileOutput* out); - void read(UbFileInput* in); - void translate(const double& x1, const double& x2, const double& x3) { this->midPoint->translate(x1, x2, x3); @@ -124,16 +117,6 @@ public: using GbObject3D::isPointInGbObject3D; //Grund: dadurch muss man hier isPointInGbObject3D(GbPoint3D*) nicht ausprogrammieren, welche sonst hier "ueberdeckt" waere, weil man eine -#ifdef CAB_RCF - template<class Archive> - void SF_SERIALIZE(Archive & ar) - { - SF_SERIALIZE_PARENT<GbObject3D>(ar, *this); - ar & midPoint; - ar & radius; - ar & triangulationMode; - } -#endif //CAB_RCF #ifdef CAB_CTL ctl::oStream &write(ctl::oStream &os) const { @@ -153,12 +136,5 @@ private: TRIANGULATIONMODE triangulationMode; }; -#if defined(RCF_USE_SF_SERIALIZATION) && !defined(SWIG) - #if CAB_RCF <= 903 - SF_SERIALIZE_ENUM(GbSphere3D::TRIANGULATIONMODE) //bei klassen ausserhalb der klasse;-) - #endif - UB_AUTO_RUN_NAMED( SF::registerType<GbSphere3D>("GbSphere3D") , SF_GbSphere3D ); - UB_AUTO_RUN_NAMED( ( SF::registerBaseAndDerived< GbObject3D, GbSphere3D >()), SF_GbSphere3D_BD1 ); -#endif //RCF_USE_SF_SERIALIZATION #endif //GBSPHERE3D_H diff --git a/src/basics/numerics/geometry3d/GbSystem3D.cpp b/src/basics/geometry3d/GbSystem3D.cpp similarity index 94% rename from src/basics/numerics/geometry3d/GbSystem3D.cpp rename to src/basics/geometry3d/GbSystem3D.cpp index 7a224f8bf343a6f9ba593729f59776219800cef3..142b584f36e441ae7d668b0b153704563ce8d93e 100644 --- a/src/basics/numerics/geometry3d/GbSystem3D.cpp +++ b/src/basics/geometry3d/GbSystem3D.cpp @@ -1,7 +1,38 @@ -#include <numerics/geometry3d/GbSystem3D.h> - -#include <numerics/geometry3d/GbPolygon3D.h> -#include <numerics/geometry3d/GbCuboid3D.h> +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file GbSystem3D.cpp +//! \ingroup geometry3d +//! \author Soeren Freudiger, Sebastian Geller +//======================================================================================= +#include <GbSystem3D.h> +#include <GbPolygon3D.h> +#include <GbCuboid3D.h> using namespace std; @@ -1012,7 +1043,7 @@ void GbSystem3D::PointSet3::insert(const GbPoint3D& point, int index) /*=======================================================*/ void GbSystem3D::PointSet3::clear() { - //clears points (size==0 but capacity is the old one) + //clears points (size==0 but capacity is the old c1) this->points.clear(); this->consistent = false; } @@ -1084,7 +1115,7 @@ int GbSystem3D::PointSet3::containsEqual(const GbPoint3D& point) /*=======================================================*/ bool GbSystem3D::PointSet3::containsLine(GbPoint3D *point1, GbPoint3D *point2) { - //returns true if pointset has two in "this->points"vector neighboured points + //returns true if pointset has c2 in "this->points"vector neighboured points //wich have the same adress as point1 or point2 vector<GbPoint3D>::iterator pos1=this->points.begin(); vector<GbPoint3D>::iterator pos2; @@ -1102,7 +1133,7 @@ bool GbSystem3D::PointSet3::containsLine(GbPoint3D *point1, GbPoint3D *point2) /*=======================================================*/ bool GbSystem3D::PointSet3::containsEqualLine(const GbPoint3D& point1, const GbPoint3D& point2) { - //returns true if pointset has two in "this->points"vector neighboured points + //returns true if pointset has c2 in "this->points"vector neighboured points //wich have the same coordinates as point1 or point2 vector<GbPoint3D>::iterator pos1=this->points.begin(); vector<GbPoint3D>::iterator pos2; diff --git a/src/basics/numerics/geometry3d/GbSystem3D.h b/src/basics/geometry3d/GbSystem3D.h similarity index 86% rename from src/basics/numerics/geometry3d/GbSystem3D.h rename to src/basics/geometry3d/GbSystem3D.h index d0e842a525cda97a04a17cbaca5a51e2e658b5cf..bfe97c3d0b536c0c650934f8d532d57c5a3dad63 100644 --- a/src/basics/numerics/geometry3d/GbSystem3D.h +++ b/src/basics/geometry3d/GbSystem3D.h @@ -1,9 +1,35 @@ -// _ ___ __ __________ _ __ -// | | / (_)____/ /___ ______ _/ / ____/ /_ __(_)___/ /____ -// | | / / / ___/ __/ / / / __ `/ / /_ / / / / / / __ / ___/ -// | |/ / / / / /_/ /_/ / /_/ / / __/ / / /_/ / / /_/ (__ ) -// |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ // +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file GbSystem3D.h +//! \ingroup geometry3d +//! \author Soeren Freudiger, Sebastian Geller +//======================================================================================= #ifndef GBSYSTEM3D_H #define GBSYSTEM3D_H @@ -11,9 +37,9 @@ #include <cmath> #include <vector> +#include <GbPoint3D.h> +#include <GbObject3D.h> #include <basics/utilities/UbMath.h> -#include <numerics/geometry3d/GbPoint3D.h> -#include <numerics/geometry3d/GbObject3D.h> #include <basics/writer/WbWriter.h> class GbPolygon3D; diff --git a/src/basics/numerics/geometry3d/GbTriFaceMesh3D.cpp b/src/basics/geometry3d/GbTriFaceMesh3D.cpp similarity index 93% rename from src/basics/numerics/geometry3d/GbTriFaceMesh3D.cpp rename to src/basics/geometry3d/GbTriFaceMesh3D.cpp index 4715c64c81291460aee714a4a33163acc3aad175..2f9dd9296265463ceacbc22af77366e7ecd7e3b2 100644 --- a/src/basics/numerics/geometry3d/GbTriFaceMesh3D.cpp +++ b/src/basics/geometry3d/GbTriFaceMesh3D.cpp @@ -1,20 +1,20 @@ -#include <numerics/geometry3d/GbTriFaceMesh3D.h> +#include <geometry3d/GbTriFaceMesh3D.h> -#include <numerics/geometry3d/GbCuboid3D.h> -#include <numerics/geometry3d/GbHalfSpace3D.h> -#include <numerics/geometry3d/CoordinateTransformation3D.h> -#include <numerics/geometry3d/creator/GbTriFaceMesh3DCreator.h> +#include <geometry3d/GbCuboid3D.h> +#include <geometry3d/GbHalfSpace3D.h> +#include <geometry3d/CoordinateTransformation3D.h> #include <basics/utilities/UbRandom.h> #include <basics/utilities/UbTiming.h> #include <basics/utilities/UbLogger.h> +#include <basics/utilities/UbFileInputASCII.h> #include <basics/writer/WbWriter.h> -#include <numerics/geometry3d/KdTree/KdTree.h> -#include <numerics/geometry3d/KdTree/splitalgorithms/KdSpatiallMedianSplit.h> -#include <numerics/geometry3d/KdTree/splitalgorithms/KdSAHSplit.h> -#include <numerics/geometry3d/KdTree/intersectionhandler/KdCountLineIntersectionHandler.h> -#include <numerics/geometry3d/KdTree/intersectionhandler/KdCountRayIntersectionHandler.h> +#include <geometry3d/KdTree/KdTree.h> +#include <geometry3d/KdTree/splitalgorithms/KdSpatiallMedianSplit.h> +#include <geometry3d/KdTree/splitalgorithms/KdSAHSplit.h> +#include <geometry3d/KdTree/intersectionhandler/KdCountLineIntersectionHandler.h> +#include <geometry3d/KdTree/intersectionhandler/KdCountRayIntersectionHandler.h> #define MAX_ITER 10 @@ -73,11 +73,6 @@ GbTriFaceMesh3D::~GbTriFaceMesh3D() if( kdTree ) { delete kdTree; kdTree = NULL; } } /*======================================================================*/ -ObObjectCreator* GbTriFaceMesh3D::getCreator() -{ - return GbTriFaceMesh3DCreator::getInstance(); -} -/*======================================================================*/ void GbTriFaceMesh3D::init() { nodes = NULL; @@ -959,101 +954,7 @@ GbLine3D* GbTriFaceMesh3D::createClippedLine3D (GbPoint3D& point1, GbPoint3D& po { throw UbException(UB_EXARGS,"not implemented"); } -/*======================================================================*/ -void GbTriFaceMesh3D::write(UbFileOutput* out) -{ - out->writeString(this->getCreator()->getTypeID()); - out->writeInteger((int)kdtreeSplitAlg); - out->writeBool(transferViaFilename); - if(!transferViaFilename) - { - //nodes - vector<Vertex>& vertices = *nodes; - out->writeSize_t( nodes->size() ); - out->writeLine(); - for(size_t i=0; i<vertices.size(); i++) - { - Vertex& v = vertices[i]; - out->writeFloat(v.x); - out->writeFloat(v.y); - out->writeFloat(v.z); - out->writeLine(); - } - - //triangles - vector<TriFace>& tris = *triangles; - out->writeSize_t( tris.size() ); - out->writeLine(); - for(size_t i=0; i<tris.size(); i++) - { - TriFace& t = tris[i]; - out->writeInteger(t.v1); - out->writeInteger(t.v2); - out->writeInteger(t.v3); - out->writeLine(); - } - } - else - { - out->writeString(filename); - out->writeLine(); - out->writeDouble(transX1); - out->writeDouble(transX2); - out->writeDouble(transX3); - - } -} -/*======================================================================*/ -void GbTriFaceMesh3D::read(UbFileInput* in) -{ - kdtreeSplitAlg = (KDTREE_SPLITAGORITHM)in->readInteger(); - transferViaFilename = in->readBool(); - - if(!transferViaFilename) - { - if(!nodes) nodes = new vector<Vertex>; - //nodes - vector<Vertex>& vertices = *nodes; - vertices.resize( in->readSize_t( ) ); - in->readLine(); - for(size_t i=0; i<vertices.size(); i++) - { - Vertex& v = vertices[i]; - v.x = in->readFloat(); - v.y = in->readFloat(); - v.z = in->readFloat(); - in->readLine(); - } - - //triangles - if(!triangles) triangles = new vector<TriFace>; - vector<TriFace>& tris = *triangles; - tris.resize( in->readSize_t( ) ); - in->readLine(); - for(size_t i=0; i<tris.size(); i++) - { - TriFace& t = tris[i]; - t.v1 = in->readInteger(); - t.v2 = in->readInteger(); - t.v3 = in->readInteger(); - in->readLine(); - } - - this->calculateValues(); - } - else - { - filename = in->readString(); - in->readLine(); - transX1 = in->readDouble(); - transX2 = in->readDouble(); - transX3 = in->readDouble(); - - this->readMeshFromSTLFile(filename, true); - this->translate(transX1,transX2,transX3); - } -} /*======================================================================*/ UbTuple<string, string> GbTriFaceMesh3D::writeMesh(string filename, WbWriter* writer, bool writeNormals, vector< string >* datanames, std::vector< std::vector < double > >* nodedata ) { diff --git a/src/basics/numerics/geometry3d/GbTriFaceMesh3D.h b/src/basics/geometry3d/GbTriFaceMesh3D.h similarity index 88% rename from src/basics/numerics/geometry3d/GbTriFaceMesh3D.h rename to src/basics/geometry3d/GbTriFaceMesh3D.h index 85e624aa76201b066a5f3f0dd260366a940ba8e3..146c8c2200da8ec73fe9a6b5b87684a571d02604 100644 --- a/src/basics/numerics/geometry3d/GbTriFaceMesh3D.h +++ b/src/basics/geometry3d/GbTriFaceMesh3D.h @@ -10,22 +10,18 @@ #include <sstream> #include <iostream> #include <vector> - -#ifdef CAB_RCF - #include <3rdParty/rcf/RcfSerializationIncludes.h> -#endif //CAB_RCF - +#include <map> #include <basics/utilities/UbException.h> #include <basics/utilities/UbMath.h> #include <basics/utilities/Vector3D.h> -#include <basics/memory/MbSmartPtr.h> - -#include <numerics/geometry3d/GbPoint3D.h> +#include <geometry3d/GbPoint3D.h> #include <PointerDefinitions.h> +#include <basics_export.h> + namespace Kd { template< typename T> class Tree; @@ -97,14 +93,6 @@ public: return(new Vertex(this)); } -#ifdef CAB_RCF - template<class Archive> - void SF_SERIALIZE(Archive & ar) - { - ar & x; ar & y; ar & z; - } -#endif //CAB_RCF - public: float x, y, z; }; @@ -217,13 +205,6 @@ public: <<"->removeRedunantNodes"<<std::endl; } } - #ifdef CAB_RCF - template<class Archive> - void SF_SERIALIZE(Archive & ar) - { - ar & v1; ar & v2; ar & v3; - } - #endif //CAB_RCF public: int v1, v2, v3; @@ -303,11 +284,6 @@ public: KDTREE_SPLITAGORITHM getKdTreeSplitAlgorithm() { return this->kdtreeSplitAlg; } Kd::Tree<double>* getKdTree() { return this->kdTree; } - virtual ObObjectCreator* getCreator(); - - void write(UbFileOutput* out); - void read(UbFileInput* in); - virtual UbTuple<std::string, std::string> writeMesh(std::string filename, WbWriter* writer, bool writeNormals=false, std::vector< std::string >* datanames=NULL, std::vector< std::vector < double > >* nodedata=NULL ); void writeMeshPly( const std::string& filename); @@ -317,35 +293,6 @@ public: bool intersectLine(const double& p1_x1, const double& p1_x2, const double& p1_x3, const double& p2_x1, const double& p2_x2, const double& p2_x3); -#ifdef CAB_RCF - template<class Archive> - void SF_SERIALIZE(Archive & ar) - { - SF_SERIALIZE_PARENT<GbObject3D>(ar, *this); - ar & kdtreeSplitAlg; - ar & transferViaFilename; - if(!transferViaFilename) - { - ar & nodes; - ar & triangles; - } - else - { - ar & filename; - ar & transX1; - ar & transX2; - ar & transX3; - if(ArchiveTools::isReading(ar) ) - { - this->readMeshFromSTLFile(filename, true); - this->translate(transX1,transX2,transX3); - } - } - - if(ArchiveTools::isReading(ar)) this->calculateValues(); - } -#endif //CAB_RCF - protected: KDTREE_SPLITAGORITHM kdtreeSplitAlg; void init(); @@ -377,9 +324,5 @@ protected: Kd::Tree< double >* kdTree; }; -#if defined(RCF_USE_SF_SERIALIZATION) && !defined(SWIG) - UB_AUTO_RUN_NAMED( SF::registerType<GbTriFaceMesh3D >("GbTriFaceMesh3D ") , SF_GbTriFaceMesh3D ); - UB_AUTO_RUN_NAMED( ( SF::registerBaseAndDerived< GbObject3D, GbTriFaceMesh3D >() ), SF_GbTriFaceMesh3D_BD1 ); -#endif //RCF_USE_SF_SERIALIZATION #endif //GBTRIFACEMESH3D_H diff --git a/src/basics/numerics/geometry3d/GbTriangle3D.cpp b/src/basics/geometry3d/GbTriangle3D.cpp similarity index 88% rename from src/basics/numerics/geometry3d/GbTriangle3D.cpp rename to src/basics/geometry3d/GbTriangle3D.cpp index 0ac50c0f76aafb7bdfb7414c26b04997eb0cc279..51edfa5eafcd6160790480abea450de372bfc5b9 100644 --- a/src/basics/numerics/geometry3d/GbTriangle3D.cpp +++ b/src/basics/geometry3d/GbTriangle3D.cpp @@ -1,29 +1,43 @@ -#include <numerics/geometry3d/GbTriangle3D.h> -#include <numerics/geometry3d/creator/GbTriangle3DCreator.h> +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file GbTriangle3D.cpp +//! \ingroup geometry3d +//! \author Soeren Freudiger, Sebastian Geller +//======================================================================================= +#include <GbTriangle3D.h> +#include <GbSystem3D.h> +#include <GbLine3D.h> +#include <GbCuboid3D.h> #include <basics/utilities/UbMath.h> -#include <numerics/geometry3d/GbSystem3D.h> -#include <numerics/geometry3d/GbLine3D.h> -#include <numerics/geometry3d/GbCuboid3D.h> -//#include <numerics/geometry3d/GbPolygon3D.h> - -using namespace std; - -ObObjectCreator* GbTriangle3D::getCreator() -{ - return GbTriangle3DCreator::getInstance(); -} - -/*=========================================================================*/ -/* GbTriangle3D */ -/* */ -/* -* This Class provides basic 3D triangle objects. -* The describing points are observed by 2D triangle objects. -* <BR><BR><HR> -* @version 1.0 - 24.01.05 -*/ +using namespace std; GbTriangle3D::GbTriangle3D() { @@ -245,42 +259,6 @@ void GbTriangle3D::setPoint(GbPoint3D* point, int index) this->calculateNormal(); } -/* -* Returns true if this 2D triangle equals the specified object. -* Two triangle are equal, if their points are equal. -* <BR>Note that the order of points is not recognized! -* @return true if this 2D triangle equals the specified object -* @see GbPoint2D#equals(java.lang.Object) -* @see GbPoint3D#equals(java.lang.Object) -*/ -//bool equals(GbObject3D *object) -//{ -// try -// { -// GbTriangle3D *triangle = (GbTriangle3D*) object; - -//if(this.points[0].equals(triangle.points[0])) -//{ -// if(this.points[1].equals(triangle.points[1]) && this.points[2].equals(triangle.points[2])) return(true); -// if(this.points[1].equals(triangle.points[2]) && this.points[2].equals(triangle.points[1])) return(true); -// return(false); -//} -//else if(this.points[0].equals(triangle.points[1])) -//{ -// if(this.points[1].equals(triangle.points[0]) && this.points[2].equals(triangle.points[2])) return(true); -// if(this.points[1].equals(triangle.points[2]) && this.points[2].equals(triangle.points[0])) return(true); -// return(false); -//} -//else if(this.points[0].equals(triangle.points[2])) -//{ -// if(this.points[1].equals(triangle.points[0]) && this.points[2].equals(triangle.points[1])) return(true); -// if(this.points[1].equals(triangle.points[1]) && this.points[2].equals(triangle.points[0])) return(true); -// return(false); -//} -//return(false); -// } -// catch(Exception e){ return(false); } -// } /* * Returns the surface triangle set with new nodes !!! * @returns the surface triangle set with new nodes !!! @@ -366,32 +344,6 @@ double GbTriangle3D::getIntersectionRaytraceFactor(const double& x1, const doubl return f * (e2x1*qx1 + e2x2*qx2 + e2x3*qx3); } -/*======================================================================*/ -/* Calculation */ -/* */ -/* -* Returns the intersection points of this 2D triangle and the specified 2D line. -* @param line the 2D line to intersect -* @return the intersection points of this 2D triangle and the specified 2D line -*/ -/* -vector<GbPoint3D> GbTriangle3D::calculateIntersectionPoints3D(GbLine3D *line) -{ -//throw UbException(UB_EXARGS,"not yet implemented"); - -GbSystem::PointSet3 pointSet(0); -GbPoint3D *pCrossed = NULL; - -pCrossed = GbSystem::calculateIntersectionPoint3D(*this->points[0], *this->points[1], *line->getPoint1(), *line->getPoint2()); -if(pCrossed != NULL) pointSet.addUnequal(pCrossed); -pCrossed = GbSystem::calculateIntersectionPoint3D(*this->points[1], *this->points[2], *line->getPoint1(), *line->getPoint2()); -if(pCrossed != NULL) pointSet.addUnequal(pCrossed); -pCrossed = GbSystem::calculateIntersectionPoint3D(*this->points[2], *this->points[0], *line->getPoint1(), *line->getPoint2()); -if(pCrossed != NULL) pointSet.addUnequal(pCrossed); -//vector<GbPoint3D> points = pointSet->getPoints(); -return(pointSet.getPoints()); -} -*/ /*===========================================================*/ GbLine3D* GbTriangle3D::createClippedLine3D(GbPoint3D& point1, GbPoint3D& point2) @@ -900,31 +852,6 @@ void GbTriangle3D::calculateValues() /*======================================================================*/ -/*======================================================================*/ -//class PointObserver : public UbObserver -//{ -// GbTriangle3D *triangle; - -// PointObserver(GbTriangle3D *triangle) -// { -// this->triangle = triangle; -// } - -//public: -// void objectChanged(GbObject3D *object) -// { -// if(object == this->triangle->points[0] || object == this->triangle->points[1] || object == this->triangle->points[2]) -// { -// this->triangle->consistent = false; -// this->triangle->notifyObservers(); -// } -// } -//}; -//bool GbTriangle3D::isPointOnEdge(GbVector3D& q) -//{ -////cout<<"muss einer machen ...\n"; -// return false; -//} /*======================================================================*/ GbVector3D GbTriangle3D::getNormal() { @@ -946,32 +873,6 @@ void GbTriangle3D::init() points.resize(3,NULL); } /*=======================================================*/ -void GbTriangle3D::write(UbFileOutput* out) -{ - out->writeString(this->getCreator()->getTypeID()); - if(points[0]) points[0]->write(out); - else {GbPoint3D tmp; tmp.write(out);} - if(points[1]) points[1]->write(out); - else {GbPoint3D tmp; tmp.write(out);} - if(points[2]) points[2]->write(out); - else {GbPoint3D tmp; tmp.write(out);} -} -/*=======================================================*/ -void GbTriangle3D::read(UbFileInput* in) -{ - this->deletePoints(); - points[0] = new GbPoint3D; - points[1] = new GbPoint3D; - points[2] = new GbPoint3D; - in->readString(); - points[0]->read(in); - in->readString(); - points[1]->read(in); - in->readString(); - points[2]->read(in); - consistent = false; -} -/*=======================================================*/ void GbTriangle3D::calculateNormal() { GbPoint3D*& a = points[0]; diff --git a/src/basics/numerics/geometry3d/GbTriangle3D.h b/src/basics/geometry3d/GbTriangle3D.h similarity index 72% rename from src/basics/numerics/geometry3d/GbTriangle3D.h rename to src/basics/geometry3d/GbTriangle3D.h index 276652b40fadebc1fd8d4347a70eeba559082066..7b931c1cc63584c5fa2fa7a3852d908bbdb9aac1 100644 --- a/src/basics/numerics/geometry3d/GbTriangle3D.h +++ b/src/basics/geometry3d/GbTriangle3D.h @@ -1,21 +1,43 @@ -// _ ___ __ __________ _ __ -// | | / (_)____/ /___ ______ _/ / ____/ /_ __(_)___/ /____ -// | | / / / ___/ __/ / / / __ `/ / /_ / / / / / / __ / ___/ -// | |/ / / / / /_/ /_/ / /_/ / / __/ / / /_/ / / /_/ (__ ) -// |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ // +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file GbTriangle3D.h +//! \ingroup geometry3d +//! \author Soeren Freudiger, Sebastian Geller +//======================================================================================= #ifndef GBTRIANGLE3D_H #define GBTRIANGLE3D_H #include <sstream> -#include <numerics/geometry3d/GbObject3D.h> -#include <numerics/geometry3d/GbVector3D.h> -#include <numerics/geometry3d/GbPoint3D.h> - -#ifdef CAB_RCF - #include <3rdParty/rcf/RcfSerializationIncludes.h> -#endif //CAB_RCF +#include <GbObject3D.h> +#include <GbVector3D.h> +#include <GbPoint3D.h> #include <PointerDefinitions.h> @@ -23,13 +45,14 @@ class GbCuboid3D; class GbPolygon3D; class GbObject3DCreator; -/*=========================================================================*/ -/* GbTriangle3D */ -/* */ -/* -* This Class provides basic 3D triangle objects. -*/ -//class GbLine2D; +////////////////////////////////////////////////////////////////////////// +//! +//! \class GbTriangle3D +//! +//! \brief This Class provides basic 3D triangle objects. +//! \details The describing points are observed by 2D triangle objects. +//! +////////////////////////////////////////////////////////////////////////// class GbTriangle3D : public GbObject3D , public UbObserver { @@ -101,9 +124,6 @@ public: double getDistanceFromPoint(GbVector3D punct); std::string toString(); - ObObjectCreator* getCreator(); - void write(UbFileOutput* out); - void read(UbFileInput* in); /*======================================================================*/ /* Calculation */ @@ -140,27 +160,6 @@ public: /* */ virtual void calculateValues(); - /*======================================================================*/ - //class PointObserver : public UbObserver - //{ - // GbTriangle3D *triangle; - - // PointObserver(GbTriangle3D *triangle) - // { - // this->triangle = triangle; - // } - - //public: - // void objectChanged(GbObject3D *object) - // { - // if(object == this->triangle->points[0] || object == this->triangle->points[1] || object == this->triangle->points[2]) - // { - // this->triangle->consistent = false; - // this->triangle->notifyObservers(); - // } - // } - //}; - /*======================================================================*/ //virtuelle Methoden von UbObserver //!! quick and dirty von sirann !! @@ -193,28 +192,6 @@ public: } using GbObject3D::isPointInGbObject3D; //Grund: dadurch muss man hier isPointInGbObject3D(GbPoint3D*) nicht ausprogrammieren, welche sonst hier "ueberdeckt" waere -#ifdef CAB_RCF - template<class Archive> - void SF_SERIALIZE(Archive & ar) - { - SF_SERIALIZE_PARENT<GbObject3D>(ar, *this); - ar & points; - ar & normal; - ar & x1s; - ar & x2s; - ar & x3s; - ar & x1min; - ar & x1max; - ar & x2min; - ar & x2max; - ar & x3min; - ar & x3max; - ar & area; - ar & consistent; - if( ArchiveTools::isReading(ar) ) this->calculateNormal(); - } -#endif //CAB_RCF - protected: bool consistent; double x1s; @@ -236,10 +213,4 @@ private: }; /*=========================================================================*/ -#if defined(RCF_USE_SF_SERIALIZATION) && !defined(SWIG) - UB_AUTO_RUN_NAMED( SF::registerType<GbTriangle3D >("GbTriangle3D ") , SF_GbTriangle3D ); - UB_AUTO_RUN_NAMED( ( SF::registerBaseAndDerived< GbObject3D, GbTriangle3D >() ), SF_GbTriangle3D_BD1 ); - UB_AUTO_RUN_NAMED( ( SF::registerBaseAndDerived< UbObserver, GbTriangle3D>() ), SF_GbTriangle3D_BD2 ); -#endif //RCF_USE_SF_SERIALIZATION - #endif diff --git a/src/basics/numerics/geometry3d/GbTriangularMesh3D.cpp b/src/basics/geometry3d/GbTriangularMesh3D.cpp similarity index 93% rename from src/basics/numerics/geometry3d/GbTriangularMesh3D.cpp rename to src/basics/geometry3d/GbTriangularMesh3D.cpp index 9006ca690836b45e69ca88cb0072d792c47b0f5f..c709cc7da9f9702493245575e84547bb7a06eb26 100644 --- a/src/basics/numerics/geometry3d/GbTriangularMesh3D.cpp +++ b/src/basics/geometry3d/GbTriangularMesh3D.cpp @@ -1,13 +1,12 @@ -#include <numerics/geometry3d/GbTriangularMesh3D.h> -#include <numerics/geometry3d/creator/GbTriangularMesh3DCreator.h> +#include <geometry3d/GbTriangularMesh3D.h> #include <map> #include <basics/utilities/UbMath.h> -#include <numerics/geometry3d/GbHalfSpace3D.h> -#include <numerics/geometry3d/GbCuboid3D.h> -#include <numerics/geometry3d/CoordinateTransformation3D.h> +#include <geometry3d/GbHalfSpace3D.h> +#include <geometry3d/GbCuboid3D.h> +#include <geometry3d/CoordinateTransformation3D.h> using namespace std; @@ -111,11 +110,6 @@ GbTriangularMesh3D::~GbTriangularMesh3D() } } /*======================================================================*/ -ObObjectCreator* GbTriangularMesh3D::getCreator() -{ - return GbTriangularMesh3DCreator::getInstance(); -} -/*======================================================================*/ void GbTriangularMesh3D::deleteRedundantNodes() { std::map<GbPoint3D*,GbTriangle3D*> pointTriMap; @@ -1034,106 +1028,6 @@ void GbTriangularMesh3D::writeMesh(string filename, WbWriter* writer, bool write writer->writeLines(filename+"_normals",lineNodes,lines); } } -/*======================================================================*/ -void GbTriangularMesh3D::writeAVSMesh(UbFileOutput *out, bool normals) -{ - cout<<" - write_ucd ("<<out->getFileName()<<") -> "; - if(!out) - { - cout<<"GbTriangularMesh3D::writeAVSMesh() - File konnte nicht geschrieben werden: "<<endl; - return; - } - out->writeLine("# UCD-File created by GbTriangularMesh3D"); - //vector<GbPoint3D*> *nodes = this->getNodes(); - vector<GbTriangle3D*> *triangles = this->getTriangles(); - //int nodesize = (int)nodes->size(); - int trianglesize = (int)triangles->size(); - int nodesize = trianglesize*3; - if(normals) - { - out->writeInteger(nodesize+trianglesize*2); - out->writeInteger(trianglesize*2); - } - else - { - out->writeInteger(nodesize); - out->writeInteger(trianglesize); - } - out->writeInteger(0); - out->writeInteger(0); - out->writeInteger(0); - out->writeLine(); - int nr=1; - GbPoint3D *node; - for(int i=0;i<trianglesize; i++) - { - node = (*triangles)[i]->getPoint(0); - out->writeInteger(nr++); - out->writeDouble(node->getX1Coordinate()); - out->writeDouble(node->getX2Coordinate()); - out->writeDouble(node->getX3Coordinate()); - out->writeLine(); - node = (GbPoint3D*)(*triangles)[i]->getPoint(1); - out->writeInteger(nr++); - out->writeDouble(node->getX1Coordinate()); - out->writeDouble(node->getX2Coordinate()); - out->writeDouble(node->getX3Coordinate()); - out->writeLine(); - node = (GbPoint3D*)(*triangles)[i]->getPoint(2); - out->writeInteger(nr++); - out->writeDouble(node->getX1Coordinate()); - out->writeDouble(node->getX2Coordinate()); - out->writeDouble(node->getX3Coordinate()); - out->writeLine(); - } - - if(normals) - { - for(int i=0;i<trianglesize; i++) - { - GbVector3D vec = (*triangles)[i]->getNormal(); - out->writeInteger(nr++); - out->writeDouble((*triangles)[i]->getX1Centroid()); - out->writeDouble((*triangles)[i]->getX2Centroid()); - out->writeDouble((*triangles)[i]->getX3Centroid()); - out->writeLine(); - out->writeInteger(nr++); - out->writeDouble((*triangles)[i]->getX1Centroid()+vec.X1()); - out->writeDouble((*triangles)[i]->getX2Centroid()+vec.X2()); - out->writeDouble((*triangles)[i]->getX3Centroid()+vec.X3()); - out->writeLine(); - } - } - nr=1; - int el=1; - for(int i=0;i<trianglesize; i++) - { - nr = 3*el-2; - out->writeInteger(el); - out->writeInteger(2); - out->writeString("tri"); - out->writeInteger(nr); - out->writeInteger(nr+1); - out->writeInteger(nr+2); - out->writeLine(); - el++; - } - if(normals) - { - nr = trianglesize*3+1; - for(int i=trianglesize;i<2*trianglesize; i++) - { - out->writeInteger(el); - out->writeInteger(2); - out->writeString("line"); - out->writeInteger(nr++); - out->writeInteger(nr++); - out->writeLine(); - el++; - } - } - cout<<"done\n"; -} /*======================================================================*/ /* diff --git a/src/basics/numerics/geometry3d/GbTriangularMesh3D.h b/src/basics/geometry3d/GbTriangularMesh3D.h similarity index 93% rename from src/basics/numerics/geometry3d/GbTriangularMesh3D.h rename to src/basics/geometry3d/GbTriangularMesh3D.h index 8f3b6a46e2c2bb3cbe72551ed232696628f29367..d0b71589dd08b7332fc6293417d682c9c25f51ef 100644 --- a/src/basics/numerics/geometry3d/GbTriangularMesh3D.h +++ b/src/basics/geometry3d/GbTriangularMesh3D.h @@ -11,10 +11,10 @@ #include <iostream> -#include <numerics/geometry3d/GbLine3D.h> -#include <numerics/geometry3d/GbPoint3D.h> -#include <numerics/geometry3d/GbTriangle3D.h> -#include <numerics/geometry3d/GbVector3D.h> +#include <geometry3d/GbLine3D.h> +#include <geometry3d/GbPoint3D.h> +#include <geometry3d/GbTriangle3D.h> +#include <geometry3d/GbVector3D.h> #include <basics/writer/WbWriter.h> @@ -110,14 +110,8 @@ public: virtual GbLine3D* createClippedLine3D (GbPoint3D &point1,GbPoint3D &point2); virtual std::vector<GbTriangle3D*> getSurfaceTriangleSet(); - virtual ObObjectCreator* getCreator(); - - virtual void write(UbFileOutput* out) { std::cout<<"GbTriangularMesh3D::write - sorry not implemented\n"; } - virtual void read(UbFileInput* in) { std::cout<<"GbTriangularMesh3D::read - sorry not implemented\n"; } void writeMesh(std::string filename, WbWriter* writer, bool writeNormals=false); - void writeAVSMesh(UbFileOutput* out, bool normals=false); - /*======================================================================*/ using GbObject3D::isPointInGbObject3D; //Grund: dadurch muss man hier isPointInGbObject3D(GbPoint3D*) nicht ausprogrammieren, welche sonst hier "ueberdeckt" waere diff --git a/src/basics/numerics/geometry3d/GbVector3D.cpp b/src/basics/geometry3d/GbVector3D.cpp similarity index 90% rename from src/basics/numerics/geometry3d/GbVector3D.cpp rename to src/basics/geometry3d/GbVector3D.cpp index 4283ddfc50f75b08cc47fd574c8520f2e3f0cfd8..94e6e7f670e1c9a8f0fafab6dfc387c8eb0885e5 100644 --- a/src/basics/numerics/geometry3d/GbVector3D.cpp +++ b/src/basics/geometry3d/GbVector3D.cpp @@ -1,9 +1,41 @@ -#include <numerics/geometry3d/GbVector3D.h> +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ +// +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file GbVector3D.cpp +//! \ingroup geometry3d +//! \author Soeren Freudiger, Sebastian Geller +//======================================================================================= +#include <GbVector3D.h> +#include <GbPoint3D.h> #include <basics/utilities/UbMath.h> #include <basics/utilities/UbInfinity.h> -#include <numerics/geometry3d/GbPoint3D.h> - + using namespace std; diff --git a/src/basics/numerics/geometry3d/GbVector3D.h b/src/basics/geometry3d/GbVector3D.h similarity index 63% rename from src/basics/numerics/geometry3d/GbVector3D.h rename to src/basics/geometry3d/GbVector3D.h index 538ead81269d2614b7b6954889fdee09d22d59c1..9bf699fa2141043245bfa29396351f823ccc3c11 100644 --- a/src/basics/numerics/geometry3d/GbVector3D.h +++ b/src/basics/geometry3d/GbVector3D.h @@ -1,9 +1,35 @@ -// _ ___ __ __________ _ __ -// | | / (_)____/ /___ ______ _/ / ____/ /_ __(_)___/ /____ -// | | / / / ___/ __/ / / / __ `/ / /_ / / / / / / __ / ___/ -// | |/ / / / / /_/ /_/ / /_/ / / __/ / / /_/ / / /_/ (__ ) -// |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/ +//======================================================================================= +// ____ ____ __ ______ __________ __ __ __ __ +// \ \ | | | | | _ \ |___ ___| | | | | / \ | | +// \ \ | | | | | |_) | | | | | | | / \ | | +// \ \ | | | | | _ / | | | | | | / /\ \ | | +// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____ +// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______| +// \ \ | | ________________________________________________________________ +// \ \ | | | ______________________________________________________________| +// \ \| | | | __ __ __ __ ______ _______ +// \ | | |_____ | | | | | | | | | _ \ / _____) +// \ | | _____| | | | | | | | | | | \ \ \_______ +// \ | | | | |_____ | \_/ | | | | |_/ / _____ | +// \ _____| |__| |________| \_______/ |__| |______/ (_______/ // +// This file is part of VirtualFluids. VirtualFluids is free software: you can +// redistribute it and/or modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>. +// +//! \file GbVector3D.h +//! \ingroup geometry3d +//! \author Soeren Freudiger, Sebastian Geller +//======================================================================================= #ifndef GBVECTOR3D_H #define GBVECTOR3D_H @@ -11,14 +37,11 @@ #include <cassert> #include <string> -#ifdef CAB_RCF - #include <3rdParty/rcf/RcfSerializationIncludes.h> -#endif //CAB_RCF - #include <PointerDefinitions.h> class GbPoint3D; +//! \brief This Class provides basic 3D vector objects. class GbVector3D { public: @@ -109,13 +132,6 @@ public: static const GbVector3D UNIT_X2; static const GbVector3D UNIT_X3; -#ifdef CAB_RCF - template<class Archive> - void SF_SERIALIZE(Archive & ar) - { - ar & m_afTuple; - } -#endif //CAB_RCF private: // support for comparisons int CompareArrays (const GbVector3D& rkV) const; @@ -125,8 +141,4 @@ private: GbVector3D operator* (const double& fScalar, const GbVector3D& rkV); -#ifdef RCF_USE_SF_SERIALIZATION - UB_AUTO_RUN_NAMED( SF::registerType<GbVector3D >("GbVector3D "), SF_GbVector3D ); -#endif //RCF_USE_SF_SERIALIZATION - #endif //GBVECTOR3D_H diff --git a/src/basics/numerics/geometry3d/GbVoxelMatrix3D.cpp b/src/basics/geometry3d/GbVoxelMatrix3D.cpp similarity index 93% rename from src/basics/numerics/geometry3d/GbVoxelMatrix3D.cpp rename to src/basics/geometry3d/GbVoxelMatrix3D.cpp index 5552482bb9c4201ed90c5a38e175e178c4d712af..0995526a7863e786806892297ee2cbc75aa000cb 100644 --- a/src/basics/numerics/geometry3d/GbVoxelMatrix3D.cpp +++ b/src/basics/geometry3d/GbVoxelMatrix3D.cpp @@ -1,11 +1,10 @@ -#include <numerics/geometry3d/GbVoxelMatrix3D.h> +#include <geometry3d/GbVoxelMatrix3D.h> #include <basics/utilities/UbMath.h> #include <basics/utilities/UbFileInputASCII.h> -#include <numerics/geometry3d/creator/GbVoxelMatrix3DCreator.h> -#include <numerics/geometry3d/GbTriangle3D.h> +#include <geometry3d/GbTriangle3D.h> #include <basics/utilities/UbFileOutputASCII.h> -#include <numerics/geometry3d/CoordinateTransformation3D.h> +#include <geometry3d/CoordinateTransformation3D.h> #include <basics/utilities/UbSystem.h> @@ -19,11 +18,6 @@ const float GbVoxelMatrix3D::SOLID = 1.0f; const float GbVoxelMatrix3D::FLUID = 0.0f; -/*=======================================================*/ -ObObjectCreator* GbVoxelMatrix3D::getCreator() -{ - return GbVoxelMatrix3DCreator::getInstance(); -} /*=======================================================*/ // Konstruktor GbVoxelMatrix3D::GbVoxelMatrix3D(int nx1, int nx2, int nx3, float initVal, double lowerThreshold, double upperThreshold) @@ -520,72 +514,6 @@ string GbVoxelMatrix3D::toString() return "GbVoxelMatrix3D"; } /*=======================================================*/ -void GbVoxelMatrix3D::write(UbFileOutput* out) -{ - out->writeString(this->getCreator()->getTypeID()); - out->writeDouble(minX1); - out->writeDouble(minX2); - out->writeDouble(minX3); - out->writeDouble(deltaX1); - out->writeDouble(deltaX2); - out->writeDouble(deltaX3); - out->writeInteger(nodesX1); - out->writeInteger(nodesX2); - out->writeInteger(nodesX3); - out->writeDouble(lowerThreshold); - out->writeDouble(upperThreshold); - out->writeBool(addSurfaceTriangleSetFlag); - out->writeBool(transferViaFilename); - if (!transferViaFilename) - { - throw UbException(UB_EXARGS, "void GbVoxelMatrix3D::write(UbFileOutput* out) - geht ned"); - } - else - { - out->writeString(filename); - } - - - //CbUniformMatrix3D<float> voxelMatrix; -} -/*=======================================================*/ -void GbVoxelMatrix3D::read(UbFileInput* in) -{ -#ifdef CAB_RCF - try - { -#endif - //!!! den string nimmt er vorher um das Object zu erstellen - //in->readString(); - minX1 = in->readDouble(); - minX2 = in->readDouble(); - minX3 = in->readDouble(); - deltaX1 = in->readDouble(); - deltaX2 = in->readDouble(); - deltaX3 = in->readDouble(); - nodesX1 = in->readInteger(); - nodesX2 = in->readInteger(); - nodesX3 = in->readInteger(); - lowerThreshold = in->readDouble(); - upperThreshold = in->readDouble(); - addSurfaceTriangleSetFlag = in->readBool(); - transferViaFilename = in->readBool(); - if (!transferViaFilename) - { - throw UbException(UB_EXARGS, "void GbVoxelMatrix3D::read(UbFileOutput* out) - geht ned"); - } - else - { - filename = in->readString(); - this->readMatrixFromVtiASCIIFile(filename); - } -#ifdef CAB_RCF - } - catch (std::exception& e) { UBLOGML(logERROR, UB_FUNCTION+(std::string)e.what()); throw RCF::Exception(1002, UB_FUNCTION+(std::string)e.what()); } - catch (...) { UBLOGML(logERROR, UB_FUNCTION+(std::string)"unknown error"); throw RCF::Exception(1002, UB_FUNCTION+(std::string)"unknown error"); } -#endif -} -/*=======================================================*/ void GbVoxelMatrix3D::readMatrixFromVtiASCIIFile(std::string filename) { diff --git a/src/basics/numerics/geometry3d/GbVoxelMatrix3D.h b/src/basics/geometry3d/GbVoxelMatrix3D.h similarity index 92% rename from src/basics/numerics/geometry3d/GbVoxelMatrix3D.h rename to src/basics/geometry3d/GbVoxelMatrix3D.h index 626803b7e6a994923e66dab3567e11b9dfe9a7fd..4cc0925e065e05a3b66b5ec94b1dcaaa1759b878 100644 --- a/src/basics/numerics/geometry3d/GbVoxelMatrix3D.h +++ b/src/basics/geometry3d/GbVoxelMatrix3D.h @@ -7,14 +7,11 @@ #ifndef GBVOXELMATRIX3D_H #define GBVOXELMATRIX3D_H -#ifdef CAB_RCF -#include <3rdParty/rcf/RcfSerializationIncludes.h> -#endif //CAB_RCF #include <vector> #include <cmath> -#include <numerics/geometry3d/GbObject3D.h> +#include <geometry3d/GbObject3D.h> #include <basics/utilities/UbObserver.h> #include <basics/container/CbArray3D.h> @@ -110,10 +107,6 @@ public: std::string toString(); - ObObjectCreator* getCreator(); - void write(UbFileOutput* out); - void read(UbFileInput* in); - //virtuelle Methoden von UbObserver void objectChanged(UbObservable* changedObject) {} void objectWillBeDeleted(UbObservable* objectForDeletion) {} @@ -162,38 +155,6 @@ protected: using GbObject3D::isPointInGbObject3D; //Grund: dadurch muss man hier isPointInGbObject3D(GbPoint3D*) nicht ausprogrammieren, welche sonst hier "ueberdeckt" waere -//#ifdef CAB_RCF -// template<class Archive> -// void SF_SERIALIZE(Archive & ar) -// { -// SF_SERIALIZE_PARENT<GbObject3D>(ar, *this); -// ar & minX1; -// ar & minX2; -// ar & minX3; -// ar & deltaX1; -// ar & deltaX2; -// ar & deltaX3; -// ar & nodesX1; -// ar & nodesX2; -// ar & nodesX3; -// ar & threshold; -// ar & transferViaFilename; -// ar & addSurfaceTriangleSetFlag; -// if (!transferViaFilename) -// { -// ar & voxelMatrix; -// } -// else -// { -// ar & filename; -// if (ArchiveTools::isReading(ar)) -// { -// this->readMatrixFromVtiASCIIFile(filename); -// } -// } -// -// } -//#endif //CAB_RCF protected: //for transfer diff --git a/src/basics/numerics/geometry3d/KdTree/KdNode.h b/src/basics/geometry3d/KdTree/KdNode.h similarity index 95% rename from src/basics/numerics/geometry3d/KdTree/KdNode.h rename to src/basics/geometry3d/KdTree/KdNode.h index 724ed9e08412f9e2d6fc41f289b9b8e265e53aab..026ec3cbc99a28c3cad129a2151e46714b4303e9 100644 --- a/src/basics/numerics/geometry3d/KdTree/KdNode.h +++ b/src/basics/geometry3d/KdTree/KdNode.h @@ -8,13 +8,13 @@ #include <basics/utilities/UbException.h> #include <basics/utilities/UbKeys.h> -#include <numerics/geometry3d/GbTriFaceMesh3D.h> -#include <numerics/geometry3d/KdTree/KdUtilities.h> -#include <numerics/geometry3d/KdTree/KdRay.h> -#include <numerics/geometry3d/KdTree/KdSplitCandidate.h> -#include <numerics/geometry3d/KdTree/splitalgorithms/KdSplitAlgorithm.h> -#include <numerics/geometry3d/KdTree/intersectionhandler/KdLineIntersectionHandler.h> -#include <numerics/geometry3d/KdTree/intersectionhandler/KdRayIntersectionHandler.h> +#include <geometry3d/GbTriFaceMesh3D.h> +#include <geometry3d/KdTree/KdUtilities.h> +#include <geometry3d/KdTree/KdRay.h> +#include <geometry3d/KdTree/KdSplitCandidate.h> +#include <geometry3d/KdTree/splitalgorithms/KdSplitAlgorithm.h> +#include <geometry3d/KdTree/intersectionhandler/KdLineIntersectionHandler.h> +#include <geometry3d/KdTree/intersectionhandler/KdRayIntersectionHandler.h> #include <vector> @@ -278,7 +278,7 @@ namespace Kd Node* child2; MbSmartPtr< std::vector<GbTriFaceMesh3D::TriFace> > triFaces; - std::vector<GbTriFaceMesh3D::Vertex>* ptrNodes; //lediglich für Zugriff auf die Knoten!!! + std::vector<GbTriFaceMesh3D::Vertex>* ptrNodes; //lediglich f�r Zugriff auf die Knoten!!! }; } #endif //KDNODE_H diff --git a/src/basics/numerics/geometry3d/KdTree/KdRay.h b/src/basics/geometry3d/KdTree/KdRay.h similarity index 100% rename from src/basics/numerics/geometry3d/KdTree/KdRay.h rename to src/basics/geometry3d/KdTree/KdRay.h diff --git a/src/basics/numerics/geometry3d/KdTree/KdSplitCandidate.h b/src/basics/geometry3d/KdTree/KdSplitCandidate.h similarity index 100% rename from src/basics/numerics/geometry3d/KdTree/KdSplitCandidate.h rename to src/basics/geometry3d/KdTree/KdSplitCandidate.h diff --git a/src/basics/numerics/geometry3d/KdTree/KdSplitCandidateManager.h b/src/basics/geometry3d/KdTree/KdSplitCandidateManager.h similarity index 97% rename from src/basics/numerics/geometry3d/KdTree/KdSplitCandidateManager.h rename to src/basics/geometry3d/KdTree/KdSplitCandidateManager.h index 2849def3ab60b8c9e350688ff249e8f329ea31b7..d9747848f4f5a50498c22c1d9565ece0dc10ff07 100644 --- a/src/basics/numerics/geometry3d/KdTree/KdSplitCandidateManager.h +++ b/src/basics/geometry3d/KdTree/KdSplitCandidateManager.h @@ -1,7 +1,7 @@ #ifndef KDSPLITCANDIDATEMANAGER_H #define KDSPLITCANDIDATEMANAGER_H -#include <numerics/geometry3d/KdTree/KdSplitCandidate.h> +#include <geometry3d/KdTree/KdSplitCandidate.h> #include <map> #include <vector> diff --git a/src/basics/numerics/geometry3d/KdTree/KdTree.h b/src/basics/geometry3d/KdTree/KdTree.h similarity index 92% rename from src/basics/numerics/geometry3d/KdTree/KdTree.h rename to src/basics/geometry3d/KdTree/KdTree.h index 7bf58a31526bbc0b47af1118dc7646df07b53f98..03e461216cbfd7367b872713b77c21bd3e5bae5e 100644 --- a/src/basics/numerics/geometry3d/KdTree/KdTree.h +++ b/src/basics/geometry3d/KdTree/KdTree.h @@ -1,15 +1,14 @@ #ifndef KDTREE_H #define KDTREE_H -#include <basics/memory/MbSmartPtr.h> #include <basics/writer/WbWriterVtkXmlBinary.h> -#include <numerics/geometry3d/GbTriFaceMesh3D.h> +#include <geometry3d/GbTriFaceMesh3D.h> #include <basics/utilities/UbKeys.h> -#include <numerics/geometry3d/KdTree/KdNode.h> -#include <numerics/geometry3d/KdTree/KdRay.h> -#include <numerics/geometry3d/KdTree/KdSplitCandidate.h> -#include <numerics/geometry3d/KdTree/splitalgorithms/KdSplitAlgorithm.h> +#include <geometry3d/KdTree/KdNode.h> +#include <geometry3d/KdTree/KdRay.h> +#include <geometry3d/KdTree/KdSplitCandidate.h> +#include <geometry3d/KdTree/splitalgorithms/KdSplitAlgorithm.h> #include <string> diff --git a/src/basics/numerics/geometry3d/KdTree/KdUtilities.cpp b/src/basics/geometry3d/KdTree/KdUtilities.cpp similarity index 85% rename from src/basics/numerics/geometry3d/KdTree/KdUtilities.cpp rename to src/basics/geometry3d/KdTree/KdUtilities.cpp index f0b7115b6175b9afdc3b42f0ce758eab54457422..3eca9f3562b7947d6dde8b94b248c26b84f25fb5 100644 --- a/src/basics/numerics/geometry3d/KdTree/KdUtilities.cpp +++ b/src/basics/geometry3d/KdTree/KdUtilities.cpp @@ -1,4 +1,4 @@ -#include <numerics/geometry3d/KdTree/KdUtilities.h> +#include <geometry3d/KdTree/KdUtilities.h> namespace Kd { diff --git a/src/basics/numerics/geometry3d/KdTree/KdUtilities.h b/src/basics/geometry3d/KdTree/KdUtilities.h similarity index 99% rename from src/basics/numerics/geometry3d/KdTree/KdUtilities.h rename to src/basics/geometry3d/KdTree/KdUtilities.h index 177893950a7a0ee087a1c3f74fe38b15c41285a1..13449754384d819d3301a1e5aeceb343bb8c489b 100644 --- a/src/basics/numerics/geometry3d/KdTree/KdUtilities.h +++ b/src/basics/geometry3d/KdTree/KdUtilities.h @@ -5,7 +5,7 @@ #include <basics/utilities/UbTuple.h> #include <basics/utilities/UbMath.h> -#include <numerics/geometry3d/GbTriFaceMesh3D.h> +#include <geometry3d/GbTriFaceMesh3D.h> #include <algorithm> #include <vector> diff --git a/src/basics/numerics/geometry3d/KdTree/intersectionhandler/KdCountLineIntersectionHandler.h b/src/basics/geometry3d/KdTree/intersectionhandler/KdCountLineIntersectionHandler.h similarity index 86% rename from src/basics/numerics/geometry3d/KdTree/intersectionhandler/KdCountLineIntersectionHandler.h rename to src/basics/geometry3d/KdTree/intersectionhandler/KdCountLineIntersectionHandler.h index 025a913cfb02d6f3fa723ca0c36c3114a6437ea2..4c815cfaf7c48e2f4cfdeb5f4cb6570962014ede 100644 --- a/src/basics/numerics/geometry3d/KdTree/intersectionhandler/KdCountLineIntersectionHandler.h +++ b/src/basics/geometry3d/KdTree/intersectionhandler/KdCountLineIntersectionHandler.h @@ -4,11 +4,11 @@ #include <basics/utilities/UbTuple.h> #include <basics/utilities/UbKeys.h> -#include <numerics/geometry3d/GbTriFaceMesh3D.h> +#include <geometry3d/GbTriFaceMesh3D.h> -#include <numerics/geometry3d/KdTree/KdNode.h> -#include <numerics/geometry3d/KdTree/KdUtilities.h> -#include <numerics/geometry3d/KdTree/intersectionhandler/KdLineIntersectionHandler.h> +#include <geometry3d/KdTree/KdNode.h> +#include <geometry3d/KdTree/KdUtilities.h> +#include <geometry3d/KdTree/intersectionhandler/KdLineIntersectionHandler.h> #include <set> diff --git a/src/basics/numerics/geometry3d/KdTree/intersectionhandler/KdCountRayIntersectionHandler.h b/src/basics/geometry3d/KdTree/intersectionhandler/KdCountRayIntersectionHandler.h similarity index 94% rename from src/basics/numerics/geometry3d/KdTree/intersectionhandler/KdCountRayIntersectionHandler.h rename to src/basics/geometry3d/KdTree/intersectionhandler/KdCountRayIntersectionHandler.h index e426723c1274466620051a4ce4528c9c7a0ca9bc..a1285abc9bde3a15343d56c304a231daf596e6bc 100644 --- a/src/basics/numerics/geometry3d/KdTree/intersectionhandler/KdCountRayIntersectionHandler.h +++ b/src/basics/geometry3d/KdTree/intersectionhandler/KdCountRayIntersectionHandler.h @@ -4,11 +4,11 @@ #include <basics/utilities/UbTuple.h> #include <basics/utilities/UbKeys.h> -#include <numerics/geometry3d/GbTriFaceMesh3D.h> +#include <geometry3d/GbTriFaceMesh3D.h> -#include <numerics/geometry3d/KdTree/KdNode.h> -//#include <numerics/geometry3d/KdTree/KdUtilities.h> -#include <numerics/geometry3d/KdTree/intersectionhandler/KdRayIntersectionHandler.h> +#include <geometry3d/KdTree/KdNode.h> +//#include <geometry3d/KdTree/KdUtilities.h> +#include <geometry3d/KdTree/intersectionhandler/KdRayIntersectionHandler.h> #include <set> @@ -77,7 +77,7 @@ namespace Kd GbTriFaceMesh3D::Vertex& v3 = triFace.getNode(2, nodes); ////////////////////////////////////////////////////////////////////////// - //Raytracing - start( Anm.: prüft NUR in Strahlrichtung + //Raytracing - start( Anm.: pr�ft NUR in Strahlrichtung // Grundidee: Schnittpunkt in Baryzentrischen Koordinaten besimmten // t(u,v,w) = w*v0 + u*v1 + v*v2 // mit w = 1.0-u-v, da fuer alle Punkte (u,v,w) im Dreick gilt u+v+w = 1 diff --git a/src/basics/numerics/geometry3d/KdTree/intersectionhandler/KdLineIntersectionHandler.h b/src/basics/geometry3d/KdTree/intersectionhandler/KdLineIntersectionHandler.h similarity index 93% rename from src/basics/numerics/geometry3d/KdTree/intersectionhandler/KdLineIntersectionHandler.h rename to src/basics/geometry3d/KdTree/intersectionhandler/KdLineIntersectionHandler.h index 65f94876a94cffc6f6dd9615c4f77d7c73be9a02..d52e2905cc30777326bf2ca04ed12366f3a9679b 100644 --- a/src/basics/numerics/geometry3d/KdTree/intersectionhandler/KdLineIntersectionHandler.h +++ b/src/basics/geometry3d/KdTree/intersectionhandler/KdLineIntersectionHandler.h @@ -2,7 +2,7 @@ #define KDLINEINTERSECTIONHANDLER_H #include <basics/utilities/UbTuple.h> -//#include <numerics/geometry3d/GbTriFaceMesh3D.h> +//#include <geometry3d/GbTriFaceMesh3D.h> #include <set> diff --git a/src/basics/numerics/geometry3d/KdTree/intersectionhandler/KdRayIntersectionHandler.h b/src/basics/geometry3d/KdTree/intersectionhandler/KdRayIntersectionHandler.h similarity index 90% rename from src/basics/numerics/geometry3d/KdTree/intersectionhandler/KdRayIntersectionHandler.h rename to src/basics/geometry3d/KdTree/intersectionhandler/KdRayIntersectionHandler.h index 7578d9046a68fc2a2b310204379df37f2c758c84..2e0740ce8633e3a7b2410411234fa5dcb9149fea 100644 --- a/src/basics/numerics/geometry3d/KdTree/intersectionhandler/KdRayIntersectionHandler.h +++ b/src/basics/geometry3d/KdTree/intersectionhandler/KdRayIntersectionHandler.h @@ -2,7 +2,7 @@ #define KDRAYINTERSECTIONHANDLER_H #include <basics/utilities/UbTuple.h> -#include <numerics/geometry3d/KdTree/KdRay.h> +#include <geometry3d/KdTree/KdRay.h> #include <set> diff --git a/src/basics/numerics/geometry3d/KdTree/splitalgorithms/KdSAHSplit.cpp b/src/basics/geometry3d/KdTree/splitalgorithms/KdSAHSplit.cpp similarity index 75% rename from src/basics/numerics/geometry3d/KdTree/splitalgorithms/KdSAHSplit.cpp rename to src/basics/geometry3d/KdTree/splitalgorithms/KdSAHSplit.cpp index da4ff27465d87a8a6fff032d8f84e427a278255d..98fc024dbfc4612f99cef66afe5c9d74d5eeaf67 100644 --- a/src/basics/numerics/geometry3d/KdTree/splitalgorithms/KdSAHSplit.cpp +++ b/src/basics/geometry3d/KdTree/splitalgorithms/KdSAHSplit.cpp @@ -1,4 +1,4 @@ -//#include <numerics/geometry3d/KdTree/SAHSplit.h> +//#include <geometry3d/KdTree/SAHSplit.h> // namespace Kd diff --git a/src/basics/numerics/geometry3d/KdTree/splitalgorithms/KdSAHSplit.h b/src/basics/geometry3d/KdTree/splitalgorithms/KdSAHSplit.h similarity index 97% rename from src/basics/numerics/geometry3d/KdTree/splitalgorithms/KdSAHSplit.h rename to src/basics/geometry3d/KdTree/splitalgorithms/KdSAHSplit.h index aa2a739a3003350b78ed3fa6210f8fdc5c0d5204..31f3b6e848f52711f5cdf5c4a7b6c90d38dbb7bb 100644 --- a/src/basics/numerics/geometry3d/KdTree/splitalgorithms/KdSAHSplit.h +++ b/src/basics/geometry3d/KdTree/splitalgorithms/KdSAHSplit.h @@ -4,12 +4,12 @@ #include <basics/utilities/UbException.h> #include <basics/utilities/UbMath.h> #include <basics/utilities/UbInfinity.h> -#include <numerics/geometry3d/GbTriFaceMesh3D.h> +#include <geometry3d/GbTriFaceMesh3D.h> -#include <numerics/geometry3d/KdTree/KdNode.h> -#include <numerics/geometry3d/KdTree/KdUtilities.h> -#include <numerics/geometry3d/KdTree/KdSplitCandidateManager.h> -#include <numerics/geometry3d/KdTree/splitalgorithms/KdSplitAlgorithm.h> +#include <geometry3d/KdTree/KdNode.h> +#include <geometry3d/KdTree/KdUtilities.h> +#include <geometry3d/KdTree/KdSplitCandidateManager.h> +#include <geometry3d/KdTree/splitalgorithms/KdSplitAlgorithm.h> #include <vector> #include <cmath> diff --git a/src/basics/numerics/geometry3d/KdTree/splitalgorithms/KdSpatiallMedianSplit.h b/src/basics/geometry3d/KdTree/splitalgorithms/KdSpatiallMedianSplit.h similarity index 96% rename from src/basics/numerics/geometry3d/KdTree/splitalgorithms/KdSpatiallMedianSplit.h rename to src/basics/geometry3d/KdTree/splitalgorithms/KdSpatiallMedianSplit.h index b87c18b4817ab2c017cd76b66c220f5aa41ce90f..9cc835601a81b4596eaa42314f2143594dd63287 100644 --- a/src/basics/numerics/geometry3d/KdTree/splitalgorithms/KdSpatiallMedianSplit.h +++ b/src/basics/geometry3d/KdTree/splitalgorithms/KdSpatiallMedianSplit.h @@ -2,9 +2,9 @@ #define SPATIALLMEDIANSPLIT_H #include <basics/utilities/UbMath.h> -#include <numerics/geometry3d/GbTriFaceMesh3D.h> +#include <geometry3d/GbTriFaceMesh3D.h> -#include <numerics/geometry3d/KdTree/splitalgorithms/KdSplitAlgorithm.h> +#include <geometry3d/KdTree/splitalgorithms/KdSplitAlgorithm.h> namespace Kd { diff --git a/src/basics/numerics/geometry3d/KdTree/splitalgorithms/KdSplitAlgorithm.h b/src/basics/geometry3d/KdTree/splitalgorithms/KdSplitAlgorithm.h similarity index 79% rename from src/basics/numerics/geometry3d/KdTree/splitalgorithms/KdSplitAlgorithm.h rename to src/basics/geometry3d/KdTree/splitalgorithms/KdSplitAlgorithm.h index 16244300593b2de61738ade6f09cf8525504551f..d50d972ff2b5582d0ec3963763d2bd68d2fa24ed 100644 --- a/src/basics/numerics/geometry3d/KdTree/splitalgorithms/KdSplitAlgorithm.h +++ b/src/basics/geometry3d/KdTree/splitalgorithms/KdSplitAlgorithm.h @@ -1,9 +1,9 @@ #ifndef KDSPLITALGORITHM_H #define KDSPLITALGORITHM_H -#include <numerics/geometry3d/GbTriFaceMesh3D.h> -//#include <numerics/geometry3d/KdTree/Node.h> -#include <numerics/geometry3d/KdTree/KdSplitCandidate.h> +#include <geometry3d/GbTriFaceMesh3D.h> +//#include <geometry3d/KdTree/Node.h> +#include <geometry3d/KdTree/KdSplitCandidate.h> #include <vector> diff --git a/src/basics/numerics/geometry3d/GbObject3DManager.cpp b/src/basics/numerics/geometry3d/GbObject3DManager.cpp deleted file mode 100644 index e7ca650de7e8d3699195fa16c4767e11305b74c8..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/GbObject3DManager.cpp +++ /dev/null @@ -1,285 +0,0 @@ -#include <numerics/geometry3d/GbObject3DManager.h> -#include <numerics/geometry3d/GbObject3D.h> -#include <numerics/geometry3d/creator/GbObject3DFactory.h> - -using namespace std; - -GbObject3DEntry::GbObject3DEntry(GbObject3DManager *parent, GbObject3D *geoObject, bool active, string name):ObObjectEntry(parent, geoObject) -{ - //this->parent = parent; - //this->geoObject = geoObject; - this->active = active; - this->name = name; -} - -/*======================================================*/ -/*== nun halt der Manager ====*/ -/*======================================================*/ - -GbObject3DManager::GbObject3DManager(): ObObjectManager() -{ - this->tableModel = new GbObject3DTableModel(this); -} -/*======================================================*/ -GbObject3DManager::~GbObject3DManager() -{ -// this->gbObject3DList.clear(); -} -/*======================================================*/ -ObObjectFactory* GbObject3DManager::getObObjectFactory() -{ - return GbObject3DFactory::getInstance(); -} - -/*======================================================*/ -ObObjectEntry* GbObject3DManager::createNewObObjectEntry(ObObject *obj) -{ - GbObject3D *geoobject = dynamic_cast<GbObject3D*>(obj); - return new GbObject3DEntry(this, geoobject, true, geoobject->getTypeID()); -} - -/*======================================================*/ -//UbTableModel* GbObject3DManager::getTableModel() -//{ -// return this->tablemodel; -//} - -/*======================================================*/ -//bool GbObject3DManager::addGbObject3D(GbObject3D *geoObject) -//{ -// return this->addGbObject3D(geoObject, true, "GeoObject"); -//} -// -///*======================================================*/ -bool GbObject3DManager::addGbObject3D(GbObject3D *geoObject, string name) -{ - GbObject3DEntry *entry = new GbObject3DEntry (this, geoObject, true, name); - return ObObjectManager::addObObjectEntry(entry); -} -//bool GbObject3DManager::addGbObject3D(GbObject3D *geoObject, bool active, string name) -//{ -// GbObject3DEntry *entry = new GbObject3DEntry (this, geoObject, true, name); -// return ObObjectManager::addObObjectEntry(entry); -//} -// -/*======================================================*/ -bool GbObject3DManager::removeGbObject3D(GbObject3D *geoObject) -{ - return ObObjectManager::removeObObject(geoObject); -} -/*======================================================*/ -bool GbObject3DManager::removeGbObject3D(int index) -{ - return ObObjectManager::removeObObject(index); -} -/*======================================================*/ -//void GbObject3DManager::removeAllGbObject3Ds() -//{ -// this->gbObject3DList.clear(); -//} -/*======================================================*/ -int GbObject3DManager::getNumberOfGbObject3Ds() -{ - return GbObject3DManager::getNumberOfObObjects(); -} -/*======================================================*/ -vector<GbObject3D*>* GbObject3DManager::getAllGbObject3Ds() -{ - throw UbException(UB_EXARGS,"not implemented"); - //vector<GbObject3D*> *geoVektor = new vector<GbObject3D*>; - //for(int u=0; u<(int)this->gbObject3DList.size();u++) - //{ - // GbObject3D* geoObject = dynamic_cast<GbObject3D*>((gbObject3DList)[u]->getObject()); - // geoVektor->push_back(geoObject); - //} - //return geoVektor; -} -/*======================================================*/ -GbObject3D* GbObject3DManager::getGbObject3D(int index) -{ - if(index < 0) return NULL; - if(index >= this->getNumberOfObObjects()) return NULL; - - GbObject3D* geoObject = dynamic_cast<GbObject3D*>(this->getObObject(index)); - return(geoObject); -} -/*======================================================*/ -//GbObject3DEntry* GbObject3DManager::getGbObject3DEntry(int index) -//{ -// if(index < 0) return NULL; -// if(index >= (int)this->gbObject3DList.size()) return NULL; -// -// return((this->gbObject3DList)[index]); -//} -/*====================================================*/ -void GbObject3DManager::write(UbFileOutput *out) -{ - int size = this->getNumberOfObObjects(); - out->writeInteger(size); - out->writeString("// #GbObjects"); - - GbObject3D *geoObject; - for(int pos=0; pos<size; pos++) - { - out->writeLine(); - geoObject = dynamic_cast<GbObject3D*>(this->getObObject(pos)); - cout<<pos<<".:"<<geoObject->toString()<<endl; - geoObject->write(out); - } -} -/*======================================================================*/ -void GbObject3DManager::read(UbFileInput *in) -{ - this->removeAllObObjects(); - - int n = in->readInteger(); - - cout<<"GbObject3DManager::read "<<n<<" GbObject3Ds\n"; - GbObject3D *geoObject; - for(int pos=1; pos<=n; pos++) - { - in->readLine(); - cout<<" - GbObject3D "<<pos<<" ..."; - geoObject = GbObject3DFactory::getInstance()->createGbObject3D(in); - - GbObject3DEntry *entry = new GbObject3DEntry(this, geoObject, true, "GeoObject"); - this->addObObjectEntry(entry); - cout<<"done\n"; - } -} -/*======================================================*/ -string GbObject3DManager::toString() -{ - stringstream ss; ss<<endl; - - int size = this->getNumberOfObObjects(); - for(int pos=0; pos<size; pos++) - { - ObObject* geoObject = this->getObObject(pos); - ss<<(pos+1)<<". "<<geoObject->toString()<<endl; - } - string back = ss.str(); - return back; -} - -/*======================================================*/ -/*======================================================*/ -/*======================================================*/ - -GbObject3DTableModel::GbObject3DTableModel(GbObject3DManager* manager) -{ - this->objectManager = manager; -} - -/*======================================================*/ -GbObject3DTableModel::~GbObject3DTableModel(void) -{ -} - -/*======================================================*/ -//Gibt die Anzahl der Spalten zurueck. -int GbObject3DTableModel::getColumnNumber() -{ - return 3; -} - -/*======================================================*/ -std::string GbObject3DTableModel::getColumnLabel(int column) -{ - switch(column) - { - case COL_NAME: return "Name"; - case COL_TYPE: return "Type"; - case COL_ACTIVE: return "Active"; - default: throw UbException(UB_EXARGS,"falscher Spaltenindex"); - } -} - -/*======================================================*/ -int GbObject3DTableModel::getRowNumber() -{ - return this->objectManager->getNumberOfGbObject3Ds(); -} -/*======================================================*/ -int GbObject3DTableModel::getSelectedRowIndex() -{ - return 0; - // return this->objectManager->getSelectedIndex(); -} - -/*======================================================*/ -int GbObject3DTableModel::getColumnType(int column) -{ - switch(column) { - case COL_NAME : - return UbTableModel::COL_TYPE_STRING; - break; - case COL_TYPE : - return UbTableModel::COL_TYPE_STRING; - break; - case COL_ACTIVE : - return UbTableModel::COL_TYPE_BOOL; - break; - } - return -1; -} - -//Gibt den Eintag der Tabelle an der angegebenen Spalten- und -//Zeilenposition in Form eines String Werts zurueck. -std::string GbObject3DTableModel::getStringValue(int row, int col) -{ - GbObject3DEntry* gbObjEntry = dynamic_cast<GbObject3DEntry*>(this->objectManager->getObObjectEntry(row)); - switch(col) { - case COL_NAME: - return gbObjEntry->name; - break; - case COL_TYPE: - return gbObjEntry->getObject()->getTypeID(); - break; - case COL_ACTIVE: - if ( gbObjEntry->active ) return "True"; - return "False"; - break; - } - return "Fehler"; -} - -/*======================================================*/ -//bool GbObject3DManager::selectGbObject3D(int index) -//{ -// cout<<"GbObject3DManager::selectGbObject3D(int index):"<<index<<endl; -// if (index > (int)this->gbObject3DList.size()-1 || index < 0) return false; -// if ( this->selectedObject == this->getGbObject3D(index) ) return true; -// this->selectedObject = this->getGbObject3D(index); -// this->notifyObserversObjectChanged(); -// return true; -//} -///*======================================================*/ -//bool GbObject3DManager::selectGbObject3D(GbObject3D* geoObject) -//{ -// for(int pos=0; pos<(int)this->gbObject3DList.size(); pos++) -// { -// if(this->gbObject3DList[pos]->geoObject==geoObject) -// { -// return this->selectGbObject3D(pos); -// } -// } -// return false; -//} -///*======================================================*/ -//GbObject3D* GbObject3DManager::getSelectedGbObject3D() -//{ -// return this->selectedObject; -//} -///*======================================================*/ -//int GbObject3DManager::getSelectedIndex() -//{ -// for(int pos=0; pos<(int)this->gbObject3DList.size(); pos++) -// { -// if(this->gbObject3DList[pos]->geoObject==this->selectedObject) -// { -// return pos; -// } -// } -// return -1; -//} diff --git a/src/basics/numerics/geometry3d/GbObject3DManager.h b/src/basics/numerics/geometry3d/GbObject3DManager.h deleted file mode 100644 index 5f698f090e5be352ee10b70f798cdc7c914151bc..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/GbObject3DManager.h +++ /dev/null @@ -1,119 +0,0 @@ -// _ ___ __ __________ _ __ -// | | / (_)____/ /___ ______ _/ / ____/ /_ __(_)___/ /____ -// | | / / / ___/ __/ / / / __ `/ / /_ / / / / / / __ / ___/ -// | |/ / / / / /_/ /_/ / /_/ / / __/ / / /_/ / / /_/ (__ ) -// |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/ -// -#ifndef GBOBJECT3DMANAGER_H -#define GBOBJECT3DMANAGER_H - -#include <string> -#include <sstream> -#include <vector> - -#include <basics/utilities/UbException.h> -#include <basics/utilities/UbFileInput.h> -#include <basics/utilities/UbFileOutput.h> -#include <basics/utilities/UbTableModel.h> -#include <basics/objects/ObObjectManager.h> - -#include <PointerDefinitions.h> - -class GbObject3D; -class GbObject3DManager; -class GbObject3DTableModel; - -class GbObject3DEntry : public ObObjectEntry -{ - friend class GbObject3DManager; - friend class GbObject3DTableModel; -public: - std::string getName() { return this->name;} -private: - //GbObject3DManager *parent; - //GbObject3D *geoObject; - bool active; - std::string name; - - - GbObject3DEntry(GbObject3DManager* parent, GbObject3D* geoObject, bool active, std::string name); - -}; - - -class GbObject3DManager : public ObObjectManager -{ -public: - GbObject3DManager(); - ~GbObject3DManager(); - - ObObjectEntry* createNewObObjectEntry(ObObject *obj); - ObObjectFactory* getObObjectFactory(); - - - //bool addGbObject3D(GbObject3D *geoObject3D); - bool addGbObject3D(GbObject3D *geoObject3D, std::string name); - //bool addGbObject3D(GbObject3D *geoObject3D, bool active, std::string name); - - bool removeGbObject3D(GbObject3D *geoObject3D); - bool removeGbObject3D(int index); - - int getNumberOfGbObject3Ds(); - std::vector<GbObject3D*>* getAllGbObject3Ds(); - GbObject3D* getGbObject3D(int index); - - //keine Definition dafuer da ... - //void writeValidationAVSFile(string filename); - //void writeSurfaceAVSFile(string filename); - - //public final OctConstructionDescriptor[] getAllActiveConstructions() - //public final OctSpecificConstructionInstrument getSpecificConstructionInstrumentInstance(int index) - //public final boolean isConstructionActive(int index) - //public final boolean isConstructionVisible(int index) - //public final void activateConstruction(int index, boolean active) - //public final void visibleConstruction(int index, boolean visible) - // UbTableModel* getTableModel(); - //void objectChanged(UbObservable* observable); - //void objectWillBeDeleted(UbObservable* observable); - - - void read(UbFileInput *in); - void write(UbFileOutput *out); - - std::string toString(); - -private: - //GbObject3DTableModel* tablemodel; - // GbObject3D* selectedObject; - //vector<GbObject3DEntry*> gbObject3DList; -}; - -class GbObject3DTableModel : public UbTableModel -{ -public: - - static const int COL_NAME = 0; - static const int COL_TYPE = 1; - static const int COL_ACTIVE = 2; - - GbObject3DTableModel(GbObject3DManager* manager); - ~GbObject3DTableModel(void); - - ////////////////////////////////////////////////////////////////////////// - //Geerbt von CabTable - int getColumnNumber(void); - int getRowNumber(); - - std::string getColumnLabel(int column); - - int getColumnType(int); - std::string getStringValue(int row, int col); - int getSelectedRowIndex(); - //bool GetBoolValue(int row, int col); - void setStringValue(int row, int col, std::string str) { throw UbException(UB_EXARGS,"not implemented"); } - -protected: - GbObject3DManager* objectManager; -}; - -#endif diff --git a/src/basics/numerics/geometry3d/GbPolygon3D.cpp b/src/basics/numerics/geometry3d/GbPolygon3D.cpp deleted file mode 100644 index 80f88334741760505fedfe5ed40e836cbb74acdd..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/GbPolygon3D.cpp +++ /dev/null @@ -1,686 +0,0 @@ -#include <numerics/geometry3d/GbPolygon3D.h> -#include <numerics/geometry3d/creator/GbPolygon3DCreator.h> - -using namespace std; - -ObObjectCreator* GbPolygon3D::getCreator() -{ - return GbPolygon3DCreator::getInstance(); -} - -int GbPolygon3D::counter = 0; - -GbPolygon3D::GbPolygon3D() -{ - init(); - counter++; - this->ps = new GbSystem3D::PointSet3(0); -} -void GbPolygon3D::init() -{ - x1s = 0.0; - x2s = 0.0; - x1min = 0.0; - x1max = 0.0; - x2min = 0.0; - x2max = 0.0; - // points = NULL; - consistent = false; - ps = NULL; -} - -/** -* Creates an empty 3D polygon with the specified capacity. -* @param capacity the initial capacity -*/ -GbPolygon3D::GbPolygon3D(int capacity) -{ - init(); - counter++; - this->ps = new GbSystem3D::PointSet3(capacity); - // this.po = new PointObserver(this); -} -/** -* Creates a 3D polygon with the specified points. -* @param points the initial points of the polygon -*/ -GbPolygon3D::GbPolygon3D(vector<GbPoint3D>& points) -{ - init(); - counter++; - this->ps = new GbSystem3D::PointSet3((int)points.size()); - this->addPoints(points); -} -/** -* Creates a 3D polygon as clone of the specified 3D polygon. -* @param polygon the 3D polygon to be cloned -*/ -GbPolygon3D::GbPolygon3D(GbPolygon3D* polygon) -{ - this->init(); - counter++; - this->ps = new GbSystem3D::PointSet3((int)polygon->size()); - vector<GbPoint3D> temp = polygon->getPoints(); - this->addPoints( temp ); -} - -GbPolygon3D::~GbPolygon3D() -{ - counter--; - //if(points) - //for(unsigned u=0; u<points->size(); u++) - //{ - // delete (*points)[u]; - //} - // delete this->points; - delete this->ps; -} - -/*======================================================================*/ -/** -* Returns the number of points. -* @return the number of points -*/ -int GbPolygon3D::size() -{ - return(this->ps->size()); -} -/** -* Returns the number of times this 3D polygon contains the specified point. -* @param point the point -* @return the number of times this 3D polygon contains the specified point -*/ -int GbPolygon3D::contains(GbPoint3D* point) -{ - return(this->ps->contains(point)); -} -/** -* Returns the number of times this 3D polygon contains a point equal to the specified point. -* @param point the point -* @return the number of times this 3D polygon contains a point equal to the specified point -*/ -int GbPolygon3D::containsEqual(GbPoint3D* point) -{ - return(this->ps->containsEqual(point)); -} -/** -* Returns true, if this 3D polygon contains the specified line. -* @param point1 the first point -* @param point2 the second point -* @return true, if this 3D polygon contains the specified line -*/ -bool GbPolygon3D::containsLine(GbPoint3D* point1, GbPoint3D* point2) -{ - return(this->ps->containsLine(point1, point2)); -} -/** -* Returns true, if this 3D polygon contains the specified line. -* @param line the line -* @return true, if this 3D polygon contains the specified line -*/ -bool GbPolygon3D::containsLine(GbLine3D* line) -{ - return(this->ps->containsLine(line->getPoint1(), line->getPoint2())); -} -/** -* Returns the first point. -* @return the first point -*/ -GbPoint3D* GbPolygon3D::getFirstPoint() -{ - return(this->ps->getFirstPoint()); -} -/** -* Returns the last point. -* @return the last point -*/ -GbPoint3D* GbPolygon3D::getLastPoint() -{ - return(this->ps->getLastPoint()); -} -/** -* Returns the specified point. -* @param index the index -* @return the specified point -* @exception ArrayIndexOutOfBoundsException if the specified index is not valid -*/ -GbPoint3D* GbPolygon3D::getPoint(const int& index) -{ - if(index < 0 || index > this->ps->size()) throw UbException(UB_EXARGS,"ArrayIndexOutOfBoundsException-GbPolygon3D.getPoint()"); - return(this->ps->getPoint(index)); -} -/** -* Returns the points. -* @return the points -*/ -vector<GbPoint3D> GbPolygon3D::getPoints() -{ - if(!this->consistent) this->calculateValues(); - return(this->points); -} -/** -* Returns the points within the specified rectangle. -* @param p1 the 1st point of the rectangle -* @param p2 the 2nd point of the rectangle -* @return the points within the specified rectangle -*/ -vector<GbPoint3D> GbPolygon3D::getPoints(GbPoint3D* p1, GbPoint3D* p2) -{ - return(this->getPoints(p1->x1, p1->x2, p1->x3, p2->x1, p2->x2, p2->x3)); -} -/** -* Returns the points within the specified rectangle. -* @param p1x1 the 1st x1 coordinate of the rectangle -* @param p1x2 the 1st x2 coordinate of the rectangle -* @param p1x3 the 1st x3 coordinate of the rectangle -* @param p2x1 the 2nd x1 coordinate of the rectangle -* @param p2x2 the 2nd x2 coordinate of the rectangle -* @param p2x3 the 2nd x3 coordinate of the rectangle -* @return the points within the specified rectangle -*/ -vector<GbPoint3D> GbPolygon3D::getPoints(const double& p1x1, const double& p1x2, const double& p1x3, const double& p2x1, const double& p2x2, const double& p2x3) -{ - double x1min, x1max, x2min, x2max, x3min, x3max; - - if(UbMath::less(p1x1, p2x1)) { x1min = p1x1; x1max = p2x1; } - else { x1min = p2x1; x1max = p1x1; } - if(UbMath::less(p1x2, p2x2)) { x2min = p1x2; x2max = p2x2; } - else { x2min = p2x2; x2max = p1x2; } - if(UbMath::less(p1x3, p2x3)) { x3min = p1x3; x3max = p2x3; } - else { x3min = p2x3; x3max = p1x3; } - - GbSystem3D::PointSet3 *pts = new GbSystem3D::PointSet3(1); - - if(!this->consistent) this->calculateValues(); - for(int i=this->size()-1; i>=0; i--) - { - if(UbMath::lessEqual(x1min, (this->points)[i].x1) && UbMath::greaterEqual(x1max, (this->points)[i].x1) && - UbMath::lessEqual(x2min, (this->points)[i].x2) && UbMath::greaterEqual(x2max, (this->points)[i].x2) && - UbMath::lessEqual(x3min, (this->points)[i].x3) && UbMath::greaterEqual(x3max, (this->points)[i].x3)) pts->add((this->points)[i]); - } - return(pts->getPoints()); -} -/** -* Returns the area of this polygon. -* The area is positive for positive ordered points, otherwise negative. -* @return the area of this polygon -*/ -//double getArea() -//{ -// if(!this.consistent) this.calculateValues(); -// return(this.area); -//} -double GbPolygon3D::getX1Centroid() -{ - if(!this->consistent) this->calculateValues(); - return(this->x1s); -} -double GbPolygon3D::getX1Minimum() -{ - if(!this->consistent) this->calculateValues(); - return(this->x1min); -} -double GbPolygon3D::getX1Maximum() -{ - if(!this->consistent) this->calculateValues(); - return(this->x1max); -} -double GbPolygon3D::getX2Centroid() -{ - if(!this->consistent) this->calculateValues(); - return(this->x2s); -} -double GbPolygon3D::getX2Minimum() -{ - if(!this->consistent) this->calculateValues(); - return(this->x2min); -} -double GbPolygon3D::getX2Maximum() -{ - if(!this->consistent) this->calculateValues(); - return(this->x2max); -} -double GbPolygon3D::getX3Centroid() -{ - if(!this->consistent) this->calculateValues(); - return(this->x3s); -} -double GbPolygon3D::getX3Minimum() -{ - if(!this->consistent) this->calculateValues(); - return(this->x3min); -} -double GbPolygon3D::getX3Maximum() -{ - if(!this->consistent) this->calculateValues(); - return(this->x3max); -} - -/** -* Adds a point to the end of this polygon. Notifies the observers of this 3D polygon. -* @param point the point -*/ -void GbPolygon3D::addPoint(GbPoint3D* point) -{ - //if((this instanceof GbPolygon3D) && !(point instanceof GbPoint3D)) throw new IllegalArgumentException("GbPolygon3D.addPoint(): points of 3D polygons have to be 3D points!"); - - this->ps->add(point); - //point.addObserver(this.po); - this->consistent = false; - //super.notifyObservers(); -} -/** -* Adds a number of points to the end of this polygon. Notifies the observers of this 3D polygon. -* @param points the points -*/ -void GbPolygon3D::addPoints(vector<GbPoint3D>& points) -{ - //if((this instanceof GbPolygon3D) && (points.getClass().getComponentType() != GbPoint3D.class)) throw new IllegalArgumentException("GbPolygon3D.addPoints(): points of 3D polygons have to be 3D points!"); - - this->ps->add(points); - //for(int i=0; i<points.length; i++) points[i].addObserver(this.po); - this->consistent = false; - //super.notifyObservers(); -} -/** -* Inserts a point at the specified position within this polygon. Notifies the observers of this 3D polygon. -* @param point the point -* @param index the index -* @exception ArrayIndexOutOfBoundsException if the specified index is not valid -*/ -//public void insertPoint(GbPoint3D point, int index) throws ArrayIndexOutOfBoundsException -//{ -// if((this instanceof GbPolygon3D) && !(point instanceof GbPoint3D)) throw new IllegalArgumentException("GbPolygon3D.insertPoint(): points of 3D polygons have to be 3D points!"); -// if(index < 0 || index > this.ps.size()) throw new ArrayIndexOutOfBoundsException("GbPolygon3D.insert(): invalid index specified: "+index); - -// this.ps.insert(point, index); -// point.addObserver(this.po); -// this.consistent = false; -// super.notifyObservers(); -//} -/** -* Removes all points from this polygon identical to the specified one. Notifies the observers of this 3D polygon. -* @param point the point -*/ -//public void deletePoint(GbPoint3D point) -//{ -// this.ps.delete(point); -// point.removeObserver(this.po); -// this.consistent = false; -// super.notifyObservers(); -//} -/** -* Removes all points from this polygon equal to the specified one. Notifies the observers of this 3D polygon. -* @param point the point -*/ -//public void deleteEqualPoint(GbPoint3D point) -//{ -// this.ps.deleteEqual(point); -// point.removeObserver(this.po); -// this.consistent = false; -// super.notifyObservers(); -//} -/** -* Removes all points from this polygon. Notifies the observers of this 3D polygon. -*/ -void GbPolygon3D::clear() -{ - // delete this->points; - this->ps->clearAndTrim(); - delete this->ps; - - //for(int i=points.length-1; i>=0; i--) points[i].removeObserver(this.po); - this->consistent = false; - //super.notifyObservers(); -} - -/** -* Returns true if this 3D polygon equals the specified object. -* Two polygon are equal, if their points are equal. -* <BR>Note that the order of points is recognized! -* @return true if this 3D polygon equals the specified object -* @see GbPoint3D#equals(java.lang.Object) -*/ -// bool equals(Object object) -// { -// try -// { -// GbPolygon2D polygon = (GbPolygon3D) object; -//int n = this.size(); - -//if(n != polygon.size()) return(false); -//for(int i=0; i<n; i++) if(!this.getPoint(i).equals(polygon.getPoint(i))) return(false); -//return(true); -// } -// catch(Exception e){ return(false); } -// } -/** -* Returns a string representation of this 3D polygon. -* @return a string representation of this 3D polygon -*/ -string GbPolygon3D::toString() -{ - stringstream ss; - ss<<"GbPolygon3D["; - ss<<this->size()<<" points"; - - // ss<<", x1s="<<this->x1s; - // ss<<", x2s="<<this->x2s; - //ss<<", x3s="<<this->x3s; - // ss<<", x1min="<<this->x1min; - // ss<<", x1max="<<this->x1max; - // ss<<", x2min="<<this->x2min; - // ss<<", x2max="<<this->x2max; - //ss<<", x3min="<<this->x3min; - // ss<<", x3max="<<this->x3max; - ss<<"]"<<endl; - for(int u=0; u<this->size(); u++) - ss<<this->ps->getPoint(u)->toString()<<endl; - - return(ss.str()); -} -/*======================================================================*/ - - -/*======================================================================*/ -/* Calculation */ -/* */ -/* -* Returns the intersection points of this 3D polygon and the specified 3D line. -* @param line the 3D line to intersect -* @return the intersection points of this 3D polygon and the specified 3D line -*/ -// public GbPoint3D[] calculateIntersectionPoints3D(GbLine3D line) -// { -// GbSystem.PointSet pointSet = new GbSystem.PointSet(0); -// GbPoint3D points[] = this.getPoints(); -// GbPoint3D pCrossed = null; -// int n = points.length; -// if(n < 2) return(pointSet.getPoints()); - -// for(int i=1; i<n; i++) -// { -//pCrossed = GbSystem.calculateIntersectionPoint3D(points[i-1], points[i], line.p1, line.p2); -//if(pCrossed != null) pointSet.add(pCrossed); -// } -// pCrossed = GbSystem.calculateIntersectionPoint3D(points[n-1], points[0], line.p1, line.p2); -// if(pCrossed != null) pointSet.add(pCrossed); - -// return(pointSet.getPoints()); -// } - -/* -* Returns true if the specified 3D point lies within (or on the border of) this 3D polygon. -* @param point the 3D point to check -* @return true if the specified 3D point lies within (or on the border of) this 3D polygon -*/ -// public boolean enclosesPoint3D(GbPoint3D point) -// { -// if(GbSystem.less(point.x1, this.x1min)) return(false); -// if(GbSystem.less(point.x2, this.x2min)) return(false); -// if(GbSystem.greater(point.x1, this.x1max)) return(false); -// if(GbSystem.greater(point.x2, this.x2max)) return(false); -// if(this.containsEqual(point) > 0) return(true); - -// QbList ltest = new QbList(GbPoint2D.class, QbList.NOEQUALOBJECTS); -// GbPoint3D points[] = this.getPoints(); -// GbPoint3D ptest; -// int n = points.length; -// if(n < 2) return(false); - -// if(GbSystem.equal(point.x2, this.x2min)) ptest = new GbPoint3D(point.x1, this.x2min-1.0); -// else ptest = new GbPoint3D(point.x1, this.x2max+1.0); - -// for(int i=1; i<n; i++) -// { -//try { ltest.append(GbSystem.calculateIntersectionPoint2D(points[i-1], points[i], point, ptest)); } -//catch(Exception e){} -// } -// try { ltest.append(GbSystem.calculateIntersectionPoint3D(points[n-1], points[0], point, ptest)); } -// catch(Exception e){} -// return((ltest.size()%2)==1); -// } - -/* -* Returns a new 3D polygon clipped by the specified 3D rectangle (result may be null!). -* @param rectangle the 3D rectangle -* @return a new 3D polygon clipped by the specified 3D rectangle -*/ -// GbPolygon3D *createClippedPolygon3D(GbCuboid3D *cube) -// { -//return(GbSystem::clipPolygon3D(this->getPoints(), cube->p1->x1, cube->p1->x2, cube->p1->x3, , cube->p2->x1, cube->p2->x2, cube->p2->x3)); -// } -/* -* Returns a new 3D polygon clipped by the specified 3D rectangle (result may be null!). -* @param p1 the 1st point of the rectangle -* @param p2 the 2nd point of the rectangle -* @return a new 3D polygon clipped by the specified 3D rectangle -*/ -// GbPolygon3D *createClippedPolygon3D(GbPoint3D *p1, GbPoint3D *p2) -// { -//return(GbSystem::clipPolygon3D(this->getPoints(), p1->x1, p1->x2, p1->x3, p2->x1, p2->x2, p2->x3)); -// } -/* -* Returns a new 3D polygon clipped by the specified 3D rectangle (result may be null!). -* @param p1x1 the 1st x1 coordinate of the rectangle -* @param p1x2 the 1st x2 coordinate of the rectangle -* @param p2x1 the 2nd x1 coordinate of the rectangle -* @param p2x2 the 2nd x2 coordinate of the rectangle -* @return a new 3D polygon clipped by the specified 3D rectangle -*/ -// GbPolygon3D *createClippedPolygon3D(double p1x1, double p1x2, double p1x3, double p2x1, double p2x2, double p2x3) -// { -//return(GbSystem::clipPolygon3D(this.getPoints(), p1x1, p1x2, p1x3, p2x1, p2x2. p2x3)); -// } - -/* -* Returns true if the specified 3D rectangle lies completely within this 3D polygon. -* @param rectangle the 3D rectangle to check -* @return true if the specified 3D rectangle lies completely within this 3D polygon -*/ -//public boolean enclosesRectangle3D(GbRectangle3D rectangle) -//{ -// GbPolygon3D p = GbSystem.clipPolygon3D(this.getPoints(), rectangle.p1.x1, rectangle.p1.x2, rectangle.p2.x1, rectangle.p2.x2); -// return(p!=null && GbSystem.equal(Math.abs(p.getArea()), rectangle.getArea())); -//} -/* -* Returns true if the specified 3D rectangle lies completely within this 3D polygon. -* @param p1 the 1st point of the rectangle to check -* @param p2 the 2nd point of the rectangle to check -* @return true if the specified 3D rectangle lies completely within this 3D polygon -*/ -//public boolean enclosesRectangle3D(GbPoint3D p1, GbPoint3D p2) -//{ -// GbPolygon3D p = GbSystem.clipPolygon3D(this.getPoints(), p1.x1, p1.x2, p2.x1, p2.x2); -// return(p!=null && GbSystem.equal(Math.abs(p.getArea()), Math.abs((p1.x1-p2.x1)*(p1.x2-p2.x2)))); -//} -/* -* Returns true if the specified 3D rectangle lies completely within this 3D polygon. -* @param p1x1 the 1st x1 coordinate of the rectangle to check -* @param p1x2 the 1st x2 coordinate of the rectangle to check -* @param p2x1 the 2nd x1 coordinate of the rectangle to check -* @param p2x2 the 2nd x2 coordinate of the rectangle to check -* @return true if the specified 3D rectangle lies completely within this 3D polygon -*/ -//public boolean enclosesRectangle3D(double p1x1, double p1x2, double p2x1, double p2x2) -//{ -// GbPolygon3D p = GbSystem.clipPolygon3D(this.getPoints(), p1x1, p1x2, p2x1, p2x2); -// return(p!=null && GbSystem.equal(Math.abs(p.getArea()), Math.abs((p1x1-p2x1)*(p1x2-p2x2)))); -//} - -/* -* Returns true if the specified 3D rectangle is crossed by this 3D polygon. -* @param rectangle the 3D rectangle to check -* @return true if the specified 3D rectangle is crossed by this 3D polygon -*/ -//public boolean crossesRectangle3D(GbRectangle3D rectangle) -//{ -// GbPolygon3D p = GbSystem.clipPolygon3D(this.getPoints(), rectangle.p1.x1, rectangle.p1.x2, rectangle.p2.x1, rectangle.p2.x2); -// return(p!=null && GbSystem.inOpenInterval(Math.abs(p.getArea()), 0.0, rectangle.getArea())); -//} -/* -* Returns true if the specified 3D rectangle is crossed by this 3D polygon. -* @param p1 the 1st point of the rectangle to check -* @param p2 the 2nd point of the rectangle to check -* @return true if the specified 3D rectangle is crossed by this 3D polygon -*/ -//public boolean crossesRectangle3D(GbPoint3D p1, GbPoint3D p2) -//{ -// GbPolygon3D p = GbSystem.clipPolygon3D(this.getPoints(), p1.x1, p1.x2, p2.x1, p2.x2); -// return(p!=null && GbSystem.inOpenInterval(Math.abs(p.getArea()), 0.0, Math.abs((p1.x1-p2.x1)*(p1.x2-p2.x2)))); -//} -/* -* Returns true if the specified 3D rectangle is crossed by this 3D polygon. -* @param p1x1 the 1st x1 coordinate of the rectangle to check -* @param p1x2 the 1st x2 coordinate of the rectangle to check -* @param p2x1 the 2nd x1 coordinate of the rectangle to check -* @param p2x2 the 2nd x2 coordinate of the rectangle to check -* @return true if the specified 3D rectangle is crossed by this 3D polygon -*/ -//public boolean crossesRectangle3D(double p1x1, double p1x2, double p2x1, double p2x2) -//{ -// GbPolygon3D p = GbSystem.clipPolygon3D(this.getPoints(), p1x1, p1x2, p2x1, p2x2); -// return(p!=null && GbSystem.inOpenInterval(Math.abs(p.getArea()), 0.0, Math.abs((p1x1-p2x1)*(p1x2-p2x2)))); -//} - -/* -* Returns true if the specified 3D rectangle lies (at least partly) within this 3D polygon. -* @param rectangle the 3D rectangle to check -* @return true if the specified 3D rectangle lies (at least partly) within this 3D polygon -*/ -//public boolean enclosesOrCrossesRectangle3D(GbRectangle3D rectangle) -//{ -// GbPolygon3D p = GbSystem.clipPolygon3D(this.getPoints(), rectangle.p1.x1, rectangle.p1.x2, rectangle.p2.x1, rectangle.p2.x2); -// return(p!=null && GbSystem.greater(Math.abs(p.getArea()), 0.0)); -//} -/* -* Returns true if the specified 3D rectangle lies (at least partly) within this 3D polygon. -* @param p1 the 1st point of the rectangle to check -* @param p2 the 2nd point of the rectangle to check -* @return true if the specified 3D rectangle lies (at least partly) within this 3D polygon -*/ -//public boolean enclosesOrCrossesRectangle3D(GbPoint3D p1, GbPoint3D p2) -//{ -// GbPolygon3D p = GbSystem.clipPolygon3D(this.getPoints(), p1.x1, p1.x2, p2.x1, p2.x2); -// return(p!=null && GbSystem.greater(Math.abs(p.getArea()), 0.0)); -//} -/* -* Returns true if the specified 3D rectangle lies (at least partly) within this 3D polygon. -* @param p1x1 the 1st x1 coordinate of the rectangle to check -* @param p1x2 the 1st x2 coordinate of the rectangle to check -* @param p2x1 the 2nd x1 coordinate of the rectangle to check -* @param p2x2 the 2nd x2 coordinate of the rectangle to check -* @return true if the specified 3D rectangle lies (at least partly) within this 3D polygon -*/ -//public boolean enclosesOrCrossesRectangle3D(double p1x1, double p1x2, double p2x1, double p2x2) -//{ -// GbPolygon3D p = GbSystem.clipPolygon3D(this.getPoints(), p1x1, p1x2, p2x1, p2x2); -// return(p!=null && GbSystem.greater(Math.abs(p.getArea()), 0.0)); -//} -/*======================================================================*/ - -void GbPolygon3D::calculateValues() -{ - this->x1s = 0.0; - this->x2s = 0.0; - this->x3s = 0.0; - this->x1min = 0.0; - this->x1max = 0.0; - this->x2min = 0.0; - this->x2max = 0.0; - this->x3min = 0.0; - this->x3max = 0.0; - throw UbException(UB_EXARGS,"should be implemented"); - - //this->consistent = true; - - //this->points = this->ps->getPoints(); - - //int n = (int)this->points.size(); - //if(n < 1) return; - - //GbPoint3D p1 = (this->points)[0]; - //GbPoint3D p2 = NULL; - //double h1 = 0.0; - //double h2 = 0.0; - //double f=0.0; - - //this->x1s = p1.x1; - //this->x1min = p1.x1; - //this->x1max = p1.x1; - //this->x2s = p1.x2; - //this->x2min = p1.x2; - //this->x2max = p1.x2; - //this->x3s = p1.x2; - //this->x3min = p1.x2; - //this->x3max = p1.x2; - - //std::cout<<"Should be implemented "<<endl; - - //for(int i=1; i<n; i++) - //{ - // p2 = (this->points)[i]; - // f = p1.x1*p2.x2 - p1.x2*p2.x1; - // this->area += f; - // h1 += f*(p1.x2 + p2.x2); - // h2 += f*(p1.x1 + p2.x1); - // p1 = p2; - - // if(p1.x1 < this->x1min) this->x1min = p1.x1; - // if(p1.x1 > this->x1max) this->x1max = p1.x1; - // if(p1.x2 < this->x2min) this->x2min = p1.x2; - // if(p1.x2 > this->x2max) this->x2max = p1.x2; - //} - //p2 = (this->points)[0]; - //f = p1.x1*p2.x2 - p1.x2*p2.x1; - //this->area += f; - //h1 += f*(p1.x2 + p2.x2); - //h2 += f*(p1.x1 + p2.x1); - - //this->area *= 0.5; - //h1 /= 6.0; - //h2 /= 6.0; - - //if(n > 2) - //{ - // this->x1s = h2/this->area; - // this->x2s = h1/this->area; - //} - - //if(n < 3 || !GbSystem::inClosedInterval(this->x1s, this->x1min, this->x1max)) this->x1s = 0.5*(this->x1min+this->x1max); - //if(n < 3 || !GbSystem::inClosedInterval(this->x2s, this->x2min, this->x2max)) this->x2s = 0.5*(this->x2min+this->x2max); -} -/*======================================================================*/ - - -/*======================================================================*/ -// private class PointObserver implements TiObserver -// { -// GbPolygon3D polygon = null; - -// PointObserver(GbPolygon3D polygon) -// { -//this.polygon = polygon; -// } - -// public void objectChanged(Object object) -// { -//if((object instanceof GbPoint3D) && this.polygon.contains((GbPoint3D)object)>0) -//{ -// this.polygon.consistent = false; -// this.polygon.notifyObservers(); -//} -// } -// } -/*=======================================================*/ -void GbPolygon3D::write(UbFileOutput* out) -{ - throw UbException(UB_EXARGS,"not implemented"); -} -/*=======================================================*/ -void GbPolygon3D::read(UbFileInput* in) -{ - throw UbException(UB_EXARGS,"not implemented"); -} -/*=======================================================*/ - diff --git a/src/basics/numerics/geometry3d/GbPolygon3D.h b/src/basics/numerics/geometry3d/GbPolygon3D.h deleted file mode 100644 index 736913caf73e76f6d64ef686c98be779a9365ab7..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/GbPolygon3D.h +++ /dev/null @@ -1,533 +0,0 @@ -// _ ___ __ __________ _ __ -// | | / (_)____/ /___ ______ _/ / ____/ /_ __(_)___/ /____ -// | | / / / ___/ __/ / / / __ `/ / /_ / / / / / / __ / ___/ -// | |/ / / / / /_/ /_/ / /_/ / / __/ / / /_/ / / /_/ (__ ) -// |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/ -// -#ifndef GBPOLYGON3D_H -#define GBPOLYGON3D_H - -#include <sstream> -#include <iostream> - - -#include <numerics/geometry3d/GbObject3D.h> -#include <numerics/geometry3d/GbLine3D.h> -#include <numerics/geometry3d/GbTriangle3D.h> -#include <numerics/geometry3d/GbSystem3D.h> - -#include <PointerDefinitions.h> - -class GbObject3DCreator; - -/*=========================================================================*/ -/* GbPolygon2D */ -/* */ -/* -* This Class provides basic 3D polygon objects. -*/ -class GbPolygon3D : public GbObject3D -{ -public: - using GbObject3D::isPointInGbObject3D; //Grund: dadurch muss man hier isPointInGbObject3D(GbPoint3D*) nicht ausprogrammieren, welche sonst hier "ueberdeckt" waere -private: - /*======================================================================*/ - double x1s ; - double x2s ; - double x3s ; - double x1min; - double x1max; - double x2min; - double x2max; - double x3min; - double x3max; - - std::vector<GbPoint3D> points; - bool consistent; - - GbSystem3D::PointSet3 *ps; - //private PointObserver po = null; - - void init(); - - /*======================================================================*/ - - - /*======================================================================*/ - /* Konstruktoren */ - /* */ - /* - * Creates an empty 2D polygon. - */ -public: - static int counter; - GbPolygon3D(); - /* - * Creates an empty 2D polygon with the specified capacity. - * @param capacity the initial capacity - */ - GbPolygon3D(int capacity); - /* - * Creates a 2D polygon with the specified points. - * @param points the initial points of the polygon - */ - GbPolygon3D(std::vector<GbPoint3D> &points); - /* - * Creates a 2D polygon as clone of the specified 2D polygon. - * @param polygon the 2D polygon to be cloned - */ - GbPolygon3D(GbPolygon3D *polygon); - - ~GbPolygon3D(); - - /*======================================================================*/ - - - /*======================================================================*/ - /* Methoden */ - /* */ - /* - * Creates a 2D polygon as clone of this 2D polygon. - */ - GbPolygon3D* clone() { return(new GbPolygon3D(this)); } - void finalize() - { - throw UbException(UB_EXARGS,"toDo"); - } - - /* - * Returns the number of points. - * @return the number of points - */ - int size(); - /* - * Returns the number of times this 2D polygon contains the specified point. - * @param point the point - * @return the number of times this 2D polygon contains the specified point - */ - int contains(GbPoint3D *point); - /* - * Returns the number of times this 2D polygon contains a point equal to the specified point. - * @param point the point - * @return the number of times this 2D polygon contains a point equal to the specified point - */ - int containsEqual(GbPoint3D* point); - /* - * Returns true, if this 2D polygon contains the specified line. - * @param point1 the first point - * @param point2 the second point - * @return true, if this 2D polygon contains the specified line - */ - bool containsLine(GbPoint3D* point1, GbPoint3D* point2); - /* - * Returns true, if this 2D polygon contains the specified line. - * @param line the line - * @return true, if this 2D polygon contains the specified line - */ - bool containsLine(GbLine3D* line); - /* - * Returns the first point. - * @return the first point - */ - GbPoint3D* getFirstPoint(); - /* - * Returns the last point. - * @return the last point - */ - GbPoint3D* getLastPoint(); - /* - * Returns the specified point. - * @param index the index - * @return the specified point - * @exception ArrayIndexOutOfBoundsException if the specified index is not valid - */ - GbPoint3D* getPoint(const int& index); - /* - * Returns the points. - * @return the points - */ - std::vector<GbPoint3D> getPoints(); - /* - * Returns the points within the specified rectangle. - * @param rectangle the 2D rectangle - * @return the points within the specified rectangle - */ - //public GbPoint2D[] getPoints(GbRectangle2D rectangle) - //{ - // return(this.getPoints(rectangle.p1.x1, rectangle.p1.x2, rectangle.p2.x1, rectangle.p2.x2)); - //} - /* - * Returns the points within the specified rectangle. - * @param p1 the 1st point of the rectangle - * @param p2 the 2nd point of the rectangle - * @return the points within the specified rectangle - */ - std::vector<GbPoint3D> getPoints(GbPoint3D* p1, GbPoint3D* p2); - /* - * Returns the points within the specified rectangle. - * @param p1x1 the 1st x1 coordinate of the rectangle - * @param p1x2 the 1st x2 coordinate of the rectangle - * @param p2x1 the 2nd x1 coordinate of the rectangle - * @param p2x2 the 2nd x2 coordinate of the rectangle - * @return the points within the specified rectangle - */ - std::vector<GbPoint3D> getPoints(const double& p1x1, const double& p1x2, const double& p1x3, const double& p2x1, const double& p2x2, const double& p2x3); - /* - * Returns the area of this polygon. - * The area is positive for positive ordered points, otherwise negative. - * @return the area of this polygon - */ - //double getArea() - //{ - // if(!this.consistent) this.calculateValues(); - // return(this.area); - //} - double getX1Centroid(); - double getX1Minimum(); - double getX1Maximum(); - double getX2Centroid(); - double getX2Minimum(); - double getX2Maximum(); - double getX3Centroid(); - double getX3Minimum(); - double getX3Maximum(); - - /* - * Adds a point to the end of this polygon. Notifies the observers of this 2D polygon. - * @param point the point - */ - void addPoint(GbPoint3D* point); - /* - * Adds a number of points to the end of this polygon. Notifies the observers of this 2D polygon. - * @param points the points - */ - void addPoints(std::vector<GbPoint3D>& points); - /* - * Inserts a point at the specified position within this polygon. Notifies the observers of this 2D polygon. - * @param point the point - * @param index the index - * @exception ArrayIndexOutOfBoundsException if the specified index is not valid - */ - //public void insertPoint(GbPoint2D point, int index) throws ArrayIndexOutOfBoundsException - //{ - // if((this instanceof GbPolygon3D) && !(point instanceof GbPoint3D)) throw new IllegalArgumentException("GbPolygon2D.insertPoint(): points of 3D polygons have to be 3D points!"); - // if(index < 0 || index > this.ps.size()) throw new ArrayIndexOutOfBoundsException("GbPolygon2D.insert(): invalid index specified: "+index); - - // this.ps.insert(point, index); - // point.addObserver(this.po); - // this.consistent = false; - // super.notifyObservers(); - //} - /* - * Removes all points from this polygon identical to the specified one. Notifies the observers of this 2D polygon. - * @param point the point - */ - //public void deletePoint(GbPoint2D point) - //{ - // this.ps.delete(point); - // point.removeObserver(this.po); - // this.consistent = false; - // super.notifyObservers(); - //} - /* - * Removes all points from this polygon equal to the specified one. Notifies the observers of this 2D polygon. - * @param point the point - */ - //public void deleteEqualPoint(GbPoint2D point) - //{ - // this.ps.deleteEqual(point); - // point.removeObserver(this.po); - // this.consistent = false; - // super.notifyObservers(); - //} - /* - * Removes all points from this polygon. Notifies the observers of this 2D polygon. - */ - void clear(); - - /* - * Returns true if this 2D polygon equals the specified object. - * Two polygon are equal, if their points are equal. - * <BR>Note that the order of points is recognized! - * @return true if this 2D polygon equals the specified object - * @see GbPoint2D#equals(java.lang.Object) - * @see GbPoint3D#equals(java.lang.Object) - */ - // bool equals(Object object) - // { - // try - // { - // GbPolygon2D polygon = (GbPolygon2D) object; - //int n = this.size(); - - //if(n != polygon.size()) return(false); - //for(int i=0; i<n; i++) if(!this.getPoint(i).equals(polygon.getPoint(i))) return(false); - //return(true); - // } - // catch(Exception e){ return(false); } - // } - std::vector<GbTriangle3D*> getSurfaceTriangleSet() - { - std::cout<<"GbPolygon3D::getSurfaceTriangleSet() - not implemented\n"; - std::vector<GbTriangle3D*> tmp; - return tmp; - } - bool isPointInGbObject3D(const double& x1, const double& x2, const double& x3) - { - throw UbException(__FILE__, __LINE__, "GbPolygon3D::isPointInObject3D- not implemented"); - } - bool isPointInGbObject3D(const double& x1, const double& x2, const double& x3, bool& pointIsOnBoundary) - { - throw UbException(__FILE__, __LINE__, "GbPolygon3D::isPointInObject3D- not implemented"); - } - bool isCellInsideGbObject3D(double x11,double x21,double x31,double x12,double x22,double x32) { return false; } - - GbLine3D* createClippedLine3D (GbPoint3D& point1, GbPoint3D &point2) - { - throw UbException(__FILE__, __LINE__, "GbPolygon3D::createClippedLine3D - not implemented"); - } -/* - * Returns a string representation of this 2D polygon. - * @return a string representation of this 2D polygon - */ - std::string toString(); - ObObjectCreator* getCreator(); - void write(UbFileOutput* out); - void read(UbFileInput* in); - /*======================================================================*/ - - - /*======================================================================*/ - /* Calculation */ - /* */ - /* - * Returns the intersection points of this 2D polygon and the specified 2D line. - * @param line the 2D line to intersect - * @return the intersection points of this 2D polygon and the specified 2D line - */ - // public GbPoint2D[] calculateIntersectionPoints2D(GbLine2D line) - // { - // GbSystem.PointSet pointSet = new GbSystem.PointSet(0); - // GbPoint2D points[] = this.getPoints(); - // GbPoint2D pCrossed = null; - // int n = points.length; - // if(n < 2) return(pointSet.getPoints()); - - // for(int i=1; i<n; i++) - // { - //pCrossed = GbSystem.calculateIntersectionPoint2D(points[i-1], points[i], line.p1, line.p2); - //if(pCrossed != null) pointSet.add(pCrossed); - // } - // pCrossed = GbSystem.calculateIntersectionPoint2D(points[n-1], points[0], line.p1, line.p2); - // if(pCrossed != null) pointSet.add(pCrossed); - - // return(pointSet.getPoints()); - // } - - /* - * Returns true if the specified 2D point lies within (or on the border of) this 2D polygon. - * @param point the 2D point to check - * @return true if the specified 2D point lies within (or on the border of) this 2D polygon - */ - // public boolean enclosesPoint2D(GbPoint2D point) - // { - // if(GbSystem.less(point.x1, this.x1min)) return(false); - // if(GbSystem.less(point.x2, this.x2min)) return(false); - // if(GbSystem.greater(point.x1, this.x1max)) return(false); - // if(GbSystem.greater(point.x2, this.x2max)) return(false); - // if(this.containsEqual(point) > 0) return(true); - - // QbList ltest = new QbList(GbPoint2D.class, QbList.NOEQUALOBJECTS); - // GbPoint2D points[] = this.getPoints(); - // GbPoint2D ptest; - // int n = points.length; - // if(n < 2) return(false); - - // if(GbSystem.equal(point.x2, this.x2min)) ptest = new GbPoint2D(point.x1, this.x2min-1.0); - // else ptest = new GbPoint2D(point.x1, this.x2max+1.0); - - // for(int i=1; i<n; i++) - // { - //try { ltest.append(GbSystem.calculateIntersectionPoint2D(points[i-1], points[i], point, ptest)); } - //catch(Exception e){} - // } - // try { ltest.append(GbSystem.calculateIntersectionPoint2D(points[n-1], points[0], point, ptest)); } - // catch(Exception e){} - // return((ltest.size()%2)==1); - // } - - /* - * Returns a new 2D polygon clipped by the specified 2D rectangle (result may be null!). - * @param rectangle the 2D rectangle - * @return a new 2D polygon clipped by the specified 2D rectangle - */ - // GbPolygon3D *createClippedPolygon3D(GbCuboid3D *cube) - // { - //return(GbSystem::clipPolygon3D(this->getPoints(), cube->p1->x1, cube->p1->x2, cube->p1->x3, , cube->p2->x1, cube->p2->x2, cube->p2->x3)); - // }; - /* - * Returns a new 2D polygon clipped by the specified 2D rectangle (result may be null!). - * @param p1 the 1st point of the rectangle - * @param p2 the 2nd point of the rectangle - * @return a new 2D polygon clipped by the specified 2D rectangle - */ - // GbPolygon3D *createClippedPolygon2D(GbPoint3D *p1, GbPoint3D *p2) - // { - //return(GbSystem::clipPolygon3D(this->getPoints(), p1->x1, p1->x2, p1->x3, p2->x1, p2->x2, p2->x3)); - // }; - /* - * Returns a new 2D polygon clipped by the specified 2D rectangle (result may be null!). - * @param p1x1 the 1st x1 coordinate of the rectangle - * @param p1x2 the 1st x2 coordinate of the rectangle - * @param p2x1 the 2nd x1 coordinate of the rectangle - * @param p2x2 the 2nd x2 coordinate of the rectangle - * @return a new 2D polygon clipped by the specified 2D rectangle - */ - // GbPolygon3D *createClippedPolygon3D(double p1x1, double p1x2, double p1x3, double p2x1, double p2x2, double p2x3) - // { - //return(GbSystem::clipPolygon3D(this.getPoints(), p1x1, p1x2, p1x3, p2x1, p2x2. p2x3)); - // }; - - /* - * Returns true if the specified 2D rectangle lies completely within this 2D polygon. - * @param rectangle the 2D rectangle to check - * @return true if the specified 2D rectangle lies completely within this 2D polygon - */ - //public boolean enclosesRectangle2D(GbRectangle2D rectangle) - //{ - // GbPolygon2D p = GbSystem.clipPolygon2D(this.getPoints(), rectangle.p1.x1, rectangle.p1.x2, rectangle.p2.x1, rectangle.p2.x2); - // return(p!=null && GbSystem.equal(Math.abs(p.getArea()), rectangle.getArea())); - //} - /* - * Returns true if the specified 2D rectangle lies completely within this 2D polygon. - * @param p1 the 1st point of the rectangle to check - * @param p2 the 2nd point of the rectangle to check - * @return true if the specified 2D rectangle lies completely within this 2D polygon - */ - //public boolean enclosesRectangle2D(GbPoint2D p1, GbPoint2D p2) - //{ - // GbPolygon2D p = GbSystem.clipPolygon2D(this.getPoints(), p1.x1, p1.x2, p2.x1, p2.x2); - // return(p!=null && GbSystem.equal(Math.abs(p.getArea()), Math.abs((p1.x1-p2.x1)*(p1.x2-p2.x2)))); - //} - /* - * Returns true if the specified 2D rectangle lies completely within this 2D polygon. - * @param p1x1 the 1st x1 coordinate of the rectangle to check - * @param p1x2 the 1st x2 coordinate of the rectangle to check - * @param p2x1 the 2nd x1 coordinate of the rectangle to check - * @param p2x2 the 2nd x2 coordinate of the rectangle to check - * @return true if the specified 2D rectangle lies completely within this 2D polygon - */ - //public boolean enclosesRectangle2D(double p1x1, double p1x2, double p2x1, double p2x2) - //{ - // GbPolygon2D p = GbSystem.clipPolygon2D(this.getPoints(), p1x1, p1x2, p2x1, p2x2); - // return(p!=null && GbSystem.equal(Math.abs(p.getArea()), Math.abs((p1x1-p2x1)*(p1x2-p2x2)))); - //} - - /* - * Returns true if the specified 2D rectangle is crossed by this 2D polygon. - * @param rectangle the 2D rectangle to check - * @return true if the specified 2D rectangle is crossed by this 2D polygon - */ - //public boolean crossesRectangle2D(GbRectangle2D rectangle) - //{ - // GbPolygon2D p = GbSystem.clipPolygon2D(this.getPoints(), rectangle.p1.x1, rectangle.p1.x2, rectangle.p2.x1, rectangle.p2.x2); - // return(p!=null && GbSystem.inOpenInterval(Math.abs(p.getArea()), 0.0, rectangle.getArea())); - //} - /* - * Returns true if the specified 2D rectangle is crossed by this 2D polygon. - * @param p1 the 1st point of the rectangle to check - * @param p2 the 2nd point of the rectangle to check - * @return true if the specified 2D rectangle is crossed by this 2D polygon - */ - //public boolean crossesRectangle2D(GbPoint2D p1, GbPoint2D p2) - //{ - // GbPolygon2D p = GbSystem.clipPolygon2D(this.getPoints(), p1.x1, p1.x2, p2.x1, p2.x2); - // return(p!=null && GbSystem.inOpenInterval(Math.abs(p.getArea()), 0.0, Math.abs((p1.x1-p2.x1)*(p1.x2-p2.x2)))); - //} - /* - * Returns true if the specified 2D rectangle is crossed by this 2D polygon. - * @param p1x1 the 1st x1 coordinate of the rectangle to check - * @param p1x2 the 1st x2 coordinate of the rectangle to check - * @param p2x1 the 2nd x1 coordinate of the rectangle to check - * @param p2x2 the 2nd x2 coordinate of the rectangle to check - * @return true if the specified 2D rectangle is crossed by this 2D polygon - */ - //public boolean crossesRectangle2D(double p1x1, double p1x2, double p2x1, double p2x2) - //{ - // GbPolygon2D p = GbSystem.clipPolygon2D(this.getPoints(), p1x1, p1x2, p2x1, p2x2); - // return(p!=null && GbSystem.inOpenInterval(Math.abs(p.getArea()), 0.0, Math.abs((p1x1-p2x1)*(p1x2-p2x2)))); - //} - - /* - * Returns true if the specified 2D rectangle lies (at least partly) within this 2D polygon. - * @param rectangle the 2D rectangle to check - * @return true if the specified 2D rectangle lies (at least partly) within this 2D polygon - */ - //public boolean enclosesOrCrossesRectangle2D(GbRectangle2D rectangle) - //{ - // GbPolygon2D p = GbSystem.clipPolygon2D(this.getPoints(), rectangle.p1.x1, rectangle.p1.x2, rectangle.p2.x1, rectangle.p2.x2); - // return(p!=null && GbSystem.greater(Math.abs(p.getArea()), 0.0)); - //} - /* - * Returns true if the specified 2D rectangle lies (at least partly) within this 2D polygon. - * @param p1 the 1st point of the rectangle to check - * @param p2 the 2nd point of the rectangle to check - * @return true if the specified 2D rectangle lies (at least partly) within this 2D polygon - */ - //public boolean enclosesOrCrossesRectangle2D(GbPoint2D p1, GbPoint2D p2) - //{ - // GbPolygon2D p = GbSystem.clipPolygon2D(this.getPoints(), p1.x1, p1.x2, p2.x1, p2.x2); - // return(p!=null && GbSystem.greater(Math.abs(p.getArea()), 0.0)); - //} - /* - * Returns true if the specified 2D rectangle lies (at least partly) within this 2D polygon. - * @param p1x1 the 1st x1 coordinate of the rectangle to check - * @param p1x2 the 1st x2 coordinate of the rectangle to check - * @param p2x1 the 2nd x1 coordinate of the rectangle to check - * @param p2x2 the 2nd x2 coordinate of the rectangle to check - * @return true if the specified 2D rectangle lies (at least partly) within this 2D polygon - */ - //public boolean enclosesOrCrossesRectangle2D(double p1x1, double p1x2, double p2x1, double p2x2) - //{ - // GbPolygon2D p = GbSystem.clipPolygon2D(this.getPoints(), p1x1, p1x2, p2x1, p2x2); - // return(p!=null && GbSystem.greater(Math.abs(p.getArea()), 0.0)); - //} - /*======================================================================*/ - - - /*======================================================================*/ - /* Private Methoden */ - /* */ - void calculateValues(); - /*======================================================================*/ - - - /*======================================================================*/ - // private class PointObserver implements TiObserver - // { - // GbPolygon2D polygon = null; - - // PointObserver(GbPolygon2D polygon) - // { - //this.polygon = polygon; - // } - - // public void objectChanged(Object object) - // { - //if((object instanceof GbPoint2D) && this.polygon.contains((GbPoint2D)object)>0) - //{ - // this.polygon.consistent = false; - // this.polygon.notifyObservers(); - //} - // } - // } - /*======================================================================*/ -}; -/*=========================================================================*/ -#endif - - - - - - diff --git a/src/basics/numerics/geometry3d/KdTree/examples/AdvancedPIOTests/CMakeLists.txt b/src/basics/numerics/geometry3d/KdTree/examples/AdvancedPIOTests/CMakeLists.txt deleted file mode 100644 index 77bce42648967f39ec63be5d35d5b93cf3fef400..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/KdTree/examples/AdvancedPIOTests/CMakeLists.txt +++ /dev/null @@ -1,39 +0,0 @@ -cmake_minimum_required(VERSION 2.6) - -PROJECT(kdtree_pioTest) - -################################################################# -# MACHINE_SPECIFIC CMAKE_CONFIG_FILE -################################################################# -INCLUDE("../../../../../CMake/CMakeCABMacros.txt") - -################################################################# -### PACKAGES ### -################################################################# -INCLUDE(${SOURCE_ROOT}/basics/utilities/CMakePackage.txt) -INCLUDE(${SOURCE_ROOT}/3rdParty/dirstream/CMakePackage.txt) - -INCLUDE(${SOURCE_ROOT}/basics/utilities/CMakePackage.txt) -INCLUDE(${SOURCE_ROOT}/basics/container/CMakePackage.txt) -INCLUDE(${SOURCE_ROOT}/basics/memory/CMakePackage.txt) -INCLUDE(${SOURCE_ROOT}/basics/objects/CMakePackage.txt) -INCLUDE(${SOURCE_ROOT}/basics/writer/CMakePackage.txt) - -INCLUDE(${SOURCE_ROOT}/numerics/geometry3d/CMakePackage.txt) -INCLUDE(${SOURCE_ROOT}/numerics/geometry3d/KdTree/CMakePackage.txt) -INCLUDE(${SOURCE_ROOT}/numerics/geometry3d/fem/CMakePackage.txt) -INCLUDE(${SOURCE_ROOT}/numerics/geometry3d/creator/CMakePackage.txt) - -################################################################# -### OWN DEFINES ### -################################################################# -FILE(GLOB SPECIFIC_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.h - ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp ) - -SET(ALL_SOURCES ${ALL_SOURCES} ${SPECIFIC_FILES}) -SOURCE_GROUP(z_main FILES ${SPECIFIC_FILES}) - -################################################################# -### PROJECT ERSTELLEN ### -################################################################# -CREATE_CAB_PROJECT(${PROJECT_NAME} BINARY) diff --git a/src/basics/numerics/geometry3d/KdTree/examples/AdvancedPIOTests/main.cpp b/src/basics/numerics/geometry3d/KdTree/examples/AdvancedPIOTests/main.cpp deleted file mode 100644 index e608f44c46ee511a29064836051c2755380e5f55..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/KdTree/examples/AdvancedPIOTests/main.cpp +++ /dev/null @@ -1,542 +0,0 @@ -#include <basics/utilities/UbTiming.h> -#include <basics/utilities/UbRandom.h> -#include <basics/utilities/UbTuple.h> - -#include <basics/writer/WbWriterAvsASCII.h> -#include <basics/writer/WbWriterAvsBinary.h> -#include <basics/writer/WbWriterVtkXmlBinary.h> -#include <basics/writer/WbWriterVtkXmlASCII.h> - -#include <basics/container/CbUniformMatrix3D.h> - -#include <numerics/geometry3d/GbTriFaceMesh3D.h> -#include <numerics/geometry3d/creator/GbTriFaceMesh3DCreator.h> -#include <numerics/geometry3d/GbHalfSpace3D.h> - -#include <numerics/geometry3d/KdTree/KdTree.h> -#include <numerics/geometry3d/KdTree/splitalgorithms/KdSpatiallMedianSplit.h> -#include <numerics/geometry3d/KdTree/splitalgorithms/KdSAHSplit.h> -#include <numerics/geometry3d/KdTree/intersectionhandler/KdCountLineIntersectionHandler.h> -#include <numerics/geometry3d/KdTree/intersectionhandler/KdCountRayIntersectionHandler.h> - -#include <stack> -#include <list> - -using namespace std; - -void createGrid(std::string meshfile, int maxNofPointsPerDir, Kd::SplitAlgorithm<float>& splitAlg, bool writeFiles = true, std::string outpath = "g:/temp"); -void recursiveGridFill(CbUniformMatrix3D<short>& grid, const short& xs, const short& ys, const short& zs, const short& type); -void iterativeGridFill(CbUniformMatrix3D<short>& grid, const short& xs, const short& ys, const short& zs, const short& type); - -#include <3rdParty/dirstream/dirstream.h> -#include <3rdParty/dirstream/filter_utils.h> // enthält die Definiton der bool'schen Ops für Filter - - -using namespace std; - -int main() -{ - try - { -// ////////////////////////////////////////////////////////////////////////// -// //STL File auswaehlen -// ////////////////////////////////////////////////////////////////////////// -// string pathname = "c:/temp"; -// string stlPath = "c:/temp"; -// dirstr::dirstream str(stlPath.c_str(), dirstr::op(dirstr::pattern_f("*.stl")) -// || dirstr::op(dirstr::pattern_f("*.ply")) || dirstr::op(dirstr::pattern_f("*.inp")) -// || dirstr::op(dirstr::pattern_f("*.mesh"))); -// -// // UbLog::setReportingLevel(logDEBUG5); -// UbLog::setReportingLevel(logINFO); -// -// vector<string> filenames; -// for(string entry; str >> entry;) -// { -// GbTriFaceMesh3D* mesh = GbTriFaceMesh3DCreator::getInstance()->readMeshFromFile(entry,"mesh"); -// -// string fn = UbSystem::getFilenameFromString(entry); -// mesh->writeMeshPly(pathname+"/"+fn+".ply"); -// -// delete mesh; -// } -// -// exit(0); - - //createGrid("c:/temp/clumps.stl", 200, Kd::SAHSplit<float>() , true, "g:/temp"); - //createGrid("c:/temp/50spheres.inp", 200, Kd::SAHSplit<float>() , true, "g:/temp"); - //createGrid("c:/temp/Sphere5040.inp", 200, Kd::SAHSplit<float>() , true, "g:/temp"); - //createGrid("c:/temp/cooling_2.inp", 400, Kd::SAHSplit<float>() , true, "g:/temp"); - //createGrid("c:/temp/NDR-Konzertsaal.inp", 100, Kd::SAHSplit<float>() , true, "g:/temp"); - - //createGrid("c:/temp/Campus-Details-W3.inp", 200, Kd::SAHSplit<float>() , true, "g:/temp"); - //createGrid("c:/temp/Boein707.mesh", 100, Kd::SAHSplit<float>() , true, "g:/temp"); - - //createGrid("c:/temp/dolphin.mesh", 400, Kd::SAHSplit<float>() , true, "g:/temp"); - //createGrid("c:/temp/box.ply", 10, Kd::SAHSplit<float>() , true, "g:/temp"); - //createGrid("c:/temp/bodyRight.stl", 200, Kd::SAHSplit<float>() , true, "g:/temp"); - //createGrid("c:/temp/flamingo.mesh", 200, Kd::SAHSplit<float>() , true, "g:/temp"); - - //createGrid("c:/temp/torus.inp", 256, Kd::SAHSplit<float>() , true, "g:/temp"); - createGrid("c:/temp/xzx_dragon.stl", 512, Kd::SAHSplit<float>() , true, "g:/temp"); -// createGrid("c:/temp/bunny_ascii.ply", 256, Kd::SAHSplit<float>() , true, "g:/temp"); -// createGrid("c:/temp/dragon_ascii.ply", 256, Kd::SAHSplit<float>() , true, "g:/temp"); -// createGrid("c:/temp/budda_ascii.ply", 256, Kd::SAHSplit<float>() , true, "g:/temp"); - //createGridWithLines("c:/temp/box.ply", 10, Kd::SAHSplit<float>() , true, "g:/temp"); - -// createGrid("c:/temp/beatle.mesh",200, Kd::SAHSplit<float>(), true, "g:/temp"); -// createGrid("c:/temp/atrium-30000tri.inp",200, Kd::SAHSplit<float>(), true, "g:/temp"); -// createGrid("c:/temp/Buero.inp",200, Kd::SAHSplit<float>(), true, "g:/temp"); -// createGrid("c:/temp/office_space.inp",200, Kd::SAHSplit<float>(), true, "g:/temp"); - - //createGrid("d:/meshes/50spheres.inp",200, Kd::SAHSplit<float>(), true, "d:/temp"); - - //createGrid("c:/temp/torus.inp",200, Kd::SAHSplit<float>(), true, "g:/temp"); - //createGrid("c:/temp/bodyRight.stl", 200, Kd::SAHSplit<float>() , true, "g:/temp"); - - //createGrid("c:/temp/jetta.stl", 200, GbTriFaceMesh3D::KDTREE_SPATIALSPLIT , true, "g:/temp"); - //createGrid("c:/temp/jetta.stl", 200, Kd::SAHSplit<float>(), true, "g:/temp"); - //createGrid("c:/temp/VW_body.ply", 200, Kd::SAHSplit<float>() , true, "g:/temp"); - //createGrid("c:/temp/kugel.stl", 50, Kd::SAHSplit<float>() , true, "g:/temp"); - //createGrid("c:/temp/ship-2.mesh", 100, Kd::SAHSplit<float>() , true, "g:/temp/schiff2"); - } - catch(const std::exception& e) - { - UBLOG2( logERROR, std::cerr, "Caught exception:"); - UBLOG2( logERROR, std::cerr, "Type: " << typeid(e).name() ); - UBLOG2ML(logERROR, std::cerr, "What: " << e.what() ); - } - catch(...) - { - UBLOG2(logERROR, std::cerr, "unknown exception occurs in "<< UB_FUNCTION) - } -} - -namespace Flag -{ - const short UNDEF = 2; - const short SOLID = 1; - const short FLUID = 0; -} - -////////////////////////////////////////////////////////////////////// -void createGrid(std::string meshfile, int maxNofPointsPerDir, Kd::SplitAlgorithm<float>& splitAlg, bool writeFiles, std::string outpath) -{ - UbLog::setReportingLevel(logDEBUG5); - std::string filename = UbSystem::getFilenameFromString(meshfile); - - std::list< UbTuple<string, double> > timerVals; - UbTimer timer; - timer.start(); - GbTriFaceMesh3D* mesh = GbTriFaceMesh3DCreator::getInstance()->readMeshFromFile(meshfile,"mesh",GbTriFaceMesh3D::KDTREE_SAHPLIT); - timerVals.push_back( UbTuple<string, double>("mesh", timer.stop() ) ); - UBLOG( logINFO, "read mesh in "<<val<2>(timerVals.back())<<"s" ); - - timer.start(); - Kd::Tree<float> kdTree( *mesh, splitAlg ); - timerVals.push_back( UbTuple<string, double>("kdTree", timer.stop() ) ); - UBLOG( logINFO, "build tree in "<<val<2>(timerVals.back())<<"s" ); - - UBLOG(logINFO, "############################################################"); - UBLOG(logINFO, "nodes of TriFaceMesh....... "<<mesh->getNodes()->size() ); - UBLOG(logINFO, "triFaces of TriFaceMesh.... "<<mesh->getTriangles()->size() ); - UBLOG(logINFO, "triFace copies in KdTree... "<<kdTree.getNumOfTriFaces() ); - UBLOG(logINFO, "nodes of kdNodes of KdTree. "<<kdTree.getNumOfNodes() ); - UBLOG(logINFO, ""); - - ////////////////////////////////////////////////////////////////////////// - // Ausgangs 3-D_Feld erstellen - ////////////////////////////////////////////////////////////////////////// - const float percentOverLap = 0.05f; //=5% - const float maxLength = (1.0f+percentOverLap)*(float)UbMath::max( mesh->getLengthX1(), mesh->getLengthX2(), mesh->getLengthX3() ); - const float dx1 = maxLength/(maxNofPointsPerDir-1); - const float dx2 = dx1; - const float dx3 = dx1; - - const int nx1 = 1 + int( std::ceil(mesh->getLengthX1()*(1.0f+percentOverLap)/dx1)+0.5 ); - const int nx2 = 1 + int( std::ceil(mesh->getLengthX2()*(1.0f+percentOverLap)/dx2)+0.5 ); - const int nx3 = 1 + int( std::ceil(mesh->getLengthX3()*(1.0f+percentOverLap)/dx3)+0.5 ); - - CbUniformMatrix3D<short> solids(nx1,nx2,nx3,Flag::UNDEF); - - ////////////////////////////////////////////////////////////////////////// - // Knoten typisieren - ////////////////////////////////////////////////////////////////////////// - const float orgx1 = (float)( -0.5*percentOverLap*mesh->getLengthX1()+mesh->getX1Minimum() ); - const float orgx2 = (float)( -0.5*percentOverLap*mesh->getLengthX2()+mesh->getX2Minimum() ); - const float orgx3 = (float)( -0.5*percentOverLap*mesh->getLengthX3()+mesh->getX3Minimum() ); - - std::vector<GbTriFaceMesh3D::TriFace>& triFaces = *mesh->getTriangles(); - std::vector<GbTriFaceMesh3D::Vertex>& vertices = *mesh->getNodes(); - - float x1center = float( mesh->getX1Centroid() ); - float x2center = float( mesh->getX2Centroid() ); - float x3center = float( mesh->getX3Centroid() ); - - UBLOG( logINFO, "performing point-in-object(PIO)-tests"); - long counter1=0, counter2 = 0; - float x1w, x2w, x3w; - int x1Min, x2Min, x3Min, x1Max, x2Max, x3Max; - float einflussBereichKnoten_sq = dx1*dx1+dx2*dx2+dx3*dx3; - - timer.start(); - for(size_t t=0; t<triFaces.size(); t++) - { - GbTriFaceMesh3D::TriFace& triangle = triFaces[t]; - GbTriFaceMesh3D::Vertex& v1 = vertices[triangle.v1]; - GbTriFaceMesh3D::Vertex& v2 = vertices[triangle.v2]; - GbTriFaceMesh3D::Vertex& v3 = vertices[triangle.v3]; - - ////////////////////////////////////////////////////////////////////////// - // AABB riangle - ////////////////////////////////////////////////////////////////////////// - x1Min = /*UbMath::integerRounding*/( std::floor( ( UbMath::min( v1.x, v2.x, v3.x ) - orgx1) / dx1 ) ); - x2Min = /*UbMath::integerRounding*/( std::floor( ( UbMath::min( v1.y, v2.y, v3.y ) - orgx2) / dx2 ) ); - x3Min = /*UbMath::integerRounding*/( std::floor( ( UbMath::min( v1.z, v2.z, v3.z ) - orgx3) / dx3 ) ); - - x1Max = /*UbMath::integerRounding*/( std::ceil( ( UbMath::max( v1.x, v2.x, v3.x ) - orgx1) / dx1 ) ); - x2Max = /*UbMath::integerRounding*/( std::ceil( ( UbMath::max( v1.y, v2.y, v3.y ) - orgx2) / dx2 ) ); - x3Max = /*UbMath::integerRounding*/( std::ceil( ( UbMath::max( v1.z, v2.z, v3.z ) - orgx3) / dx3 ) ); - - GbHalfSpace3D halfSpace( v1.x, v1.y, v1.z, v2.x, v2.y, v2.z, v3.x, v3.y, v3.z ); - - for(int x3=x3Min; x3<=x3Max; x3++) - { - for(int x2=x2Min; x2<=x2Max; x2++) - { - for(int x1=x1Min; x1<=x1Max; x1++) - { - counter1++; - - short& solidVal = solids(x1,x2,x3); - - if( solidVal != Flag::UNDEF ) //doppeltes Testen vermeiden - { - continue; - } - - counter2++; - - //Weltkoords - x1w = orgx1+x1*dx1; - x2w = orgx2+x2*dx2; - x3w = orgx3+x3*dx3; - - float dist = (float)halfSpace.getDistance( x1w, x2w, x3w ); - if( UbMath::greater( dist, 0.0f) ) - { - continue; - } - if( UbMath::greater(dist*dist, einflussBereichKnoten_sq)) - { - continue; - } - - //eigentlicher PIO-Test - bool testFailed = true; - for(int i=0; i<100; i++ ) - { - Kd::Ray<float> ray( x1w, x2w, x3w //, 1, 0 ,0 ); - , ( x1w < x1center ? (float)UbRandom::rand(-1.0,-0.001, 10) : (float)UbRandom::rand(0.001, 1.0, 10) ) - , ( x2w < x2center ? (float)UbRandom::rand(-1.0,-0.001, 10) : (float)UbRandom::rand(0.001, 1.0, 10) ) - , ( x3w < x3center ? (float)UbRandom::rand(-1.0,-0.001, 10) : (float)UbRandom::rand(0.001, 1.0, 10) ) ); - - int iSec = kdTree.intersectRay( ray, Kd::CountRayIntersectionHandler<float>() ); - - if( iSec != Kd::Intersection::INTERSECT_EDGE ) //KEINE Kante getroffen - { - if(iSec == Kd::Intersection::ON_BOUNDARY ) - { - solidVal = Flag::SOLID; - } - else - { - solidVal = (iSec&1); //ungerade anzahl an schnitten --> drinnen - } - testFailed = false; - break; - } - else - { - UBLOG(logDEBUG3, "GbTriFaceMesh3D.isPointInGbObject3D.if - an edge was hit "); - } - } - if( testFailed ) throw UbException(UB_EXARGS, "ups, nach 100 Strahlen immer noch kein Ergebnis"); - } - } - } - } - timerVals.push_back( UbTuple<string, double>("PiO-Test", timer.stop() ) ); - UBLOG( logINFO,counter2 <<" point-in-object(PIO)-tests done in "<<val<2>(timerVals.back())<<"s" ); - UBLOG( logINFO,counter1-counter2 <<" point-in-object(PIO)-tests uebersprungen" ); - - ////////////////////////////////////////////////////////////////////////// - // FLOOD FILL - ////////////////////////////////////////////////////////////////////////// - - if( false) //using just one seed point - { - //FUELL - bool foundSeedPoint = false; - int seedPointSearchCounter = 0; - int seedX1 = Ub::inf; - int seedX2 = Ub::inf; - int seedX3 = Ub::inf; - - timer.start(); - for(size_t t=0; t<triFaces.size(); t++) - { - GbTriFaceMesh3D::TriFace& triangle = triFaces[t]; - - float& nx = triangle.nx; - float& ny = triangle.ny; - float& nz = triangle.nz; - - float cx1 = triangle.getX1Centroid(vertices); - float cx2 = triangle.getX2Centroid(vertices); - float cx3 = triangle.getX3Centroid(vertices); - - for(int k=0; k<5; k++) - { - seedPointSearchCounter++; - - cx1 -= nx * dx1; - cx2 -= ny * dx2; - cx3 -= nz * dx3; - - int ix1 = UbMath::integerRounding( (cx1-orgx1)/dx1 ); - int ix2 = UbMath::integerRounding( (cx2-orgx2)/dx2 ); - int ix3 = UbMath::integerRounding( (cx3-orgx3)/dx3 ); - - if( solids.indicesInRange(ix1,ix2,ix3) - && solids(ix1, ix2, ix3 ) == Flag::UNDEF ) - { - x1w = orgx1+ix1*dx1; - x2w = orgx2+ix2*dx2; - x3w = orgx3+ix3*dx3; - - Kd::Ray<float> ray( x1w, x2w, x3w //, 1, 0 ,0 ); - , ( x1w < x1center ? (float)UbRandom::rand(-1.0,-0.001, 10) : (float)UbRandom::rand(0.001, 1.0, 10) ) - , ( x2w < x2center ? (float)UbRandom::rand(-1.0,-0.001, 10) : (float)UbRandom::rand(0.001, 1.0, 10) ) - , ( x3w < x3center ? (float)UbRandom::rand(-1.0,-0.001, 10) : (float)UbRandom::rand(0.001, 1.0, 10) ) ); - - int iSec = kdTree.intersectRay( ray, Kd::CountRayIntersectionHandler<float>() ); - - if( iSec>0 && (iSec&1) ) - { - seedX1 = ix1; - seedX2 = ix2; - seedX3 = ix3; - foundSeedPoint = true; - break; - } - } - } - if(foundSeedPoint) break; - } - if(!foundSeedPoint) - throw UbException(UB_EXARGS,"fuck no seed point found"); - timerVals.push_back( UbTuple<string, double>("Seed found in", timer.stop() ) ); - UBLOG( logINFO,"found seed Point in "<<val<2>(timerVals.back())<<"s with "<<seedPointSearchCounter << " tested points" ); - - cout<<nx1<<","<<nx2<<","<<nx3<<endl; - bool recursiveFloodFill = ( nx1*nx2*nx3 < 100*100*30 ); - if(recursiveFloodFill) - { - timer.start(); - recursiveGridFill(solids, seedX1, seedX2, seedX3, Flag::SOLID); - timerVals.push_back( UbTuple<string, double>("flood fill (r)", timer.stop() ) ); - UBLOG( logINFO,"recursive flood fill in "<<val<2>(timerVals.back())<<"s with "<<seedPointSearchCounter << " tested points" ); - - CbUniformMatrix3D<short> solidsCpy(solids); - timer.start(); - iterativeGridFill(solidsCpy, seedX1, seedX2, seedX3, Flag::SOLID); - timerVals.push_back( UbTuple<string, double>("flood fill (i)", timer.stop() ) ); - UBLOG( logINFO,"iterative flood fill in "<<val<2>(timerVals.back())<<"s with "<<seedPointSearchCounter << " tested points" ); - } - else - { - timer.start(); - iterativeGridFill(solids, seedX1, seedX2, seedX3, Flag::SOLID); - timerVals.push_back( UbTuple<string, double>("flood fill (r)", timer.stop() ) ); - UBLOG( logINFO,"recursive flood fill in "<<val<2>(timerVals.back())<<"s with "<<seedPointSearchCounter << " tested points" ); - } - - UBLOG(logINFO, "############################################################"); - - } - else //verifying complete arry - { - bool recursiveFloodFill = ( nx1*nx2*nx3 < 100*100*30 ); - int solidCounter = 0; - - timer.start(); - for(int x3=0; x3<solids.getNX3(); x3++) - for(int x2=0; x2<solids.getNX2(); x2++) - for(int x1=0; x1<solids.getNX1(); x1++) - { - if( solids(x1 ,x2 ,x3 ) == Flag::UNDEF ) - { - x1w = orgx1+x1*dx1; - x2w = orgx2+x2*dx2; - x3w = orgx3+x3*dx3; - - int iSec = -1; - do{ - Kd::Ray<float> ray( x1w, x2w, x3w //, 1, 0 ,0 ); - , ( x1w < x1center ? (float)UbRandom::rand(-1.0,-0.001, 10) : (float)UbRandom::rand(0.001, 1.0, 10) ) - , ( x2w < x2center ? (float)UbRandom::rand(-1.0,-0.001, 10) : (float)UbRandom::rand(0.001, 1.0, 10) ) - , ( x3w < x3center ? (float)UbRandom::rand(-1.0,-0.001, 10) : (float)UbRandom::rand(0.001, 1.0, 10) ) ); - - iSec = kdTree.intersectRay( ray, Kd::CountRayIntersectionHandler<float>() ); - }while(iSec<0); - - if( iSec&1 ) - { - if(recursiveFloodFill) recursiveGridFill(solids,x1,x2,x3,Flag::SOLID); - else iterativeGridFill(solids,x1,x2,x3,Flag::SOLID); - } - else - { - if(recursiveFloodFill) recursiveGridFill(solids,x1,x2,x3,Flag::FLUID); - else iterativeGridFill(solids,x1,x2,x3,Flag::FLUID); - } - } - } - if(recursiveFloodFill) timerVals.push_back( UbTuple<string, double>("flood fill (r)", timer.stop() ) ); - else timerVals.push_back( UbTuple<string, double>("flood fill (i)", timer.stop() ) ); - UBLOG( logINFO,"recursive flood fill in "<<val<2>(timerVals.back())<<"s " ); - } - - list< UbTuple< string, double > >::iterator iter; - for(iter = timerVals.begin(); iter!=timerVals.end(); ++iter) - { - UBLOG( logINFO, setw(16) << val<1>(*iter) << " in " << setw(8) << setprecision(8) << val<2>(*iter) << "s" ); - } - - int solidCounter = 0; - for(int x3=0; x3<solids.getNX3(); x3++) - for(int x2=0; x2<solids.getNX2(); x2++) - for(int x1=0; x1<solids.getNX1(); x1++) - { - if( solids(x1 ,x2 ,x3 ) == Flag::SOLID ) - { - solidCounter++; - } - } - - UBLOG( logINFO, "SOLIDS = " <<solidCounter); - UBLOG( logINFO, "SOLIDS = " <<solidCounter); - UBLOG( logINFO, "SOLIDS = " <<solidCounter); - UBLOG( logINFO, "SOLIDS = " <<solidCounter); - - /* ======================================================================================= */ - if(writeFiles) - { - UBLOG( logINFO, "writeFiles - start"); - string subfiledir = outpath+"/"+filename+"_solid_node_files"; - UbSystem::makeDirectory( subfiledir ); - - std::vector<UbTupleFloat3 > nodes; - std::vector<std::string > datanames(1,"data"); - datanames[0] = "solid"; - - std::vector< std::string > outFilenames; - - std::vector<std::vector<double > > nodedata( datanames.size() ); - - for(int x3=0; x3<solids.getNX3(); x3++) - for(int x2=0; x2<solids.getNX2(); x2++) - for(int x1=0; x1<solids.getNX1(); x1++) - { - if( solids(x1 ,x2 ,x3 ) == Flag::SOLID ) - { - nodes.push_back( makeUbTuple( orgx1+x1*dx1, orgx2+x2*dx2, orgx3+x3*dx3 ) ); - nodedata[0].push_back( solids(x1 ,x2 ,x3 ) ); - } - - if( nodes.size() > 2000000 - || ( x1==(solids.getNX1()-1) && x2==(solids.getNX2()-1) && x3==(solids.getNX3()-1) ) ) - { - outFilenames.push_back( WbWriterVtkXmlBinary::getInstance()->writeNodesWithNodeData(subfiledir+"/"+filename+"_solid_nodes_"+"_part"+UbSystem::toString(outFilenames.size()+1),nodes,datanames,nodedata) ); - nodes.clear(); - nodedata.clear(); - nodedata.resize( datanames.size() ); - } - } - - WbWriterVtkXmlBinary::getInstance()->writeCollection(outpath+"/"+filename+"_solids_nodes",outFilenames,0,false); - - - mesh->writeMesh(outpath+"/"+filename+"_mesh",WbWriterVtkXmlBinary::getInstance()); - kdTree.writeTree(outpath+"/"+filename+"_kdTree",WbWriterVtkXmlBinary::getInstance()); - - UBLOG( logINFO, "writeFiles - end") - } - - delete mesh; -} - -namespace Dirs -{ - const int X1[] = { 1, -1, 0, 0, 0, 0, 1, -1, 1, -1, 1, -1, 1, -1, 0, 0, 0, 0, 0 }; - const int X2[] = { 0, 0, 1, -1, 0, 0, 1, -1, -1, 1, 0, 0, 0, 0, 1, -1, 1, -1, 0 }; - const int X3[] = { 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 1, -1, -1, 1, 1, -1, -1, 1, 0 }; - - const int START = 0; - const int END6 = 5; - const int END18 = 17; -} -/*==================================================================*/ -bool floodFillCheck(CbUniformMatrix3D<short>& grid, const short& x, const short& y, const short& z) -{ - return grid.indicesInRange( x, y, z ) && grid(x,y,z)==Flag::UNDEF; -} -int g_counter = 0; -void recursiveGridFill(CbUniformMatrix3D<short>& grid, const short& xs, const short& ys, const short& zs, const short& type) -{ - // Algorithmus zum Füllen eines Polyeders, ausgehend vom Saatpunkt xs,ys,zs - - //Saatknoten einfärben - short& val = grid(xs,ys,zs); - if( val==Flag::UNDEF ) - { - val = type; - } - if( floodFillCheck( grid, xs+1, ys , zs ) ) recursiveGridFill( grid, xs+1, ys , zs , type ); - if( floodFillCheck( grid, xs , ys+1, zs ) ) recursiveGridFill( grid, xs , ys+1, zs , type ); - if( floodFillCheck( grid, xs , ys , zs+1 ) ) recursiveGridFill( grid, xs , ys , zs+1, type ); - if( floodFillCheck( grid, xs-1, ys , zs ) ) recursiveGridFill( grid, xs-1, ys , zs , type ); - if( floodFillCheck( grid, xs , ys-1, zs ) ) recursiveGridFill( grid, xs , ys-1, zs , type ); - if( floodFillCheck( grid, xs , ys , zs-1 ) ) recursiveGridFill( grid, xs , ys , zs-1, type ); -} -/*==================================================================*/ -void iterativeGridFill(CbUniformMatrix3D<short>& grid, const short& xs, const short& ys, const short& zs, const short& type) -{ - std::stack< UbTupleInt3 > stck; - stck.push( UbTupleInt3(xs,ys,zs) ); - - int x,y,z; - - while( !stck.empty() ) - { - x = val<1>( stck.top() ); - y = val<2>( stck.top() ); - z = val<3>( stck.top() ); - stck.pop(); - - short& flagType = grid( x, y, z ); - - if( flagType == Flag::UNDEF ) - { - flagType = type; - - if ( grid.indicesInRange( x+1, y , z ) ) stck.push( UbTupleInt3( x+1, y , z ) ); - if ( grid.indicesInRange( x , y+1, z ) ) stck.push( UbTupleInt3( x , y+1, z ) ); - if ( grid.indicesInRange( x , y , z+1 ) ) stck.push( UbTupleInt3( x , y , z+1 ) ); - if ( grid.indicesInRange( x-1, y , z ) ) stck.push( UbTupleInt3( x-1, y , z ) ); - if ( grid.indicesInRange( x , y-1, z ) ) stck.push( UbTupleInt3( x , y-1, z ) ); - if ( grid.indicesInRange( x , y , z-1 ) ) stck.push( UbTupleInt3( x , y , z-1 ) ); - } - } -} diff --git a/src/basics/numerics/geometry3d/KdTree/examples/PIOTests/CMakeLists.txt b/src/basics/numerics/geometry3d/KdTree/examples/PIOTests/CMakeLists.txt deleted file mode 100644 index c6c94204a94d60a54026531ae188a6be04508e2c..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/KdTree/examples/PIOTests/CMakeLists.txt +++ /dev/null @@ -1,36 +0,0 @@ -cmake_minimum_required(VERSION 2.6) - -PROJECT(kdtree_pioTest) - -################################################################# -# MACHINE_SPECIFIC CMAKE_CONFIG_FILE -################################################################# -INCLUDE("../../../../../CMake/CMakeCABMacros.txt") - -################################################################# -### PACKAGES ### -################################################################# -INCLUDE(${SOURCE_ROOT}/basics/utilities/CMakePackage.txt) -INCLUDE(${SOURCE_ROOT}/basics/container/CMakePackage.txt) -INCLUDE(${SOURCE_ROOT}/basics/memory/CMakePackage.txt) -INCLUDE(${SOURCE_ROOT}/basics/objects/CMakePackage.txt) -INCLUDE(${SOURCE_ROOT}/basics/writer/CMakePackage.txt) - -INCLUDE(${SOURCE_ROOT}/numerics/geometry3d/CMakePackage.txt) -INCLUDE(${SOURCE_ROOT}/numerics/geometry3d/KdTree/CMakePackage.txt) -INCLUDE(${SOURCE_ROOT}/numerics/geometry3d/fem/CMakePackage.txt) -INCLUDE(${SOURCE_ROOT}/numerics/geometry3d/creator/CMakePackage.txt) - -################################################################# -### OWN DEFINES ### -################################################################# -FILE(GLOB SPECIFIC_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.h - ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp ) - -SET(ALL_SOURCES ${ALL_SOURCES} ${SPECIFIC_FILES}) -SOURCE_GROUP(z_main FILES ${SPECIFIC_FILES}) - -################################################################# -### PROJECT ERSTELLEN ### -################################################################# -CREATE_CAB_PROJECT(${PROJECT_NAME} BINARY) diff --git a/src/basics/numerics/geometry3d/KdTree/examples/PIOTests/main.cpp b/src/basics/numerics/geometry3d/KdTree/examples/PIOTests/main.cpp deleted file mode 100644 index f24132c368b03497767f87be3927b6082ae20541..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/KdTree/examples/PIOTests/main.cpp +++ /dev/null @@ -1,342 +0,0 @@ -#include <basics/utilities/UbTiming.h> -#include <basics/utilities/UbRandom.h> - -#include <basics/writer/WbWriterAvsASCII.h> -#include <basics/writer/WbWriterAvsBinary.h> -#include <basics/writer/WbWriterVtkXmlBinary.h> -#include <basics/writer/WbWriterVtkXmlASCII.h> - -#include <basics/container/CbUniformMatrix4D.h> - -#include <numerics/geometry3d/GbTriFaceMesh3D.h> -#include <numerics/geometry3d/creator/GbTriFaceMesh3DCreator.h> - -#include <numerics/geometry3d/KdTree/KdTree.h> -#include <numerics/geometry3d/KdTree/splitalgorithms/KdSpatiallMedianSplit.h> -#include <numerics/geometry3d/KdTree/splitalgorithms/KdSAHSplit.h> -#include <numerics/geometry3d/KdTree/intersectionhandler/KdCountLineIntersectionHandler.h> -#include <numerics/geometry3d/KdTree/intersectionhandler/KdCountRayIntersectionHandler.h> - -using namespace std; - -void KdTreeTest (std::string meshfile, int maxNofPointsPerDir, GbTriFaceMesh3D::KDTREE_SPLITAGORITHM pio, bool writeFiles = true, std::string outpath = "g:/temp"); -void KdTreeTestWithLines(std::string meshfile, int maxNofPointsPerDir, GbTriFaceMesh3D::KDTREE_SPLITAGORITHM pio, bool writeFiles = true, std::string outpath = "g:/temp"); - -int main() -{ - try - { - //KdTreeTest("c:/temp/clumps.stl", 200, GbTriFaceMesh3D::KDTREE_SAHPLIT , true, "g:/temp"); - //KdTreeTest("c:/temp/50spheres.inp", 200, GbTriFaceMesh3D::KDTREE_SAHPLIT , true, "g:/temp"); - //KdTreeTest("c:/temp/Sphere5040.inp", 200, GbTriFaceMesh3D::KDTREE_SAHPLIT , true, "g:/temp"); - //KdTreeTest("c:/temp/cooling_2.inp", 400, GbTriFaceMesh3D::KDTREE_SAHPLIT , true, "g:/temp"); - //KdTreeTest("c:/temp/NDR-Konzertsaal.inp", 100, GbTriFaceMesh3D::KDTREE_SAHPLIT , true, "g:/temp"); - - //KdTreeTest("c:/temp/Campus-Details-W3.inp", 200, GbTriFaceMesh3D::KDTREE_SAHPLIT , true, "g:/temp"); - //KdTreeTest("c:/temp/Boein707.mesh", 100, GbTriFaceMesh3D::KDTREE_SAHPLIT , true, "g:/temp"); - - //KdTreeTest("c:/temp/dolphin.mesh", 400, GbTriFaceMesh3D::KDTREE_SAHPLIT , true, "g:/temp"); - //KdTreeTest("c:/temp/box.ply", 10, GbTriFaceMesh3D::KDTREE_SAHPLIT , true, "g:/temp"); - //KdTreeTest("c:/temp/bodyRight.stl", 200, GbTriFaceMesh3D::KDTREE_SAHPLIT , true, "g:/temp"); - //KdTreeTest("c:/temp/flamingo.mesh", 200, GbTriFaceMesh3D::KDTREE_SAHPLIT , true, "g:/temp"); - - //KdTreeTest("c:/temp/torus.inp", 200, GbTriFaceMesh3D::KDTREE_SAHPLIT , true, "g:/temp"); - //KdTreeTestWithLines("c:/temp/box.ply", 10, GbTriFaceMesh3D::KDTREE_SAHPLIT , true, "g:/temp"); - - KdTreeTest("c:/temp/doppelwandbox.ply", 100, GbTriFaceMesh3D::KDTREE_SPATIALSPLIT, true, "g:/temp"); - - //KdTreeTestWithLines("c:/temp/torus.inp", 200, GbTriFaceMesh3D::KDTREE_SAHPLIT, true, "g:/temp"); - - //KdTreeTestWithLines("c:/temp/bodyRight.stl", 200, GbTriFaceMesh3D::KDTREE_SAHPLIT , true, "g:/temp"); - - //KdTreeTest("c:/temp/jetta.stl", 200, GbTriFaceMesh3D::KDTREE_SPATIALSPLIT , true, "g:/temp"); - //KdTreeTest("c:/temp/jetta.stl", 200, GbTriFaceMesh3D::KDTREE_SAHPLIT, true, "g:/temp"); - //KdTreeTest("c:/temp/VW_body.ply", 200, GbTriFaceMesh3D::KDTREE_SAHPLIT , true, "g:/temp"); - //KdTreeTest("c:/temp/kugel.stl", 50, GbTriFaceMesh3D::KDTREE_SAHPLIT , true, "g:/temp"); - //KdTreeTest("c:/temp/ship-2.mesh", 100, GbTriFaceMesh3D::KDTREE_SAHPLIT , true, "g:/temp/schiff2"); - } - catch(const std::exception& e) - { - UBLOG2( logERROR, std::cerr, "Caught exception:"); - UBLOG2( logERROR, std::cerr, "Type: " << typeid(e).name() ); - UBLOG2ML(logERROR, std::cerr, "What: " << e.what() ); - } - catch(...) - { - UBLOG2(logERROR, std::cerr, "unknown exception occurs in "<< UB_FUNCTION) - } - - - - -} - -////////////////////////////////////////////////////////////////////// -void KdTreeTest(std::string meshfile, int maxNofPointsPerDir, GbTriFaceMesh3D::KDTREE_SPLITAGORITHM pio, bool writeFiles, std::string outpath) -{ - UbLog::setReportingLevel(logDEBUG5); - std::string filename = UbSystem::getFilenameFromString(meshfile); - - GbTriFaceMesh3D* mesh = GbTriFaceMesh3DCreator::getInstance()->readMeshFromFile(meshfile,"mesh",pio); - mesh->scale(10000,10000,10000); - //dummy test, damit der baum erstellt wird - mesh->isPointInGbObject3D(0,0,0); - - UBLOG(logINFO, "############################################################"); - UBLOG(logINFO, "nodes of TriFaceMesh....... "<<mesh->getNodes()->size() ); - UBLOG(logINFO, "triFaces of TriFaceMesh.... "<<mesh->getTriangles()->size() ); - UBLOG(logINFO, "triFace copies in KdTree... "<<mesh->getKdTree()->getNumOfTriFaces() ); - UBLOG(logINFO, "nodes of kdNodes of KdTree. "<<mesh->getKdTree()->getNumOfNodes() ); - UBLOG(logINFO, ""); - - - const float percentOverLap = 0.05f; //=5% - const float maxLength = (1.0f+percentOverLap)*UbMath::max( mesh->getLengthX1(), mesh->getLengthX2(), mesh->getLengthX3() ); - const float dx1 = maxLength/(maxNofPointsPerDir-1); - const float dx2 = dx1; - const float dx3 = dx1; - - const int nx1 = 1 + int( std::ceil(mesh->getLengthX1()*(1.0f+percentOverLap)/dx1)+0.5 ); - const int nx2 = 1 + int( std::ceil(mesh->getLengthX2()*(1.0f+percentOverLap)/dx2)+0.5 ); - const int nx3 = 1 + int( std::ceil(mesh->getLengthX3()*(1.0f+percentOverLap)/dx3)+0.5 ); - - CbUniformMatrix4D<int> solids(nx1,nx2,nx3,1,0); - - const float orgx1 = -0.5*percentOverLap*mesh->getLengthX1()+mesh->getX1Minimum(); - const float orgx2 = -0.5*percentOverLap*mesh->getLengthX2()+mesh->getX2Minimum(); - const float orgx3 = -0.5*percentOverLap*mesh->getLengthX3()+mesh->getX3Minimum(); - - const float outX1 = 2*mesh->getX1Maximum(); - const float outX2 = 0;//2*mesh->getX2Maximum(); - const float outX3 = 0;//2*mesh->getX3Maximum(); - - UBLOG( logINFO, "performing " << nx1*nx2*nx3 <<" point-in-object(PIO)-tests"); - UbTimer ff; - ff.start(); - for(int x3=0; x3<solids.getNX3(); x3++) - for(int x2=0; x2<solids.getNX2(); x2++) - for(int x1=0; x1<solids.getNX1(); x1++) - { - solids(x1,x2,x3,0) = mesh->isPointInGbObject3D(orgx1+x1*dx1, orgx2+x2*dx2, orgx3+x3*dx3); - } - UBLOG( logINFO, nx1*nx2*nx3 <<" point-in-object(PIO)-tests done in "<<ff.stop()<<"s" ); - UBLOG(logINFO, "############################################################"); - - - /* ======================================================================================= */ - if(writeFiles) - { - UBLOG( logINFO, "writeFiles - start"); - string subfiledir = outpath+"/"+filename+"_solid_node_files"; - UbSystem::makeDirectory( subfiledir ); - - std::vector<UbTupleFloat3 > nodes; - std::vector<std::string > datanames(solids.getNX4(),"data"); - datanames[0] = "solid"; - //datanames[1] = "solid"; - - std::vector< std::string > outFilenames; - - std::vector<std::vector<double > > nodedata( datanames.size() ); - for(int x3=0; x3<solids.getNX3(); x3++) - for(int x2=0; x2<solids.getNX2(); x2++) - for(int x1=0; x1<solids.getNX1(); x1++) - { - if( solids(x1 ,x2 ,x3 , 0) ) - { - nodes.push_back( makeUbTuple( orgx1+x1*dx1, orgx2+x2*dx2, orgx3+x3*dx3 ) ); - - for(int i=0; i<solids.getNX4(); i++) - { - nodedata[i].push_back( solids(x1 ,x2 ,x3 ,i) ); - } - } - - if( nodes.size() > 2000000 - || ( x1==(solids.getNX1()-1) && x2==(solids.getNX2()-1) && x3==(solids.getNX3()-1) ) ) - { - outFilenames.push_back( WbWriterVtkXmlBinary::getInstance()->writeNodesWithNodeData(subfiledir+"/"+filename+"_solid_nodes_"+"_part"+UbSystem::toString(outFilenames.size()+1),nodes,datanames,nodedata) ); - nodes.clear(); - nodedata.clear(); - nodedata.resize( datanames.size() ); - } - } - - WbWriterVtkXmlBinary::getInstance()->writeCollection(outpath+"/"+filename+"_solids_nodes",outFilenames,0,false); - - - mesh->writeMesh(outpath+"/"+filename+"_mesh",WbWriterVtkXmlBinary::getInstance(),true); - mesh->writeMesh(outpath+"/"+filename+"_mesh",WbWriterAvsASCII::getInstance(),true); - mesh->getKdTree()->writeTree(outpath+"/"+filename+"_kdTree",WbWriterVtkXmlBinary::getInstance()); - - UBLOG( logINFO, "writeFiles - end") - } -} - -////////////////////////////////////////////////////////////////////// -void KdTreeTestWithLines(std::string meshfile, int maxNofPointsPerDir, GbTriFaceMesh3D::KDTREE_SPLITAGORITHM pio, bool writeFiles, std::string outpath) -{ - UbLog::setReportingLevel(logDEBUG5); - std::string filename = UbSystem::getFilenameFromString(meshfile); - - GbTriFaceMesh3D* mesh = GbTriFaceMesh3DCreator::getInstance()->readMeshFromFile(meshfile,"mesh",pio); - - //dummy test, damit der baum erstellt wird - mesh->isPointInGbObject3D(0,0,0); - - UBLOG(logINFO, "############################################################"); - UBLOG(logINFO, "nodes of TriFaceMesh....... "<<mesh->getNodes()->size() ); - UBLOG(logINFO, "triFaces of TriFaceMesh.... "<<mesh->getTriangles()->size() ); - UBLOG(logINFO, "triFace copies in KdTree... "<<mesh->getKdTree()->getNumOfTriFaces() ); - UBLOG(logINFO, "nodes of kdNodes of KdTree. "<<mesh->getKdTree()->getNumOfNodes() ); - UBLOG(logINFO, ""); - - - const float percentOverLap = 0.05f; //=5% - const float maxLength = (1.0f+percentOverLap)*UbMath::max( mesh->getLengthX1(), mesh->getLengthX2(), mesh->getLengthX3() ); - const float dx1 = maxLength/(maxNofPointsPerDir-1); - const float dx2 = dx1; - const float dx3 = dx1; - - const int nx1 = 1 + /*UbMath::integerRounding*/( std::ceil(mesh->getLengthX1()*(1.0f+percentOverLap)/dx1) ); - const int nx2 = 1 + /*UbMath::integerRounding*/( std::ceil(mesh->getLengthX2()*(1.0f+percentOverLap)/dx2) ); - const int nx3 = 1 + /*UbMath::integerRounding*/( std::ceil(mesh->getLengthX3()*(1.0f+percentOverLap)/dx3) ); - - CbUniformMatrix4D<int> solids(nx1,nx2,nx3,2,0); - - const float orgx1 = -0.5*percentOverLap*mesh->getLengthX1()+mesh->getX1Minimum(); - const float orgx2 = -0.5*percentOverLap*mesh->getLengthX2()+mesh->getX2Minimum(); - const float orgx3 = -0.5*percentOverLap*mesh->getLengthX3()+mesh->getX3Minimum(); - -// const float outX1 = 2*mesh->getX1Maximum(); -// const float outX2 = 2*mesh->getX2Maximum(); -// const float outX3 = 2*mesh->getX3Maximum(); - - - Kd::Tree<double>* kdTree = mesh->getKdTree(); - - std::vector<GbTriFaceMesh3D::TriFace>& triFaces = *mesh->getTriangles(); - std::vector<GbTriFaceMesh3D::Vertex>& vertices = *mesh->getNodes(); - - float x1center = float( mesh->getX1Centroid() ); - float x2center = float( mesh->getX2Centroid() ); - float x3center = float( mesh->getX3Centroid() ); - - UBLOG( logINFO, "performing point-in-object(PIO)-tests"); - UbTimer ff; - ff.start(); - long counter1=0, counter2 = 0; - for(size_t t=0; t<triFaces.size(); t++) - { - int x1Min = /*UbMath::integerRounding*/( std::floor( (triFaces[t].getMinX(vertices)-orgx1) / dx1 ) ); - int x2Min = /*UbMath::integerRounding*/( std::floor( (triFaces[t].getMinY(vertices)-orgx2) / dx2 ) ); - int x3Min = /*UbMath::integerRounding*/( std::floor( (triFaces[t].getMinZ(vertices)-orgx3) / dx3 ) ); - - int x1Max = /*UbMath::integerRounding*/( std::ceil( (triFaces[t].getMaxX(vertices)-orgx1) / dx1 ) ); - int x2Max = /*UbMath::integerRounding*/( std::ceil( (triFaces[t].getMaxY(vertices)-orgx2) / dx2 ) ); - int x3Max = /*UbMath::integerRounding*/( std::ceil( (triFaces[t].getMaxZ(vertices)-orgx3) / dx3 ) ); - - for(int x3=x3Min; x3<=x3Max; x3++) - for(int x2=x2Min; x2<=x2Max; x2++) - for(int x1=x1Min; x1<=x1Max; x1++) - { - counter1++; - - if( !solids.indicesInRange(x1,x2,x3,0) - || solids(x1,x2,x3,1) == 1 ) //doppeltes Testeb vermeiden - { - continue; - } - - counter2++; - - double x1w = orgx1+x1*dx1; - double x2w = orgx2+x2*dx2; - double x3w = orgx3+x3*dx3; - - //eigentlicher PIO-Test - bool testFailed = true; - for(int i=0; i<100; i++) - { - UbTupleDouble3 n1(x1w, x2w, x3w); - UbTupleDouble3 n2( double( x1w < x1center ? mesh->getX1Minimum()-UbRandom::rand(0.5, 1.0, 10)*mesh->getLengthX1() : mesh->getX1Maximum()+UbRandom::rand(0.5, 1.0, 10)*mesh->getLengthX1() ) - , double( x2w < x2center ? mesh->getX2Minimum()-UbRandom::rand(0.5, 1.0, 10)*mesh->getLengthX2() : mesh->getX2Maximum()+UbRandom::rand(0.5, 1.0, 10)*mesh->getLengthX2() ) - , double( x3w < x3center ? mesh->getX3Minimum()-UbRandom::rand(0.5, 1.0, 10)*mesh->getLengthX3() : mesh->getX3Maximum()+UbRandom::rand(0.5, 1.0, 10)*mesh->getLengthX3() ) ); - - int iSec = kdTree->intersectLine( n1, n2, Kd::CountLineIntersectionHandler<double>() ); - - if( iSec != Kd::Intersection::INTERSECT_EDGE ) //KEINE Kante getroffen - { - if(iSec == Kd::Intersection::ON_BOUNDARY ) - { - solids(x1,x2,x3,0) = true; - } - else - { - solids(x1,x2,x3,0) = (iSec&1); //ungerade anzahl an schnitten --> drinnen - } - testFailed = false; - break; - } - else - { - UBLOG(logDEBUG3, "GbTriFaceMesh3D.isPointInGbObject3D.if - an edge was hit "); - } - } - if( testFailed ) throw UbException(UB_EXARGS, "ups, nach 100 Strahlen immer noch kein Ergebnis"); - solids(x1,x2,x3,1) = 1; - } - } - UBLOG( logINFO,counter2 <<" point-in-object(PIO)-tests done in "<<ff.stop()<<"s" ); - UBLOG( logINFO,counter1-counter2 <<" point-in-object(PIO)-tests uebersprungen" ); - UBLOG(logINFO, "############################################################"); - - /* ======================================================================================= */ - if(writeFiles) - { - UBLOG( logINFO, "writeFiles - start"); - string subfiledir = outpath+"/"+filename+"_solid_node_files"; - UbSystem::makeDirectory( subfiledir ); - - std::vector<UbTupleFloat3 > nodes; - std::vector<std::string > datanames(solids.getNX4(),"data"); - datanames[0] = "solid"; - //datanames[1] = "solid"; - - std::vector< std::string > outFilenames; - - std::vector<std::vector<double > > nodedata( datanames.size() ); - for(int x3=0; x3<solids.getNX3(); x3++) - for(int x2=0; x2<solids.getNX2(); x2++) - for(int x1=0; x1<solids.getNX1(); x1++) - { - if( solids(x1 ,x2 ,x3 , 0) ) - { - nodes.push_back( makeUbTuple( orgx1+x1*dx1, orgx2+x2*dx2, orgx3+x3*dx3 ) ); - - for(int i=0; i<solids.getNX4(); i++) - { - nodedata[i].push_back( solids(x1 ,x2 ,x3 ,i) ); - } - } - - if( nodes.size() > 2000000 - || ( x1==(solids.getNX1()-1) && x2==(solids.getNX2()-1) && x3==(solids.getNX3()-1) ) ) - { - outFilenames.push_back( WbWriterVtkXmlBinary::getInstance()->writeNodesWithNodeData(subfiledir+"/"+filename+"_solid_nodes_"+"_part"+UbSystem::toString(outFilenames.size()+1),nodes,datanames,nodedata) ); - nodes.clear(); - nodedata.clear(); - nodedata.resize( datanames.size() ); - } - } - - WbWriterVtkXmlBinary::getInstance()->writeCollection(outpath+"/"+filename+"_solids_nodes",outFilenames,0,false); - - - mesh->writeMesh(outpath+"/"+filename+"_mesh",WbWriterVtkXmlBinary::getInstance()); - mesh->writeMesh(outpath+"/"+filename+"_mesh",WbWriterAvsASCII::getInstance()); - mesh->getKdTree()->writeTree(outpath+"/"+filename+"_kdTree",WbWriterVtkXmlBinary::getInstance()); - - UBLOG( logINFO, "writeFiles - end") - } -} diff --git a/src/basics/numerics/geometry3d/KdTree/package.include b/src/basics/numerics/geometry3d/KdTree/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/basics/numerics/geometry3d/creator/GbCuboid3DCreator.h b/src/basics/numerics/geometry3d/creator/GbCuboid3DCreator.h deleted file mode 100644 index 4f1414b7d6b7054d1096f296fbbcb7622e85ea56..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/creator/GbCuboid3DCreator.h +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef GBCUBOID3DCREATOR_H -#define GBCUBOID3DCREATOR_H - -#include <numerics/geometry3d/creator/GbObject3DCreator.h> -#include <numerics/geometry3d/GbCuboid3D.h> - -#ifdef CAB_QT -#include <numerics/geometry3d/presentation/QGbCuboid3DInstrument.h> -#include <QtGui/QWidget> -#include <QtGui/QDialog> -#endif - -#ifdef CAB_VTK -#include <numerics/geometry3d/presentation/vtkGbCuboid3D.h> -#endif - -class GbCuboid3DCreator : public GbObject3DCreator -{ -public: - static GbCuboid3DCreator* getInstance() - { - static GbCuboid3DCreator instance; - return &instance; - } - - GbCuboid3D* createGbObject3D() { return new GbCuboid3D(); } - - std::string getGbObject3DTypeID() { return "GbCuboid3D"; }; - std::string toString() { return "GbCuboid3DCreator"; } - -private: - GbCuboid3DCreator() : GbObject3DCreator() {} - - GbCuboid3DCreator( const GbCuboid3DCreator& ); //no copy allowed - const GbCuboid3DCreator& operator=( const GbCuboid3DCreator& ); //no copy allowed - -#ifdef CAB_QT -public: - GbCuboid3D* createGbObject3DwithQt(QWidget* parent=0, Qt::WFlags flags=0) - { - GbCuboid3D* cuboid = this->createGbObject3D(); - cuboid->getPoint2()->setX1(2.0); - cuboid->getPoint2()->setX2(2.0); - cuboid->getPoint2()->setX3(2.0); - - QGbCuboid3DInstrument instrument(parent, flags); - instrument.setGbCuboid3D(cuboid); - if (instrument.exec()) { return cuboid; } - delete cuboid; - - return NULL; - } - - QDialog* getSpecificInstrument(QWidget* parent=0, Qt::WFlags flags=0) { return new QGbCuboid3DInstrument(parent, flags); } - - void editGbObject3DwithQt(GbObject3D* gbObj, QWidget* parent=0, Qt::WFlags flags=0) - { - GbCuboid3D* cuboid = dynamic_cast<GbCuboid3D*>(gbObj); - if(!cuboid) throw UbException(UB_EXARGS,"selected object to edit is no GbCuboid3D!"); - - QGbCuboid3DInstrument instrument(parent, flags); - instrument.setGbCuboid3D(cuboid); - instrument.exec(); - } -#endif -#ifdef CAB_VTK -public: - Presentator* createObjectPresentator(ObObject *object) { return new vtkGbCuboid3D(dynamic_cast<GbCuboid3D*>(object)); } -#endif - -}; - -#ifndef SWIG -UB_AUTO_RUN_NAMED( GbObject3DFactory::getInstance()->addObObjectCreator(GbCuboid3DCreator::getInstance()), CAB_GbCuboid3DCreator); -#endif - -#endif diff --git a/src/basics/numerics/geometry3d/creator/GbCylinder3DCreator.h b/src/basics/numerics/geometry3d/creator/GbCylinder3DCreator.h deleted file mode 100644 index 7769985da7919f4c79de61481b69ebd234d7d3e4..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/creator/GbCylinder3DCreator.h +++ /dev/null @@ -1,81 +0,0 @@ -#ifndef GBCYLINDER3DCREATOR_H -#define GBCYLINDER3DCREATOR_H - -#include <numerics/geometry3d/creator/GbObject3DCreator.h> -#include <numerics/geometry3d/GbCylinder3D.h> - -#ifdef CAB_QT -#include <numerics/geometry3d/presentation/QGbCylinder3DInstrument.h> -#include <QtGui/QWidget> -#include <QtGui/QDialog> -#endif - -#ifdef CAB_VTK -#include <numerics/geometry3d/presentation/vtkGbCylinder3D.h> -#endif - - -class GbCylinder3DCreator : public GbObject3DCreator -{ -public: - static GbCylinder3DCreator* getInstance() - { - static GbCylinder3DCreator instance; - return &instance; - } - - GbCylinder3D* createGbObject3D() { return new GbCylinder3D(); } - - std::string getGbObject3DTypeID(){ return "GbCylinder3D"; } - std::string toString() { return "GbCylinder3DCreator"; } - -private: - GbCylinder3DCreator( const GbCylinder3DCreator& ); //no copy allowed - const GbCylinder3DCreator& operator=( const GbCylinder3DCreator& ); //no copy allowed -GbCylinder3DCreator() : GbObject3DCreator() {} - -#ifdef CAB_QT -public: - - GbCylinder3D* createGbObject3DwithQt(QWidget* parent=0, Qt::WFlags flags=0) - { - GbCylinder3D* cylinder = this->createGbObject3D(); - cylinder->setRadius(2.0); - cylinder->setPoint1(0.0, 0.0, 0.0); - cylinder->setPoint2(0.0, 5.0, 0.0); - - QGbCylinder3DInstrument instrument(parent, flags); - instrument.setGbCylinder3D(cylinder); - if (instrument.exec()){ return cylinder; } - delete cylinder; - - return NULL; - } - - QDialog* getSpecificInstrument(QWidget* parent=0, Qt::WFlags flags=0) - { - return new QGbCylinder3DInstrument(parent, flags); - } - - void editGbObject3DwithQt(GbObject3D* gbObj, QWidget* parent=0, Qt::WFlags flags=0) - { - GbCylinder3D* cylinder = dynamic_cast<GbCylinder3D*>(gbObj); - if(!cylinder) throw UbException(UB_EXARGS,"selected object to edit is no GbCylinder3D!"); - - QGbCylinder3DInstrument instrument(parent, flags); - instrument.setGbCylinder3D(cylinder); - instrument.exec(); - } -#endif -#ifdef CAB_VTK -public: - Presentator* createObjectPresentator(ObObject *object) { return new vtkGbCylinder3D(dynamic_cast<GbCylinder3D*>(object)); } -#endif - -}; - -#ifndef SWIG -UB_AUTO_RUN_NAMED( GbObject3DFactory::getInstance()->addObObjectCreator(GbCylinder3DCreator::getInstance()), CAB_GbCylinder3DCreator); -#endif - -#endif diff --git a/src/basics/numerics/geometry3d/creator/GbLine3DCreator.h b/src/basics/numerics/geometry3d/creator/GbLine3DCreator.h deleted file mode 100644 index cb5bdb991e9ed7e65f982d860159948aceacabbd..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/creator/GbLine3DCreator.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef GBLINE3DCREATOR_H -#define GBLINE3DCREATOR_H - -#include <numerics/geometry3d/creator/GbObject3DCreator.h> -#include <numerics/geometry3d/GbLine3D.h> - -class GbLine3DCreator : public GbObject3DCreator -{ -public: - static GbLine3DCreator* getInstance() - { - static GbLine3DCreator instance; - return &instance; - } - - GbLine3D* createGbObject3D() { return new GbLine3D(); } - - std::string getGbObject3DTypeID(){ return "GbLine3D"; } - std::string toString() { return "GbLine3DCreator"; } - -private: - GbLine3DCreator( const GbLine3DCreator& ); //no copy allowed - const GbLine3DCreator& operator=( const GbLine3DCreator& ); //no copy allowed - GbLine3DCreator() : GbObject3DCreator() {} -}; - -#ifndef SWIG -UB_AUTO_RUN_NAMED( GbObject3DFactory::getInstance()->addObObjectCreator(GbLine3DCreator::getInstance()), CAB_GbLine3DCreator); -#endif - -#endif diff --git a/src/basics/numerics/geometry3d/creator/GbObject3DCreator.h b/src/basics/numerics/geometry3d/creator/GbObject3DCreator.h deleted file mode 100644 index e2cc7b63882acec01c693e37423a452336079c1d..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/creator/GbObject3DCreator.h +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef GBOBJECT3DCREATOR_H -#define GBOBJECT3DCREATOR_H - -#include <string> - -#include <basics/objects/ObObjectCreator.h> -#include <basics/utilities/UbAutoRun.hpp> - -#include <numerics/geometry3d/GbObject3D.h> - -#ifdef CAB_QT -#include <qdialog.h> -#endif - -#ifdef CAB_VTK -#include <userinterface/presentation/vtkPoElement3D.h> -#endif - -#ifdef CAB_PARAVIEW -#include "vtkPVSource.h" -#endif - -class GbObject3DCreator : public ObObjectCreator -{ -protected: - GbObject3DCreator() {} -private: - GbObject3DCreator( const GbObject3DCreator& ); //no copy allowed !!! - const GbObject3DCreator& operator=( const GbObject3DCreator& ); //no copy allowed -public: - virtual ~GbObject3DCreator(){} - - virtual std::string getTypeID() { return getGbObject3DTypeID();} - virtual ObObject* createObObject() - { - return this->createGbObject3D(); - } - - - virtual GbObject3D* createGbObject3D()=0; - virtual std::string getGbObject3DTypeID()=0; - virtual std::string toString() { return "GbObject3DCreator"; } - -#ifdef CAB_QT - virtual GbObject3D* createGbObject3DwithQt(QWidget* parent=0, Qt::WFlags flags=0) { throw UbException(UB_EXARGS,"Not implemented..."); } - virtual void editGbObject3DwithQt(GbObject3D* gbObj, QWidget* parent=0, Qt::WFlags flags=0) { throw UbException(UB_EXARGS,"Not implemented..."); } -#endif - //die Teile von ObObjectCreator ... -#ifdef CAB_QT - void showSpecificInstrument(ObObject* object,QWidget* parent=0) - { - GbObject3D* geoObj = dynamic_cast<GbObject3D*>(object); - this->editGbObject3DwithQt(geoObj, parent); - } - virtual ObObject* createObObjectWithQt() { return this->createGbObject3DwithQt();} - virtual QObObjectSpecificInstrument* getSpecificInstrument() { throw UbException(UB_EXARGS,"not implemented"); } - -#endif -#ifdef CAB_VTK - virtual Presentator* createObjectPresentator(ObObject *object) { return NULL; } -#endif - - -#ifdef CAB_PARAVIEW - virtual vtkPVSource* createPVSource(vtkPVWindow *Window) { throw UbException(UB_EXARGS,"vtkPVSource* createPVSource"); } -#endif - - -}; - -#include <numerics/geometry3d/creator/GbObject3DFactory.h> - -/*=========================================================================*/ -#endif - - - diff --git a/src/basics/numerics/geometry3d/creator/GbObject3DFactory.cpp b/src/basics/numerics/geometry3d/creator/GbObject3DFactory.cpp deleted file mode 100644 index 2b1f2412e2fd2eb02f6e99e2e89e2dc0559122f0..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/creator/GbObject3DFactory.cpp +++ /dev/null @@ -1,97 +0,0 @@ -#include <numerics/geometry3d/creator/GbObject3DFactory.h> -#include <numerics/geometry3d/creator/GbObject3DCreator.h> -//#include <numerics/geometry3d/creator/GbPoint3DCreator.h> -// #include <numerics/geometry3d/creator/GbCuboid3DCreator.h> -// #include <numerics/geometry3d/creator/GbSphere3DCreator.h> -// #include <numerics/geometry3d/creator/GbCylinder3DCreator.h> -// #include <numerics/geometry3d/creator/GbLine3DCreator.h> -// #include <numerics/geometry3d/creator/GbPolygon3DCreator.h> -// #include <numerics/geometry3d/creator/GbTriangle3DCreator.h> -// #include <numerics/geometry3d/creator/GbTriangularMesh3DCreator.h> - -using namespace std; - -//GbObject3DFactory* GbObject3DFactory::instance = NULL; - -/*======================================================================*/ -GbObject3DFactory::GbObject3DFactory() - : ObObjectFactory() -{ -} -/*======================================================================*/ -GbObject3DFactory* GbObject3DFactory::getInstance() -{ - static GbObject3DFactory instance; - return &instance; -} - -///*======================================================================*/ -//void GbObject3DFactory::addGbObject3DCreator(GbObject3DCreator* creator) -//{ -// //cout<<"Meth:"<<creator->toString()<<" Meth-ID:"<<creator->getGbObject3DTypeID()<<endl; -// creatorSet.insert(pair<string, GbObject3DCreator*>(creator->getGbObject3DTypeID(), creator)); -//} -// -//void GbObject3DFactory::deleteGbObject3DCreator(GbObject3DCreator* creator) -//{ -// throw UbException(UB_EXARGS,"GbObject3DFactory::deleteGbObject3DCreator not yet implemented"); -// // this.creatorSet.delete(creator); -//} - -/*======================================================================*/ -GbObject3D* GbObject3DFactory::createGbObject3D(UbFileInput *in) -{ - string str = in->readString(); - //cout<<"GbObject3DFactory::createGbObject3D:"<<str<<endl; - - GbObject3D *gbObject3D = createEmptyGbObject3D(str); - - if(!gbObject3D) - throw UbException(UB_EXARGS,"creator for type available"); - - gbObject3D->read(in); - - return gbObject3D; -} -/*======================================================================*/ -GbObject3D* GbObject3DFactory::createEmptyGbObject3D(string objectType) -{ - typedef std::map<string, ObObjectCreator*>::iterator CreatorIterator; - std::map<string, ObObjectCreator*>* creatorSet = this->getCreatorSet(); - CreatorIterator creatorIterator = creatorSet->find(objectType); - - if(creatorIterator == creatorSet->end()) - throw UbException(UB_EXARGS,"factory has no creator for "+objectType); - - GbObject3DCreator *creator = dynamic_cast<GbObject3DCreator*>(creatorIterator->second); - - if(!creator) - throw UbException(UB_EXARGS,"factory has no creator for "+objectType); - - return creator->createGbObject3D(); -} -/*======================================================================*/ -//GbObject3DCreator* GbObject3DFactory::getCreator(string objectType) -//{ -// CreatorIterator creatorIterator = creatorSet.find(objectType); -// if(creatorIterator == creatorSet.end()) throw UbException(UB_EXARGS,"factory has no creator for "+objectType); -// GbObject3DCreator *creator = creatorIterator->second; -// if(!creator) throw UbException(UB_EXARGS,"factory has no creator for "+objectType); -// return(creator); -//} -/*======================================================================*/ -string GbObject3DFactory::toString() -{ - stringstream ss; - ss<<"GbObject2DFactory"; - int a=1; - std::map<std::string, ObObjectCreator*>::iterator creatorIterator; - std::map<std::string, ObObjectCreator*>* tmp = this->getCreatorSet(); - for(creatorIterator=tmp->begin(); creatorIterator!=tmp->end(); creatorIterator++) - { - ss<<(a++)<<". "; - ss<<creatorIterator->second->getTypeID(); - ss<<endl; - } - return(ss.str()); -} diff --git a/src/basics/numerics/geometry3d/creator/GbObject3DFactory.h b/src/basics/numerics/geometry3d/creator/GbObject3DFactory.h deleted file mode 100644 index 0231e34ad42493a70d5fc665864992c84789b5fb..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/creator/GbObject3DFactory.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef GBOBJECT3DFACTORY_H -#define GBOBJECT3DFACTORY_H - -#include <string> -#include <sstream> -#include <map> - -#include <basics/objects/ObObjectFactory.h> - -#include <basics/utilities/UbException.h> -#include <basics/utilities/UbFileInput.h> - -class GbObject3D; -class GbObject3DCreator; - -class GbObject3DFactory : public ObObjectFactory -{ -private: - GbObject3DFactory(); - GbObject3DFactory( const GbObject3DFactory& ); //no copy allowed - const GbObject3DFactory& operator=( const GbObject3DFactory& ); //no copy allowed -public: - static GbObject3DFactory* getInstance(); - - GbObject3D* createGbObject3D(UbFileInput* in); - - //void addGbObject3DCreator(GbObject3DCreator* creator); - //void deleteGbObject3DCreator(GbObject3DCreator* creator); - //std::map<std::string, GbObject3DCreator*>* getCreatorSet() { return &creatorSet; } - - std::string toString(); - GbObject3D* createEmptyGbObject3D(std::string objectType); - //GbObject3DCreator* getCreator(std::string objectTypeID); - -private: - - - //std::map<std::string, GbObject3DCreator*> creatorSet; - //typedef std::map<std::string, GbObject3DCreator*>::iterator CreatorIterator; -}; -/*=========================================================================*/ -#endif - diff --git a/src/basics/numerics/geometry3d/creator/GbPoint3DCreator.h b/src/basics/numerics/geometry3d/creator/GbPoint3DCreator.h deleted file mode 100644 index e861fe2cb265fce64053dc36434ad627eefcd746..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/creator/GbPoint3DCreator.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef GBPOINT3DCREATOR_H -#define GBPOINT3DCREATOR_H - -#include <numerics/geometry3d/creator/GbObject3DCreator.h> -#include <numerics/geometry3d/GbPoint3D.h> - -class GbPoint3DCreator : public GbObject3DCreator -{ -public: - static GbPoint3DCreator* getInstance() - { - static GbPoint3DCreator instance; - return &instance; - } - - GbPoint3D* createGbObject3D() { return new GbPoint3D(); } - - std::string getGbObject3DTypeID() { return "GbPoint3D"; } - std::string toString() { return "GbPoint3DCreator"; } - -private: - GbPoint3DCreator( const GbPoint3DCreator& ); //no copy allowed - const GbPoint3DCreator& operator=( const GbPoint3DCreator& ); //no copy allowed - GbPoint3DCreator() : GbObject3DCreator() {} -}; - -#ifndef SWIG -UB_AUTO_RUN_NAMED( GbObject3DFactory::getInstance()->addObObjectCreator(GbPoint3DCreator::getInstance()), CAB_GbPoint3DCreator); -#endif - -#endif diff --git a/src/basics/numerics/geometry3d/creator/GbPolygon3DCreator.h b/src/basics/numerics/geometry3d/creator/GbPolygon3DCreator.h deleted file mode 100644 index 72435ff0a00548e72ef071a56c23043778446ed2..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/creator/GbPolygon3DCreator.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef GBPOLYGON3DCREATOR_H -#define GBPOLYGON3DCREATOR_H - -#include <numerics/geometry3d/creator/GbObject3DCreator.h> -#include <numerics/geometry3d/GbPoint3D.h> - -class GbPolygon3DCreator : public GbObject3DCreator -{ -public: - static GbPolygon3DCreator* getInstance() - { - static GbPolygon3DCreator instance; - return &instance; - } - - GbPolygon3D* createGbObject3D() { return new GbPolygon3D(); } - - std::string getGbObject3DTypeID() { return "GbPolygon3D"; } - std::string toString() { return "GbPolygon3DCreator"; } - -private: - GbPolygon3DCreator( const GbPolygon3DCreator& ); //no copy allowed - const GbPolygon3DCreator& operator=( const GbPolygon3DCreator& ); //no copy allowed - - GbPolygon3DCreator() : GbObject3DCreator() {} -}; - -#ifndef SWIG -UB_AUTO_RUN_NAMED( GbObject3DFactory::getInstance()->addObObjectCreator(GbPolygon3DCreator::getInstance()), CAB_GbPolygon3DCreator); -#endif - -#endif diff --git a/src/basics/numerics/geometry3d/creator/GbQuadFaceMesh3DCreator.cpp b/src/basics/numerics/geometry3d/creator/GbQuadFaceMesh3DCreator.cpp deleted file mode 100644 index d5cc520a36972de405652a36c84975e506f50ab4..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/creator/GbQuadFaceMesh3DCreator.cpp +++ /dev/null @@ -1,66 +0,0 @@ -#include <numerics/geometry3d/creator/GbQuadFaceMesh3DCreator.h> -#include <numerics/geometry3d/GbQuadFaceMesh3D.h> -#include <basics/utilities/UbFileInputASCII.h> - -using namespace std; - -/***************************************************************************/ -GbObject3D* GbQuadFaceMesh3DCreator::createGbObject3D() -{ - return new GbQuadFaceMesh3D(); -} -/***************************************************************************/ -GbQuadFaceMesh3D* GbQuadFaceMesh3DCreator::createQuadMesh3D(int nodesX1, int nodesX2, float startX1, float startX2, double knotenabstandX1, double knotenabstandX2, float nullNiveau, string name) -{ - vector<GbQuadFaceMesh3D::Vertex> *vertices = new vector<GbQuadFaceMesh3D::Vertex>; - vector<GbQuadFaceMesh3D::QuadFace> *quads = new vector<GbQuadFaceMesh3D::QuadFace>; - for(int x1=0;x1<nodesX1;x1++) - { - for(int x2=0;x2<nodesX2;x2++) - { - vertices->push_back(GbQuadFaceMesh3D::Vertex((float)(x1*knotenabstandX1+startX1), (float)(x2*knotenabstandX2+startX2), nullNiveau)); - } - } - for(int x1=0;x1<nodesX1-1;x1++) - { - for(int x2=0;x2<nodesX2-1;x2++) - { - int index = x1*nodesX2+x2; - quads->push_back(GbQuadFaceMesh3D::QuadFace(index, index+nodesX2, index+nodesX2+1, index+1)); - } - } - - return (new GbQuadFaceMesh3D(name, vertices, quads)); -} - -/*============================================================*/ - -#ifdef CAB_QT - -GbQuadFaceMesh3D* GbQuadFaceMesh3DCreator::createGbObject3DwithQt() -{ - //QString s = QFileDialog::getOpenFileName(NULL,NULL,NULL,"open file dialog","Choose a STL file" ); - //QString s = QFileDialog::getOpenFileName(NULL, "Choose a STL file", "/home", "*.stl"); - //QFileDialog* fd = new QFileDialog( NULL ); - //fd->setIconText(QString("Hallo")); - //fd->show(); - //TODO: Open File Dialog einbauen. - //UbFileInputASCII in( s.toAscii().data() ); - //stringstream stream; - //stream <<"TriangularMesh3D ";//<<_objCount++; - //GbQuadFaceMesh3D *mesh = NULL;//GbQuadFaceMesh3DCreator::readMeshFromSTLFile(&in, stream.str() ); - //return mesh; - return NULL; -} -//QDialog* getSpecificInstrument() { return 0;} -void GbQuadFaceMesh3DCreator::editGbObject3DwithQt(GbObject3D* gbObj) -{ - -} -#endif -#ifdef CAB_VTK -Presentator* GbQuadFaceMesh3DCreator::createObjectPresentator(ObObject *object) -{ - return NULL; -} -#endif diff --git a/src/basics/numerics/geometry3d/creator/GbQuadFaceMesh3DCreator.h b/src/basics/numerics/geometry3d/creator/GbQuadFaceMesh3DCreator.h deleted file mode 100644 index c2d779c63633f0442711644d68c38b2c13cacdd8..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/creator/GbQuadFaceMesh3DCreator.h +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef GBQUADFACEMESH3DCREATOR_H -#define GBQUADFACEMESH3DCREATOR_H - -#include <numerics/geometry3d/creator/GbObject3DCreator.h> - -class GbQuadFaceMesh3D; - -#ifdef CAB_QT - -#endif - -#ifdef CAB_VTK -//#include <numerics/geometry3d/presentation/vtkGbQuadangularMesh3D.h> -#endif - -class GbQuadFaceMesh3DCreator : public GbObject3DCreator -{ -public: - static GbQuadFaceMesh3DCreator* getInstance() - { - static GbQuadFaceMesh3DCreator instance; - return &instance; - } - static GbQuadFaceMesh3D *createQuadMesh3D(int nodesX1, int nodesX2, float startX1, float startX2, double knotenabstandX1, double knotenabstandX2, float nullNiveau, std::string name); - - GbObject3D* createGbObject3D(); - - std::string getGbObject3DTypeID() { return "GbQuadFaceMesh3D"; } - std::string toString() { return "GbQuadFaceMesh3DCreator"; } - -#ifdef CAB_QT - - GbQuadFaceMesh3D* createGbObject3DwithQt(); - //QDialog* getSpecificInstrument() { return 0;} - void editGbObject3DwithQt(GbObject3D* gbObj); -#endif -#ifdef CAB_VTK - Presentator* createObjectPresentator(ObObject *object); -#endif - - -private: - GbQuadFaceMesh3DCreator( const GbQuadFaceMesh3DCreator& ); //no copy allowed - const GbQuadFaceMesh3DCreator& operator=( const GbQuadFaceMesh3DCreator& ); //no copy allowed - GbQuadFaceMesh3DCreator() : GbObject3DCreator() {} -}; - -#ifndef SWIG -UB_AUTO_RUN_NAMED( GbObject3DFactory::getInstance()->addObObjectCreator(GbQuadFaceMesh3DCreator::getInstance()), CAB_GbQuadFaceMesh3DCreator); -#endif - -#endif diff --git a/src/basics/numerics/geometry3d/creator/GbSphere3DCreator.h b/src/basics/numerics/geometry3d/creator/GbSphere3DCreator.h deleted file mode 100644 index 30a9bfd81f17327b964af118e98817d54c3a3f62..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/creator/GbSphere3DCreator.h +++ /dev/null @@ -1,126 +0,0 @@ -#ifndef GBSPHERE3DCREATOR_H -#define GBSPHERE3DCREATOR_H - -#include <numerics/geometry3d/creator/GbObject3DCreator.h> -#include <numerics/geometry3d/GbSphere3D.h> - -#ifdef CAB_QT -#include <numerics/geometry3d/presentation/QGbSphere3DInstrument.h> -#include <QtGui/QWidget> -#include <QtGui/QDialog> -#endif - -#ifdef CAB_VTK -#include <numerics/geometry3d/presentation/vtkGbSphere3D.h> -#endif - -#ifdef CAB_PARAVIEW -#include "vtkSMSourceProxy.h" -#include "vtkSMProperty.h" -#include "vtkSMDoubleVectorProperty.h" -#endif - -class GbSphere3DCreator : public GbObject3DCreator -{ -public: - static GbSphere3DCreator* getInstance() - { - static GbSphere3DCreator instance; - return &instance; - } - - GbSphere3D* createGbObject3D() { return new GbSphere3D(); } - - std::string getGbObject3DTypeID() { return "GbSphere3D"; }; - std::string toString() { return "GbSphere3DCreator"; } - -private: - GbSphere3DCreator( const GbSphere3DCreator& ); //no copy allowed - const GbSphere3DCreator& operator=( const GbSphere3DCreator& ); //no copy allowed - GbSphere3DCreator() : GbObject3DCreator() {} - -#ifdef CAB_QT -public: - - GbSphere3D* createGbObject3DwithQt(QWidget* parent=0, Qt::WFlags flags=0) - { - GbSphere3D* sphere = this->createGbObject3D(); - sphere->setRadius(3.0); - sphere->setCenterX1Coordinate(6.0); - - QGbSphere3DInstrument instrument(parent, flags); - instrument.setGbSphere3D(sphere); - if (instrument.exec()) { return sphere; } - delete sphere; - return NULL; - } - QDialog* getSpecificInstrument(QWidget* parent=0, Qt::WFlags flags=0) { return new QGbSphere3DInstrument(parent, flags); } - - void editGbObject3DwithQt(GbObject3D* gbObj, QWidget* parent=0, Qt::WFlags flags=0) - { - GbSphere3D* sphere = dynamic_cast<GbSphere3D*>(gbObj); - if(!sphere) throw UbException(UB_EXARGS,"selected object to edit is no GbSphere3D"); - - QGbSphere3DInstrument instrument(parent, flags); - instrument.setGbSphere3D(sphere); - instrument.exec(); - } -#endif -#ifdef CAB_VTK -public: - Presentator* createObjectPresentator(ObObject *object) { return new vtkGbSphere3D(dynamic_cast<GbSphere3D*>(object)); } -#endif - - -#ifdef CAB_PARAVIEW - vtkPVSource* createPVSource(vtkPVWindow *Window); -#endif -}; - -#ifdef CAB_PARAVIEW -vtkPVSource* GbSphere3DCreator::createPVSource(vtkPVWindow *Window) -{ - GbSphere3D *mysphere = this->createGbObject3D(); - mysphere->setCenterX1Coordinate(2.0); - mysphere->setCenterX2Coordinate(1.0); - mysphere->setCenterX3Coordinate(3.0); - mysphere->setRadius(0.3); - - vtkPVSource* pvs = Window->CreatePVSource("SphereSource"); - pvs->CreateProperties(); - if (pvs) - { - pvs->IsPermanentOn(); - pvs->Accept(1, 1); - //pvs->SetTraceReferenceObject(this->GetWindow()); - pvs->SetTraceReferenceObject(Window); - } - //vtkPVDisplayGUI *settingsGUI= pvs->GetPVOutput(); - - vtkSMSourceProxy* proxy = pvs->GetProxy(); - vtkSMProperty *prop = proxy->GetProperty("Center"); - - vtkSMDoubleVectorProperty *doubleprop = vtkSMDoubleVectorProperty::SafeDownCast(proxy->GetProperty("Center")); - doubleprop->SetElement(0, mysphere->getX1Centroid()); - doubleprop->SetElement(1, mysphere->getX2Centroid()); - doubleprop->SetElement(2, mysphere->getX3Centroid()); - pvs->SetLabel("Kugel"); - - doubleprop = vtkSMDoubleVectorProperty::SafeDownCast(proxy->GetProperty("Radius")); - doubleprop->SetElement(0, mysphere->getRadius()); - - pvs->GetPVWidget("Center")->ResetInternal(); - pvs->GetPVWidget("Radius")->ResetInternal(); - - pvs->SetVisibility(TRUE); - pvs->AcceptCallback(); - pvs->Update(); - return pvs; -} -#endif - -#ifndef SWIG -UB_AUTO_RUN_NAMED( GbObject3DFactory::getInstance()->addObObjectCreator(GbSphere3DCreator::getInstance()), CAB_GbSphere3DCreator); -#endif - -#endif diff --git a/src/basics/numerics/geometry3d/creator/GbTriFaceMesh3DCreator.cpp b/src/basics/numerics/geometry3d/creator/GbTriFaceMesh3DCreator.cpp deleted file mode 100644 index a39bf633a30e5cd697e02409ff8638213397af61..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/creator/GbTriFaceMesh3DCreator.cpp +++ /dev/null @@ -1,431 +0,0 @@ -#include <numerics/geometry3d/creator/GbTriFaceMesh3DCreator.h> -#include <basics/utilities/UbLogger.h> -#include <basics/utilities/UbTiming.h> - -using namespace std; - -GbTriFaceMesh3D* GbTriFaceMesh3DCreator::readMeshFromFile(string filename, string meshName, GbTriFaceMesh3D::KDTREE_SPLITAGORITHM splitAlg, bool removeRedundantNodes) -{ - if(meshName.empty()) - { - size_t pos=filename.rfind("/"); - if(pos!=string::npos) meshName = filename.substr(pos+1); - else meshName = filename; - } - - UbFileInputASCII stlfile(filename); - if(!stlfile) throw UbException(UB_EXARGS,"cannot open file "+filename); - string ext=stlfile.getFileExtension(); - - //in "kleinbuchstaben" umwandeln - transform(ext.begin(), ext.end(), ext.begin(), (int(*)(int))tolower); //(int(*)(int)) ist irgendso ein fieser cast, weil tolower ne alte c-methode ist - - //UBLOG(logINFO, "GbTriFaceMesh3DCreator::readMeshFromFile - read " <<filename ); - - if ( !ext.compare("ply" ) ) return GbTriFaceMesh3DCreator::readMeshFromPLYFile(filename, meshName,splitAlg , removeRedundantNodes); - else if( !ext.compare("stl" ) ) return GbTriFaceMesh3DCreator::readMeshFromSTLFile(filename, meshName,splitAlg , removeRedundantNodes); - else if( !ext.compare("inp" ) ) return GbTriFaceMesh3DCreator::readMeshFromAVSFile(filename, meshName,splitAlg , removeRedundantNodes); - else if( !ext.compare("mesh") ) return GbTriFaceMesh3DCreator::readMeshFromMeshFile(filename, meshName,splitAlg , removeRedundantNodes); - //else if( !ext.compare("raw") ) return GbTriFaceMesh3DCreator::readMeshFromRAWFile(filename,splitAlg , meshName); - else throw UbException(UB_EXARGS,"fileformat "+ext); - - return NULL; -} -/*======================================================================*/ -GbTriFaceMesh3D* GbTriFaceMesh3DCreator::readMeshFromMeshFile(string filename, string meshName, GbTriFaceMesh3D::KDTREE_SPLITAGORITHM splitAlg, bool removeRedundantNodes) -{ - UbFileInputASCII meshfile(filename); - if(!meshfile) throw UbException(UB_EXARGS,"cannot open file "+filename); - return GbTriFaceMesh3DCreator::readMeshFromMeshFile(&meshfile,meshName,splitAlg,removeRedundantNodes); -} -/*======================================================================*/ -GbTriFaceMesh3D* GbTriFaceMesh3DCreator::readMeshFromMeshFile(UbFileInput* in, string meshName, GbTriFaceMesh3D::KDTREE_SPLITAGORITHM splitAlg, bool removeRedundantNodes) -{ - vector<GbTriFaceMesh3D::Vertex> *nodes = new vector<GbTriFaceMesh3D::Vertex>; - vector<GbTriFaceMesh3D::TriFace> *triangles = new vector<GbTriFaceMesh3D::TriFace>; - - while( !in->eof() ) - { - std::string line = in->readStringLine(); - if( line.find("Vertices") !=std::string::npos ) - break; - } - int numVertices = in->readInteger(); - - UBLOG(logDEBUG1,"Number of vertices "<<numVertices); - - nodes->resize(numVertices); - - float x, y, z; - for (int i=0; i<numVertices; i++) - { - x = in->readFloat(); - y = in->readFloat(); - z = in->readFloat(); - in->readLine(); - (*nodes)[i] = GbTriFaceMesh3D::Vertex(x,y,z); - } - UBLOG(logDEBUG1," - read vertices (#"<<numVertices<<") done"); - - while( !in->eof() ) - { - std::string line = in->readStringLine(); - if( line.find("Triangles") !=std::string::npos ) - break; - } - int numFaces = in->readInteger(); - triangles->reserve(numFaces); - UBLOG(logDEBUG1,"Number of faces "<<numFaces); - - int j,k,l; - for(int i=0; i<numFaces; i++) - { - j = in->readInteger()-1; - k = in->readInteger()-1; - l = in->readInteger()-1; - in->readLine(); - - (*triangles).push_back(GbTriFaceMesh3D::TriFace(j,k,l)); - } - UBLOG(logDEBUG1," - read faces (#"<<(int)triangles->size()<<", #nonTriangles="<<(int)triangles->size()-numFaces<<") done"); - - GbTriFaceMesh3D* mesh = new GbTriFaceMesh3D(meshName, nodes, triangles, splitAlg, removeRedundantNodes ); - - return mesh; -} -/*======================================================================*/ -GbTriFaceMesh3D* GbTriFaceMesh3DCreator::readMeshFromPLYFile(string filename, string meshName, GbTriFaceMesh3D::KDTREE_SPLITAGORITHM splitAlg, bool removeRedundantNodes) -{ - UbFileInputASCII plyfile(filename); - if(!plyfile) throw UbException(UB_EXARGS,"cannot open file "+filename); - return GbTriFaceMesh3DCreator::readMeshFromPLYFile(&plyfile,meshName,splitAlg,removeRedundantNodes); -} -/*======================================================================*/ -GbTriFaceMesh3D* GbTriFaceMesh3DCreator::readMeshFromPLYFile(UbFileInput* in, string meshName, GbTriFaceMesh3D::KDTREE_SPLITAGORITHM splitAlg, bool removeRedundantNodes) -{ - //cout<<"GbTriangularMesh3DFile.readMeshFromPLYFile !!! Dieses Format hat leider redundante Knoten ..."<<endl; - vector<GbTriFaceMesh3D::Vertex> *nodes = new vector<GbTriFaceMesh3D::Vertex>; - vector<GbTriFaceMesh3D::TriFace> *triangles = new vector<GbTriFaceMesh3D::TriFace>; - - float x, y, z; - string dummy; - - int numVertices = in->readIntegerAfterString("element vertex"); - int numFaces = in->readIntegerAfterString("element face"); - in->setPosAfterLineWithString("end_header"); - - UBLOG(logDEBUG1,"Number of vertices "<<numVertices); - UBLOG(logDEBUG1,"Number of faces "<<numFaces); - - nodes->resize(numVertices); - triangles->reserve(numFaces); - - int onePercent = (int)UbMath::max(1,UbMath::integerRounding(numVertices*0.01)); - for (int i=0; i<numVertices; i++) - { - if( i%onePercent==0 ) - cout<<" - read vertices (#"<<numVertices<<") "<<UbMath::integerRounding(i/(double)numVertices*100.0)<<"% "<<"\r"<<flush; - x = in->readFloat(); - y = in->readFloat(); - z = in->readFloat(); - in->readLine(); - (*nodes)[i] = GbTriFaceMesh3D::Vertex(x,y,z); - } - UBLOG(logDEBUG1," - read vertices (#"<<numVertices<<") done"); - - int p,j,k,l,n; - onePercent = (int)UbMath::max(1,UbMath::integerRounding(numFaces*0.01)); - for(int i=0; i<numFaces; i++) - { - if( i%onePercent==0 ) cout<<" - read faces (#"<<numFaces<<") "<<UbMath::integerRounding(i/(double)numFaces*100.0)<<"% "<<"\r"<<flush; - - p = in->readInteger(); - if(p==3) //Dreieck, alles andere wird stumpf ingnoriert - { - j = in->readInteger(); - k = in->readInteger(); - l = in->readInteger(); - - if( !UbMath::inClosedInterval(j,0,numVertices-1) - || !UbMath::inClosedInterval(k,0,numVertices-1) - || !UbMath::inClosedInterval(l,0,numVertices-1) ) - { - throw UbException(UB_EXARGS,"dreiecksindex ist groesser als max Knotenindex oder kleiner 0"); - } - triangles->push_back(GbTriFaceMesh3D::TriFace(j,k,l)); - } - else if(p==4) //Viereck --> wird zu zwei Dreiecken! - { - j = in->readInteger(); - k = in->readInteger(); - l = in->readInteger(); - n = in->readInteger(); - numFaces++; - i++; - - if( !UbMath::inClosedInterval(j,0,numVertices-1) - || !UbMath::inClosedInterval(k,0,numVertices-1) - || !UbMath::inClosedInterval(l,0,numVertices-1) - || !UbMath::inClosedInterval(n,0,numVertices-1) - ) - { - throw UbException(UB_EXARGS,"vierecksindex ist groesser als max Knotenindex oder kleiner 0"); - } - triangles->push_back(GbTriFaceMesh3D::TriFace(j,k,l)); - triangles->push_back(GbTriFaceMesh3D::TriFace(l,n,j)); - } - - in->readLine(); - - } - UBLOG(logDEBUG1," - read faces (#"<<(int)triangles->size()<<", #nonTriangles="<<(int)triangles->size()-numFaces<<") done"); - - GbTriFaceMesh3D* mesh = new GbTriFaceMesh3D(meshName, nodes, triangles, splitAlg, removeRedundantNodes); - - return mesh; -} -/*======================================================================*/ -GbTriFaceMesh3D* GbTriFaceMesh3DCreator::readMeshFromSTLFile(string filename, string meshName, GbTriFaceMesh3D::KDTREE_SPLITAGORITHM splitAlg, bool removeRedundantNodes) -{ - UbFileInputASCII stlfile(filename); - if(!stlfile) throw UbException(UB_EXARGS,"cannot open file "+filename); - return GbTriFaceMesh3DCreator::readMeshFromSTLFile(&stlfile,meshName,splitAlg,removeRedundantNodes); -} -/*======================================================================*/ -GbTriFaceMesh3D* GbTriFaceMesh3DCreator::readMeshFromSTLFile(UbFileInput *in, string meshName, GbTriFaceMesh3D::KDTREE_SPLITAGORITHM splitAlg, bool removeRedundantNodes) -{ - UBLOG(logDEBUG1,"GbTriFaceMesh3DCreator::readMeshFromSTLFile !!! Dieses Format hat leider redundante Knoten ..."); - - vector<GbTriFaceMesh3D::Vertex> *nodes = new vector<GbTriFaceMesh3D::Vertex>; - vector<GbTriFaceMesh3D::TriFace> *triangles = new vector<GbTriFaceMesh3D::TriFace>; - string dummy; - - double x, y, z; - int nr=0; - - in->readLine(); - while(dummy!="endsolid") - { - in->readLine(); - in->readLine(); - dummy = in->readString(); - if(dummy!="vertex") throw UbException(UB_EXARGS,"no vertex format"); - x=in->readDouble(); - y=in->readDouble(); - z=in->readDouble(); - nodes->push_back(GbTriFaceMesh3D::Vertex((float)x,(float)y,(float)z)); - in->readLine(); - in->readString(); - x=in->readDouble(); - y=in->readDouble(); - z=in->readDouble(); - nodes->push_back(GbTriFaceMesh3D::Vertex((float)x,(float)y,(float)z)); - in->readLine(); - in->readString(); - x=in->readDouble(); - y=in->readDouble(); - z=in->readDouble(); - nodes->push_back(GbTriFaceMesh3D::Vertex((float)x,(float)y,(float)z)); - triangles->push_back(GbTriFaceMesh3D::TriFace(nr,nr+1,nr+2)); - in->readLine(); - in->readLine(); - in->readLine(); - dummy = in->readString(); - nr+=3; - //std::cout<<"read mesh "<< nr <<" \n"; - } - - GbTriFaceMesh3D* mesh = new GbTriFaceMesh3D(meshName, nodes, triangles, splitAlg, removeRedundantNodes); - - return mesh; -} -////////////////////////////////////////////////////////////////////////// -GbTriFaceMesh3D* GbTriFaceMesh3DCreator::readMeshFromSTLFile2(string filename, string meshName, GbTriFaceMesh3D::KDTREE_SPLITAGORITHM splitAlg, bool removeRedundantNodes, bool isBinaryFormat) -{ - vector<GbTriFaceMesh3D::Vertex> *nodes = new vector<GbTriFaceMesh3D::Vertex>; - vector<GbTriFaceMesh3D::TriFace> *triangles = new vector<GbTriFaceMesh3D::TriFace>; - int nr=0; - - if (!isBinaryFormat) { - ifstream in(filename.c_str()); - if (!in.good()) - { - delete nodes; - delete triangles; - UB_THROW(UbException(UB_EXARGS, "Can not open STL file: "+filename)); - } - char title[80]; - std::string s0, s1; - float n0, n1, n2, f0, f1, f2, f3, f4, f5, f6, f7, f8; - in.read(title, 80); - while (!in.eof()) { - in >> s0; // facet || endsolid - if (s0=="facet") { - in >> s1 >> n0 >> n1 >> n2; // normal x y z - in >> s0 >> s1; // outer loop - in >> s0 >> f0 >> f1 >> f2; // vertex x y z - in >> s0 >> f3 >> f4 >> f5; // vertex x y z - in >> s0 >> f6 >> f7 >> f8; // vertex x y z - in >> s0; // endloop - in >> s0; // endfacet - // Generate a new Triangle without Normal as 3 Vertices - nodes->push_back(GbTriFaceMesh3D::Vertex(f0, f1, f2)); - nodes->push_back(GbTriFaceMesh3D::Vertex(f3, f4, f5)); - nodes->push_back(GbTriFaceMesh3D::Vertex(f6, f7, f8)); - triangles->push_back(GbTriFaceMesh3D::TriFace(nr,nr+1,nr+2)); - nr+=3; - } - else if (s0=="endsolid") { - break; - } - } - in.close(); - } - else { - FILE *f = fopen(filename.c_str(), "rb"); - if (!f) - { - delete nodes; - delete triangles; - UB_THROW(UbException(UB_EXARGS, "Can not open STL file: "+filename)); - } - char title[80]; - int nFaces; - fread(title, 80, 1, f); - fread((void*)&nFaces, 4, 1, f); - float v[12]; // normal=3, vertices=3*3 = 12 - unsigned short uint16; - // Every Face is 50 Bytes: Normal(3*float), Vertices(9*float), 2 Bytes Spacer - for (size_t i=0; i<nFaces; ++i) { - for (size_t j=0; j<12; ++j) { - fread((void*)&v[j], sizeof(float), 1, f); - } - fread((void*)&uint16, sizeof(unsigned short), 1, f); // spacer between successive faces - nodes->push_back(GbTriFaceMesh3D::Vertex(v[3], v[4], v[5])); - nodes->push_back(GbTriFaceMesh3D::Vertex(v[6], v[7], v[8])); - nodes->push_back(GbTriFaceMesh3D::Vertex(v[9], v[10], v[11])); - triangles->push_back(GbTriFaceMesh3D::TriFace(nr, nr+1, nr+2)); - nr+=3; - } - fclose(f); - } - - GbTriFaceMesh3D* mesh = new GbTriFaceMesh3D(meshName, nodes, triangles, splitAlg, removeRedundantNodes); - - return mesh; -} - -/*======================================================================*/ -GbTriFaceMesh3D* GbTriFaceMesh3DCreator::readMeshFromAVSFile(string filename, string meshName, GbTriFaceMesh3D::KDTREE_SPLITAGORITHM splitAlg, bool removeRedundantNodes) -{ - UbFileInputASCII stlfile(filename); - if(!stlfile) throw UbException(UB_EXARGS,"cannot open file "+filename); - return GbTriFaceMesh3DCreator::readMeshFromAVSFile(&stlfile,meshName,splitAlg,removeRedundantNodes); -} -/*======================================================================*/ -GbTriFaceMesh3D* GbTriFaceMesh3DCreator::readMeshFromAVSFile(UbFileInput *in, string meshName, GbTriFaceMesh3D::KDTREE_SPLITAGORITHM splitAlg , bool removeRedundantNodes) -{ - UBLOG(logDEBUG1,"GbTriFaceMesh3DCreator.readMeshFromAVSFile !!! Dieses Format hat leider redundante Knoten ..."); - - vector<GbTriFaceMesh3D::Vertex> *nodes = new vector<GbTriFaceMesh3D::Vertex>; - vector<GbTriFaceMesh3D::TriFace> *triangles = new vector<GbTriFaceMesh3D::TriFace>; - string dummy; - - in->readLine(); - int numberNodes = in->readInteger(); - int numberTris = in->readInteger(); - in->readLine(); - - double x,y,z; - for(int u=0;u<numberNodes;u++) - { - in->readInteger(); - x=in->readDouble(); - y=in->readDouble(); - z=in->readDouble(); - in->readLine(); - nodes->push_back(GbTriFaceMesh3D::Vertex((float)x,(float)y,(float)z)); - } - int id1,id2,id3; - for(int u=0;u<numberTris;u++) - { - in->readInteger(); - in->readInteger(); - in->readString(); - id1 = in->readInteger(); - id2 = in->readInteger(); - id3 = in->readInteger(); - triangles->push_back(GbTriFaceMesh3D::TriFace(id1-1,id2-1,id3-1)); - } - - GbTriFaceMesh3D* mesh = new GbTriFaceMesh3D(meshName, nodes, triangles, splitAlg, removeRedundantNodes); - - return mesh; -} -/*======================================================================*/ -GbTriFaceMesh3D* GbTriFaceMesh3DCreator::readMeshFromVTKASCIIFile(string filename, string meshName, GbTriFaceMesh3D::KDTREE_SPLITAGORITHM splitAlg, bool removeRedundantNodes) -{ - UbFileInputASCII stlfile(filename); - if(!stlfile) throw UbException(UB_EXARGS,"cannot open file "+filename); - return GbTriFaceMesh3DCreator::readMeshFromVTKASCIIFile(&stlfile,meshName,splitAlg,removeRedundantNodes); -} -/*======================================================================*/ -GbTriFaceMesh3D* GbTriFaceMesh3DCreator::readMeshFromVTKASCIIFile(UbFileInput *in, string meshName, GbTriFaceMesh3D::KDTREE_SPLITAGORITHM splitAlg, bool removeRedundantNodes) -{ - UBLOG(logDEBUG1,"GbTriFaceMesh3DCreator.readMeshFromVTKASCIIFile !!! Dieses Format hat leider redundante Knoten ..."); - - vector<GbTriFaceMesh3D::Vertex> *nodes = new vector<GbTriFaceMesh3D::Vertex>; - vector<GbTriFaceMesh3D::TriFace> *triangles = new vector<GbTriFaceMesh3D::TriFace>; - string dummy; - - in->readLine(); - in->readLine(); - in->readLine(); - in->readLine(); - - in->readString(); - int numberNodes = in->readInteger(); - in->readLine(); - - double x,y,z; - for(int u=0;u<numberNodes;u++) - { - x=in->readDouble(); - y=in->readDouble(); - z=in->readDouble(); - nodes->push_back(GbTriFaceMesh3D::Vertex((float)x,(float)y,(float)z)); - //cout<<u<<" - x,y,z:"<<x<<","<<y<<","<<z<<endl; - //x=in->readDouble(); - //y=in->readDouble(); - //z=in->readDouble(); - //nodes->push_back(GbTriFaceMesh3D::Vertex((float)x,(float)y,(float)z)); - //x=in->readDouble(); - //y=in->readDouble(); - //z=in->readDouble(); - //nodes->push_back(GbTriFaceMesh3D::Vertex((float)x,(float)y,(float)z)); - //in->readLine(); - } - in->readLine(); - in->readString(); - int numberTris = in->readInteger(); - in->readLine(); - UBLOG(logDEBUG1,"numberTris:"<<numberTris); - - int id1,id2,id3; - for(int u=0;u<numberTris;u++) - { - in->readInteger(); - id1 = in->readInteger(); - id2 = in->readInteger(); - id3 = in->readInteger(); - triangles->push_back(GbTriFaceMesh3D::TriFace(id1,id2,id3)); - //cout<<u<<" - id1,id2,id3:"<<id1<<","<<id2<<","<<id3<<endl; - } - UBLOG(logDEBUG1,"Tris gelesen"); - - GbTriFaceMesh3D* mesh = new GbTriFaceMesh3D(meshName, nodes, triangles, splitAlg, removeRedundantNodes); - UBLOG(logDEBUG1,"mesh erzeugt (with remove redundant nodes = "<< boolalpha <<removeRedundantNodes<<")"); - - - return mesh; -} diff --git a/src/basics/numerics/geometry3d/creator/GbTriFaceMesh3DCreator.h b/src/basics/numerics/geometry3d/creator/GbTriFaceMesh3DCreator.h deleted file mode 100644 index 38247cdbe76c5a5ec487674151f19a7e869e064f..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/creator/GbTriFaceMesh3DCreator.h +++ /dev/null @@ -1,85 +0,0 @@ -#ifndef GBTRIFACEMESH3DCREATOR_H -#define GBTRIFACEMESH3DCREATOR_H - -#include <numerics/geometry3d/creator/GbObject3DCreator.h> -#include <numerics/geometry3d/GbTriFaceMesh3D.h> -#include <basics/utilities/UbFileInputASCII.h> - -#ifdef CAB_QT -#include <qfiledialog.h> -#endif - -#ifdef CAB_VTK -#include <numerics/geometry3d/presentation/vtkGbTriangularMesh3D.h> -#endif - -class GbTriFaceMesh3DCreator : public GbObject3DCreator -{ -public: - static GbTriFaceMesh3DCreator* getInstance() - { - static GbTriFaceMesh3DCreator instance; - return &instance; - } - static GbTriFaceMesh3D* readMeshFromFile(std::string filename, std::string meshName="", GbTriFaceMesh3D::KDTREE_SPLITAGORITHM splitAlg = GbTriFaceMesh3D::KDTREE_SAHPLIT, bool removeRedundantNodes=true); - - static GbTriFaceMesh3D* readMeshFromMeshFile(std::string filename, std::string meshName="", GbTriFaceMesh3D::KDTREE_SPLITAGORITHM splitAlg = GbTriFaceMesh3D::KDTREE_SAHPLIT, bool removeRedundantNodes=true); - static GbTriFaceMesh3D* readMeshFromMeshFile(UbFileInput* in, std::string meshName="", GbTriFaceMesh3D::KDTREE_SPLITAGORITHM splitAlg = GbTriFaceMesh3D::KDTREE_SAHPLIT, bool removeRedundantNodes=true); - - static GbTriFaceMesh3D* readMeshFromPLYFile(std::string filename, std::string meshName="", GbTriFaceMesh3D::KDTREE_SPLITAGORITHM splitAlg = GbTriFaceMesh3D::KDTREE_SAHPLIT, bool removeRedundantNodes=true); - static GbTriFaceMesh3D* readMeshFromPLYFile(UbFileInput* in, std::string meshName="", GbTriFaceMesh3D::KDTREE_SPLITAGORITHM splitAlg = GbTriFaceMesh3D::KDTREE_SAHPLIT, bool removeRedundantNodes=true); - - static GbTriFaceMesh3D* readMeshFromSTLFile(std::string filename, std::string meshName="", GbTriFaceMesh3D::KDTREE_SPLITAGORITHM splitAlg = GbTriFaceMesh3D::KDTREE_SAHPLIT, bool removeRedundantNodes=true); - static GbTriFaceMesh3D* readMeshFromSTLFile(UbFileInput* in, std::string meshName="", GbTriFaceMesh3D::KDTREE_SPLITAGORITHM splitAlg = GbTriFaceMesh3D::KDTREE_SAHPLIT, bool removeRedundantNodes=true); - static GbTriFaceMesh3D* readMeshFromSTLFile2(std::string filename, std::string meshName="", GbTriFaceMesh3D::KDTREE_SPLITAGORITHM splitAlg = GbTriFaceMesh3D::KDTREE_SAHPLIT, bool removeRedundantNodes=true, bool isBinaryFormat=true); - - static GbTriFaceMesh3D* readMeshFromAVSFile(std::string filename, std::string meshName="", GbTriFaceMesh3D::KDTREE_SPLITAGORITHM splitAlg = GbTriFaceMesh3D::KDTREE_SAHPLIT, bool removeRedundantNodes=true); - static GbTriFaceMesh3D* readMeshFromAVSFile(UbFileInput* in, std::string meshName="", GbTriFaceMesh3D::KDTREE_SPLITAGORITHM splitAlg = GbTriFaceMesh3D::KDTREE_SAHPLIT, bool removeRedundantNodes=true); - - static GbTriFaceMesh3D* readMeshFromVTKASCIIFile(std::string filename, std::string meshName="", GbTriFaceMesh3D::KDTREE_SPLITAGORITHM splitAlg = GbTriFaceMesh3D::KDTREE_SAHPLIT, bool removeRedundantNodes=true); - static GbTriFaceMesh3D* readMeshFromVTKASCIIFile(UbFileInput* in, std::string meshName="", GbTriFaceMesh3D::KDTREE_SPLITAGORITHM splitAlg = GbTriFaceMesh3D::KDTREE_SAHPLIT, bool removeRedundantNodes=true); - - GbTriFaceMesh3D* createGbObject3D() { return new GbTriFaceMesh3D(); } - - std::string getGbObject3DTypeID(){ return "GbTriFaceMesh3D"; }; - std::string toString() { return "GbTriFaceMesh3DCreator"; } - -#ifdef CAB_QT - - - GbTriFaceMesh3D* createGbObject3DwithQt() - { - //QString s = QFileDialog::getOpenFileName(NULL,NULL,NULL,"open file dialog","Choose a STL file" ); - QString s = QFileDialog::getOpenFileName(NULL, "Choose a STL file", "/home", "*.stl"); - //QFileDialog* fd = new QFileDialog( NULL ); - //fd->setIconText(QString("Hallo")); - //fd->show(); - //TODO: Open File Dialog einbauen. - UbFileInputASCII in( s.toAscii().data() ); - stringstream stream; - stream <<"TriangularMesh3D ";//<<_objCount++; - GbTriFaceMesh3D *mesh = NULL;//GbTriFaceMesh3DCreator::readMeshFromSTLFile(&in, stream.str() ); - return mesh; - } - //QDialog* getSpecificInstrument() { return 0;} - void editGbObject3DwithQt(GbObject3D* gbObj) - { - } -#endif -#ifdef CAB_VTK -public: - Presentator* createObjectPresentator(ObObject *object) { return new vtkGbTriangularMesh3D((GbTriangularMesh3D*)object); } -#endif - - -private: - GbTriFaceMesh3DCreator( const GbTriFaceMesh3DCreator& ); //no copy allowed - const GbTriFaceMesh3DCreator& operator=( const GbTriFaceMesh3DCreator& ); //no copy allowed - GbTriFaceMesh3DCreator() : GbObject3DCreator() {} -}; - -#ifndef SWIG -UB_AUTO_RUN_NAMED( GbObject3DFactory::getInstance()->addObObjectCreator(GbTriFaceMesh3DCreator::getInstance()), CAB_GbTriFaceMesh3DCreator); -#endif - -#endif diff --git a/src/basics/numerics/geometry3d/creator/GbTriangle3DCreator.h b/src/basics/numerics/geometry3d/creator/GbTriangle3DCreator.h deleted file mode 100644 index 54c1fd9a4a157ed62ddc75a99e8eb71c2304bf8c..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/creator/GbTriangle3DCreator.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef GBTRIANGLE3DCREATOR_H -#define GBTRIANGLE3DCREATOR_H - -#include <numerics/geometry3d/creator/GbObject3DCreator.h> -#include <numerics/geometry3d/GbTriangle3D.h> - -class GbTriangle3DCreator : public GbObject3DCreator -{ -public: - static GbTriangle3DCreator* getInstance() - { - static GbTriangle3DCreator instance; - return &instance; - } - - GbTriangle3D* createGbObject3D() { return new GbTriangle3D(); } - - std::string getGbObject3DTypeID(){ return "GbTriangle3D"; } - std::string toString() { return "GbTriangle3DCreator"; } - -private: - GbTriangle3DCreator( const GbTriangle3DCreator& ); //no copy allowed - const GbTriangle3DCreator& operator=( const GbTriangle3DCreator& ); //no copy allowed - GbTriangle3DCreator() : GbObject3DCreator() {} -}; - -#ifndef SWIG -UB_AUTO_RUN_NAMED( GbObject3DFactory::getInstance()->addObObjectCreator(GbTriangle3DCreator::getInstance()), CAB_GbTriangle3DCreator); -#endif - -#endif diff --git a/src/basics/numerics/geometry3d/creator/GbTriangularMesh3DCreator.cpp b/src/basics/numerics/geometry3d/creator/GbTriangularMesh3DCreator.cpp deleted file mode 100644 index 0b3f297cd65edeb16280d37130ef2faf61e7d46d..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/creator/GbTriangularMesh3DCreator.cpp +++ /dev/null @@ -1,258 +0,0 @@ -#include <numerics/geometry3d/creator/GbTriangularMesh3DCreator.h> -#include <algorithm> -#include <basics/utilities/UbLogger.h> - -using namespace std; - -GbTriangularMesh3D* GbTriangularMesh3DCreator::readMeshFromFile(string filename, string meshName) -{ - if(meshName.empty()) - { - size_t pos=filename.rfind("/"); - if(pos!=string::npos) meshName = filename.substr(pos+1); - else meshName = filename; - } - - UbFileInputASCII stlfile(filename); - if(!stlfile) throw UbException(UB_EXARGS,"cannot open file "+filename); - string ext=stlfile.getFileExtension(); - - //in "kleinbuchstaben" umwandeln - transform(ext.begin(), ext.end(), ext.begin(), (int(*)(int))tolower); - - if ( !ext.compare("ply") ) return GbTriangularMesh3DCreator::readMeshFromPLYFile(filename, meshName); - else if( !ext.compare("stl") ) return GbTriangularMesh3DCreator::readMeshFromSTLFile(filename, meshName); - else if( !ext.compare("gts") ) return GbTriangularMesh3DCreator::readMeshFromGTSFile(filename, meshName); - else if( !ext.compare("raw") ) return GbTriangularMesh3DCreator::readMeshFromRAWFile(filename, meshName); - else throw UbException(UB_EXARGS,"unrecognized fileformat "+ext); - - return NULL; -} -/*======================================================================*/ -GbTriangularMesh3D* GbTriangularMesh3DCreator::readMeshFromSTLFile(string filename, string meshName) -{ - UbFileInputASCII stlfile(filename); - if(!stlfile) throw UbException(UB_EXARGS,"cannot open file "+filename); - return GbTriangularMesh3DCreator::readMeshFromSTLFile(&stlfile,meshName); -} -/*======================================================================*/ -GbTriangularMesh3D* GbTriangularMesh3DCreator::readMeshFromSTLFile(UbFileInput* in, string meshName) -{ - UBLOG(logINFO,"GbTriangularMesh3DFile.readMeshFromSTLFile !!! Dieses Format hat leider redundante Knoten ..."); - vector<GbPoint3D*> *nodes = new vector<GbPoint3D*>; - vector<GbTriangle3D*> *triangles = new vector<GbTriangle3D*>; - nodes->resize(0, NULL); - triangles->resize(0, NULL); - double x, y, z; - //int nr=0; - string dummy; - GbPoint3D *node1 = NULL; - GbPoint3D *node2 = NULL; - GbPoint3D *node3 = NULL; - GbTriangle3D *triangle = NULL; - in->readLine(); - while(dummy!="endsolid") - { - in->readLine(); - in->readLine(); - dummy = in->readString(); if(dummy!="vertex") throw UbException(UB_EXARGS,"no vertex format"); - x=in->readDouble(); - y=in->readDouble(); - z=in->readDouble(); - node1 = new GbPoint3D(x,y,z); nodes->push_back(node1); - in->readLine(); - in->readString(); - x=in->readDouble(); - y=in->readDouble(); - z=in->readDouble(); - node2 = new GbPoint3D(x,y,z); nodes->push_back(node2); - in->readLine(); - in->readString(); - x=in->readDouble(); - y=in->readDouble(); - z=in->readDouble(); - node3 = new GbPoint3D(x,y,z); nodes->push_back(node3); - triangle = new GbTriangle3D(node1, node2, node3); triangles->push_back(triangle); - in->readLine(); - in->readLine(); - in->readLine(); - dummy = in->readString(); - } - return new GbTriangularMesh3D(meshName, nodes, triangles); -} -/*======================================================================*/ -/** -* Returns a triangular mesh created from the specified TICAD source ASCII stream (system.dat format). -* @param in the input stream -* @param meshName the name of the created mesh -* @return a triangular mesh created from the specified TICAD source ASCII stream -* @exception IOException if any error occurs in creating the triangular mesh -*/ -GbTriangularMesh3D* GbTriangularMesh3DCreator::readMeshFromGTSFile(string inputfile, string meshName) -{ - UbFileInputASCII gtlfile(inputfile); - if(!gtlfile) throw UbException(UB_EXARGS,"cannot open file "+inputfile); - return GbTriangularMesh3DCreator::readMeshFromGTSFile(>lfile,meshName); -} -/*======================================================================*/ -GbTriangularMesh3D* GbTriangularMesh3DCreator::readMeshFromGTSFile(UbFileInput *in, string meshName) -{ - UBLOG(logINFO,"GbTriangularMesh3DFile.readMeshFromGTSFile !!! "); - vector<GbPoint3D*> *nodes = new vector<GbPoint3D*>; - vector<GbLine3D*> *edges = new vector<GbLine3D*>; - vector<GbTriangle3D*> *triangles = new vector<GbTriangle3D*>; - nodes->resize(0, NULL); - edges->resize(0, NULL); - triangles->resize(0, NULL); - double x, y, z; - int point1, point2, point3; - //int nr = 0; - //in->readLine(); - int nodesize = in->readInteger(); - int edgesize = in->readInteger(); - int trianglesize = in->readInteger(); - UBLOG(logINFO,"node-/edge-/trianglesize: "<<nodesize<<" / "<<edgesize<<" / "<<trianglesize); - - for(int i=0; i<nodesize;i++) - { - in->readLine(); - x=in->readDouble(); - y=in->readDouble(); - z=in->readDouble(); - nodes->push_back(new GbPoint3D(x,y,z)); - } - for(int i=0; i<edgesize;i++) - { - in->readLine(); - point1=in->readInteger()-1; - point2=in->readInteger()-1; - edges->push_back(new GbLine3D((*nodes)[point1],(*nodes)[point2])); - } - for(int i=0; i<trianglesize;i++) - { - in->readLine(); - point1=in->readInteger(); - point2=in->readInteger(); - point3=in->readInteger(); - //triangles->push_back(new GbTriangle3D((*nodes)[point1-1],(*nodes)[point2-1],(*nodes)[point3-1])); - triangles->push_back(new GbTriangle3D((GbPoint3D*)(*edges)[point1-1]->getPoint1(),(GbPoint3D*)(*edges)[point2-1]->getPoint1(),(GbPoint3D*)(*edges)[point3-1]->getPoint1())); - } - return(new GbTriangularMesh3D(meshName, nodes, edges, triangles)); -} -/*======================================================================*/ -/** -* Returns a triangular mesh created from the specified TICAD source ASCII stream (system.dat format). -* @param in the input stream -* @param meshName the name of the created mesh -* @return a triangular mesh created from the specified TICAD source ASCII stream -* @exception IOException if any error occurs in creating the triangular mesh -*/ -GbTriangularMesh3D* GbTriangularMesh3DCreator::readMeshFromPLYFile(string inputfile, string meshName) -{ - UbFileInputASCII plyfile(inputfile); - if(!plyfile) throw UbException(UB_EXARGS,"cannot open file "+inputfile); - return GbTriangularMesh3DCreator::readMeshFromPLYFile(&plyfile,meshName); -} -/*======================================================================*/ -GbTriangularMesh3D* GbTriangularMesh3DCreator::readMeshFromPLYFile(UbFileInput *in, string meshName) -{ - //cout<<"GbTriangularMesh3DFile.readMeshFromPLYFile !!! Dieses Format hat leider redundante Knoten ..."<<endl; - vector<GbPoint3D*> *nodes = new vector<GbPoint3D*>; - vector<GbTriangle3D*> *triangles = new vector<GbTriangle3D*>; - nodes->resize(0, NULL); - triangles->resize(0, NULL); - double x, y, z; - int nr=0; - string dummy; - int numVertices, numFaces; - GbPoint3D *node = NULL; - GbPoint3D *node1 = NULL; - GbPoint3D *node2 = NULL; - GbPoint3D *node3 = NULL; - GbTriangle3D *triangle = NULL; - in->readLine(); - in->readLine(); - in->readString(); in->readString(); numVertices = in->readInteger(); - in->readLine(); - in->readLine(); - in->readLine(); - in->readLine(); - in->readLine(); - in->readLine(); - in->readLine(); - in->readString(); in->readString(); numFaces = in->readInteger(); in->readLine(); - in->readLine(); - in->readLine(); - UBLOG(logINFO,"Number of vertices "<<numVertices); - UBLOG(logINFO,"Number of faces "<<numFaces); - for (int i=0; i<numVertices; i++) - { - x = in->readDouble(); - y = in->readDouble(); - z = in->readDouble(); - // cout<<x<<y<<z; - // in->readString(); in->readString(); in->readString(); - in->readLine(); - node = new GbPoint3D(x,y,z); nodes->push_back(node); - } - nr=0; - - for (int i=0; i<numFaces; i++) - { - in->readString(); - int j,k,l; - j = in->readInteger(); k = in->readInteger(); l = in->readInteger(); - node1 = (*nodes)[j]; - node2 = (*nodes)[k]; - node3 = (*nodes)[l]; - in->readLine(); - nr++; - triangle = new GbTriangle3D(node1, node2, node3); triangles->push_back(triangle); - } - - return(new GbTriangularMesh3D(meshName, nodes, triangles)); -} -/*======================================================================*/ -GbTriangularMesh3D* GbTriangularMesh3DCreator::readMeshFromRAWFile(string inputfile, string meshName) -{ - UbFileInputASCII stlfile(inputfile); - if(!stlfile) throw UbException(UB_EXARGS,"cannot open file "+inputfile); - return GbTriangularMesh3DCreator::readMeshFromRAWFile(&stlfile,meshName); -} -/*======================================================================*/ -GbTriangularMesh3D* GbTriangularMesh3DCreator::readMeshFromRAWFile(UbFileInput *in, string meshName) -{ - UBLOG(logINFO,"GbTriangularMesh3DFile.readMeshFromGTSFile !!! "); - vector<GbPoint3D*> *nodes = new vector<GbPoint3D*>; - vector<GbLine3D*> *edges = new vector<GbLine3D*>; - vector<GbTriangle3D*> *triangles = new vector<GbTriangle3D*>; - nodes->resize(0, NULL); - edges->resize(0, NULL); - triangles->resize(0, NULL); - double x, y, z; - int point1, point2, point3; - //int nr = 0; - //in->readLine(); - int nodesize = in->readInteger(); - int trianglesize = in->readInteger(); - int edgesize = 0; - UBLOG(logINFO,"node-/edge-/trianglesize "<<nodesize<<" / "<<edgesize<<" / "<<trianglesize); - - for(int i=0; i<nodesize;i++) - { - in->readLine(); - x=in->readDouble(); - y=in->readDouble(); - z=in->readDouble(); - nodes->push_back(new GbPoint3D(x,y,z)); - } - for(int i=0; i<trianglesize;i++) - { - in->readLine(); - point1=in->readInteger(); - point2=in->readInteger(); - point3=in->readInteger(); - triangles->push_back(new GbTriangle3D((*nodes)[point1],(*nodes)[point2],(*nodes)[point3])); - } - return(new GbTriangularMesh3D(meshName, nodes, edges, triangles)); -} diff --git a/src/basics/numerics/geometry3d/creator/GbTriangularMesh3DCreator.h b/src/basics/numerics/geometry3d/creator/GbTriangularMesh3DCreator.h deleted file mode 100644 index d449f0849d034f28318f03b39bf74781d86c36f0..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/creator/GbTriangularMesh3DCreator.h +++ /dev/null @@ -1,83 +0,0 @@ -#ifndef GBTRIANGULARMESH3DCREATOR_H -#define GBTRIANGULARMESH3DCREATOR_H - -#include <numerics/geometry3d/creator/GbObject3DCreator.h> -#include <numerics/geometry3d/GbTriangularMesh3D.h> -#include <basics/utilities/UbFileInputASCII.h> - -#ifdef CAB_QT -#include <qfiledialog.h> -#endif - -#ifdef CAB_VTK -#include <numerics/geometry3d/presentation/vtkGbTriangularMesh3D.h> -#endif - -class GbTriangularMesh3DCreator : public GbObject3DCreator -{ -public: - static GbTriangularMesh3DCreator* getInstance() - { - static GbTriangularMesh3DCreator instance; - return &instance; - } - - static GbTriangularMesh3D* readMeshFromFile(std::string filename, std::string meshName=""); - - static GbTriangularMesh3D* readMeshFromSTLFile(std::string filename, std::string meshName); - static GbTriangularMesh3D* readMeshFromGTSFile(std::string filename, std::string meshName); - static GbTriangularMesh3D* readMeshFromPLYFile(std::string filename, std::string meshName); - //static GbTriangularMesh3D* readMeshFromAVSFile(std::string filename, std::string meshName); - static GbTriangularMesh3D* readMeshFromRAWFile(std::string inputFile, std::string meshName); - - static GbTriangularMesh3D* readMeshFromSTLFile(UbFileInput* infile, std::string meshName); - static GbTriangularMesh3D* readMeshFromGTSFile(UbFileInput* infile, std::string meshName); - static GbTriangularMesh3D* readMeshFromPLYFile(UbFileInput* infile, std::string meshName); - //static GbTriangularMesh3D* readMeshFromAVSFile(UbFileInput* infile, std::string meshName); - static GbTriangularMesh3D* readMeshFromRAWFile(UbFileInput* infile, std::string meshName); - - - GbTriangularMesh3D* createGbObject3D() { return new GbTriangularMesh3D(); } - - std::string getGbObject3DTypeID(){ return "GbTriangularMesh3D"; }; - std::string toString() { return "GbTriangularMesh3DCreator"; } - -#ifdef CAB_QT - - GbTriangularMesh3D* createGbObject3DwithQt(QWidget* parent=0, Qt::WFlags flags=0) - { - //QString s = QFileDialog::getOpenFileName(NULL,NULL,NULL,"open file dialog","Choose a STL file" ); - QString s = QFileDialog::getOpenFileName(NULL, "Choose a STL file", "/home", "*.stl"); - //QFileDialog* fd = new QFileDialog( NULL ); - //fd->setIconText(QString("Hallo")); - //fd->show(); - //TODO: Open File Dialog einbauen. - UbFileInputASCII in( s.toAscii().data() ); - stringstream stream; - stream <<"TriangularMesh3D ";//<<_objCount++; - GbTriangularMesh3D *mesh = GbTriangularMesh3DCreator::readMeshFromSTLFile(&in, stream.str() ); - mesh->deleteRedundantNodes(); - return mesh; - } - //QDialog* getSpecificInstrument() { return 0;} - void editGbObject3DwithQt(GbObject3D* gbObj, QWidget* parent=0, Qt::WFlags flags=0) - { - } -#endif -#ifdef CAB_VTK -public: - Presentator* createObjectPresentator(ObObject *object) { return new vtkGbTriangularMesh3D((GbTriangularMesh3D*)object); } -#endif - - -private: - GbTriangularMesh3DCreator( const GbTriangularMesh3DCreator& ); //no copy allowed - const GbTriangularMesh3DCreator& operator=( const GbTriangularMesh3DCreator& ); //no copy allowed - GbTriangularMesh3DCreator() : GbObject3DCreator() {} -}; - -#ifndef SWIG -UB_AUTO_RUN_NAMED( GbObject3DFactory::getInstance()->addObObjectCreator(GbTriangularMesh3DCreator::getInstance()), CAB_GbTriangularMesh3DCreator); -#endif - -#endif diff --git a/src/basics/numerics/geometry3d/creator/GbVoxelMatrix3DCreator.cpp b/src/basics/numerics/geometry3d/creator/GbVoxelMatrix3DCreator.cpp deleted file mode 100644 index 182d8b30a0b4949fc604b143d8f4d0f1a1021e9e..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/creator/GbVoxelMatrix3DCreator.cpp +++ /dev/null @@ -1,84 +0,0 @@ -#include <numerics/geometry3d/creator/GbVoxelMatrix3DCreator.h> -#include <numerics/geometry3d/GbVoxelMatrix3D.h> -#include <basics/utilities/UbFileInputASCII.h> -#include <basics/utilities/UbMath.h> -#include <basics/utilities/UbLogger.h> - -using namespace std; - -/***************************************************************************/ -GbVoxelMatrix3D* GbVoxelMatrix3DCreator::createFromRawFloatFile( string filename, int nodesX1, int nodesX2, int nodesX3, float threshold) -{ - UBLOG(logINFO,"GbVoxelMatrix3DCreator::createFromRawFloatFile \""<<filename<<"\" nodes("<<nodesX1<<"/"<<nodesX2<<"/"<<nodesX3<<") - start"); - ifstream in(filename.c_str(), ios::binary); - if(!in) throw UbException(UB_EXARGS,"could not open file "+filename); - - in.seekg( 0, ios::end ); //Ende springen - fstream::off_type length = in.tellg(); //Position abfragen - in.seekg( 0, ios::beg ); //An den Anfang springen - if( (nodesX1*nodesX2*nodesX3)*sizeof(float) != (long)length ) - { - throw UbException(UB_EXARGS,"number of nodes doesn't match filesize"); - } - - UBLOG(logINFO," - create GbVoxelMatrix3D"); - GbVoxelMatrix3D* voxelGeo = new GbVoxelMatrix3D(nodesX1,nodesX2,nodesX3,GbVoxelMatrix3D::FLUID, threshold); - - UBLOG(logINFO," - init values"); - float val; - for(int x3=0; x3<nodesX3; x3++) - for(int x2=0; x2<nodesX2; x2++) - for(int x1=0; x1<nodesX1; x1++) - { - in.read((char*)&val,sizeof(float)); - //if( !UbMath::equal(val, 0.0f) ) - if( UbMath::greater(val, threshold) ) - { - (*voxelGeo)(x1,x2,x3) = GbVoxelMatrix3D::SOLID; - } - } - - UBLOG(logINFO,"GbVoxelMatrix3DCreator::createFromRawFloatFile \""<<filename<<"\" nodes("<<nodesX1<<"/"<<nodesX2<<"/"<<nodesX3<<") - end"); - - return voxelGeo; -} -/***************************************************************************/ -GbVoxelMatrix3D* GbVoxelMatrix3DCreator::createFromVtiASCIIFloatFile( string filename, int nodesX1, int nodesX2, int nodesX3, float threshold) -{ - UBLOG(logINFO,"GbVoxelMatrix3DCreator::createFromVtiASCIIFloatFile \""<<filename<<"\" nodes("<<nodesX1<<"/"<<nodesX2<<"/"<<nodesX3<<") - start"); - UbFileInputASCII in(filename); - //ifstream in(filename.c_str(), ios::binary); - if(!in) throw UbException(UB_EXARGS,"could not open file "+filename); - in.readLine(); - in.readLine(); - in.readLine(); - in.readLine(); - in.readLine(); - //in.readLine(); !!!manchmal hat das vti file noch die xml version dabei ... - - UBLOG(logINFO," - create GbVoxelMatrix3D"); - GbVoxelMatrix3D* voxelGeo = new GbVoxelMatrix3D(nodesX1,nodesX2,nodesX3,GbVoxelMatrix3D::FLUID, threshold); - - UBLOG(logINFO," - init values"); - int val; - int u=0; - for(int x3=0; x3<nodesX3; x3++) - for(int x2=0; x2<nodesX2; x2++) - for(int x1=0; x1<nodesX1; x1++) - { - val = in.readInteger(); - - //u++; if(u>125000) UBLOG(logINFO,"val:"<<u<<" "<<val); - - //if( !UbMath::equal(val, 0.0f) ) - if( UbMath::greater(val, threshold) ) - { - (*voxelGeo)(x1,x2,x3) = GbVoxelMatrix3D::SOLID; - } - } - - UBLOG(logINFO,"GbVoxelMatrix3DCreator::createFromVtiASCIIFloatFile \""<<filename<<"\" nodes("<<nodesX1<<"/"<<nodesX2<<"/"<<nodesX3<<") - end"); - - return voxelGeo; -} - diff --git a/src/basics/numerics/geometry3d/creator/GbVoxelMatrix3DCreator.h b/src/basics/numerics/geometry3d/creator/GbVoxelMatrix3DCreator.h deleted file mode 100644 index fd2cc0482dff533e2ca907f1322b8a872a9ac136..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/creator/GbVoxelMatrix3DCreator.h +++ /dev/null @@ -1,81 +0,0 @@ -#ifndef GBVOXELMATRIX3DCREATOR_H -#define GBVOXELMATRIX3DCREATOR_H - -#include <numerics/geometry3d/creator/GbObject3DCreator.h> -#include <numerics/geometry3d/GbVoxelMatrix3D.h> -#include <iostream> -#include <fstream> - -class GbVoxelMatrix3DCreator : public GbObject3DCreator -{ -public: - enum DataType {t8bit, t16bit}; -public: - static GbVoxelMatrix3DCreator* getInstance() - { - static GbVoxelMatrix3DCreator instance; - return &instance; - } - - GbVoxelMatrix3D* createGbObject3D() { return new GbVoxelMatrix3D(); } - GbVoxelMatrix3D* createFromRawFloatFile( std::string filename, int nodesX1, int nodesX2, int nodesX3, float threshold=0.0); - GbVoxelMatrix3D* createFromVtiASCIIFloatFile( std::string filename, int nodesX1, int nodesX2, int nodesX3, float threshold=0.0); - - std::string getGbObject3DTypeID() { return "GbVoxelMatrix3D"; }; - std::string toString() { return "GbVoxelMatrix3DCreator"; } - -private: - GbVoxelMatrix3DCreator() : GbObject3DCreator() {} - - GbVoxelMatrix3DCreator( const GbVoxelMatrix3DCreator& ); //no copy allowed - const GbVoxelMatrix3DCreator& operator=( const GbVoxelMatrix3DCreator& ); //no copy allowed - -public: - template< typename T > - GbVoxelMatrix3D* createFromRawFile(std::string filename, int nodesX1, int nodesX2, int nodesX3, float threshold) - { - UBLOG(logINFO,"GbVoxelMatrix3DCreator::createFromRawFloatFile \""<<filename<<"\" nodes("<<nodesX1<<"/"<<nodesX2<<"/"<<nodesX3<<") - start"); - - std::ifstream in(filename.c_str(), std::ios::binary); - if(!in) throw UbException(UB_EXARGS,"could not open file "+filename); - - in.seekg( 0, std::ios::end ); //Ende springen - std::fstream::off_type length = in.tellg(); //Position abfragen - in.seekg( 0, std::ios::beg ); //An den Anfang springen - long m_size = (nodesX1*nodesX2*nodesX3)*sizeof(T); - if( m_size != (long)length ) - { - throw UbException(UB_EXARGS,"number of nodes doesn't match filesize: " + UbSystem::toString(length)); - } - - UBLOG(logINFO," - create GbVoxelMatrix3D"); - GbVoxelMatrix3D* voxelGeo = new GbVoxelMatrix3D(nodesX1,nodesX2,nodesX3,GbVoxelMatrix3D::FLUID, threshold); - - UBLOG(logINFO," - init values"); - T val; - for(int x3=0; x3<nodesX3; x3++) - for(int x2=0; x2<nodesX2; x2++) - for(int x1=0; x1<nodesX1; x1++) - { - in.read((char*)&val,sizeof(T)); - //if( !UbMath::equal(val, 0.0f) ) - //if( UbMath::greater(val, (T)threshold) ) - if(val > (T)threshold) - { - (*voxelGeo)(x1,x2,x3) = GbVoxelMatrix3D::SOLID; - } - } - - UBLOG(logINFO,"GbVoxelMatrix3DCreator::createFromRawFloatFile \""<<filename<<"\" nodes("<<nodesX1<<"/"<<nodesX2<<"/"<<nodesX3<<") - end"); - - return voxelGeo; - } -}; - - - -#ifndef SWIG -UB_AUTO_RUN_NAMED( GbObject3DFactory::getInstance()->addObObjectCreator(GbVoxelMatrix3DCreator::getInstance()), CAB_GbVoxelMatrix3DCreator); -#endif - -#endif //GBVOXELMATRIX3DCREATOR_H diff --git a/src/basics/numerics/geometry3d/creator/package.include b/src/basics/numerics/geometry3d/creator/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/basics/numerics/geometry3d/examples/insideOutsideTests/CMakeLists.txt b/src/basics/numerics/geometry3d/examples/insideOutsideTests/CMakeLists.txt deleted file mode 100644 index f4da9878985742367fc04307484b7961f321ac70..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/examples/insideOutsideTests/CMakeLists.txt +++ /dev/null @@ -1,61 +0,0 @@ -cmake_minimum_required(VERSION 2.4) - -INCLUDE("../../../../CMakeCABMacros.txt") -INCLUDE("../../../../CMakeSetCompilerFlags.txt") - -CHECK_FOR_VARIABLE(CAB_MACHINE "machine name, e.g. ALTIX, ARWEN") -SET(CMAKE_CONFIG_FILE "${SOURCE_ROOT}/cmake_config_files/${CAB_MACHINE}.config.cmake") - -IF(CAB_MACHINE AND EXISTS ${CMAKE_CONFIG_FILE} ) - - PROJECT(geo3dCellCutTests) - - SET(EXECUTABLE_NAME geo3dCellCutTests) - - #erst hier das config file einfügen, ansonsten werden manche settings durch (Project) überschrieben) - INCLUDE(${CMAKE_CONFIG_FILE}) - - ################################################################# - ### PACKAGES ### - ################################################################# - INCLUDE(${SOURCE_ROOT}/basics/utilities/CMakePackage.txt) - INCLUDE(${SOURCE_ROOT}/basics/objects/CMakePackage.txt) - INCLUDE(${SOURCE_ROOT}/numerics/geometry3d/CMakePackage.txt) - INCLUDE(${SOURCE_ROOT}/numerics/geometry3d/creator/CMakePackage.txt) - INCLUDE(${SOURCE_ROOT}/numerics/geometry3d/fem/CMakePackage.txt) - - ################################################################# - ### OWN DEFINES ### - ################################################################# - FILE(GLOB SPECIFIC_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.h - ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp ) - - - SET(ALL_SOURCES ${ALL_SOURCES} ${SPECIFIC_FILES}) - SOURCE_GROUP(example FILES ${SPECIFIC_FILES}) - - SET_COMPILER_SPECIFIC_FLAGS(${CAB_COMPILER} BINARY) - - ################################################################# - ### ADDITIONAL_MAKE_CLEAN_FILES ### - ################################################################# - SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${GENERATED_FILES}") - - ################################################################# - ### EXCECUTABLE ### - ################################################################# - ADD_EXECUTABLE(${EXECUTABLE_NAME} ${ALL_SOURCES} ) - - ################################################################# - ### ADDITIONAL LINK PROPERTIES ### - ################################################################# - IF(CAB_ADDITIONAL_LINK_FLAGS) - SET_TARGET_PROPERTIES(${EXECUTABLE_NAME} PROPERTIES LINK_FLAGS ${CAB_ADDITIONAL_LINK_FLAGS}) - ENDIF(CAB_ADDITIONAL_LINK_FLAGS) -ELSE() - IF(CAB_MACHINE) - MESSAGE("CAB_MACHINE error - following file is missing: \n ${CMAKE_CONFIG_FILE}") - ELSE() - MESSAGE("check CAB_MACHINE!!!") - ENDIF() -ENDIF() \ No newline at end of file diff --git a/src/basics/numerics/geometry3d/examples/insideOutsideTests/main.cpp b/src/basics/numerics/geometry3d/examples/insideOutsideTests/main.cpp deleted file mode 100644 index f420be84a4ef3d5a28826fabf2256b713a411981..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/examples/insideOutsideTests/main.cpp +++ /dev/null @@ -1,46 +0,0 @@ -#include <numerics/geometry3d/GbCuboid3D.h> -#include <numerics/geometry3d/GbSphere3D.h> -#include <numerics/geometry3d/GbCylinder3D.h> - -int main(int argc, char** argv) -{ - GbSphere3D test(10,10,10,8); - - bool cutSp1 /*false*/= test.isCellCuttingGbObject3D(9,9,9,11,11,11); //cell komplett IN sphere - bool cutSp2 /*true */= test.isCellCuttingGbObject3D(0,0,0,20,20,20); //cell umhuellt sphere - bool cutSp3 /*true */= test.isCellCuttingGbObject3D(0,0,0,10,10,10); //cell cutted sphere - bool cutSp4 /*false*/= test.isCellCuttingGbObject3D(100,100,100,101,101,101); //cell nix sphere - - - bool cutInsSp1 /*true */= test.isCellInsideOrCuttingGbObject3D(9,9,9,11,11,11); //cell komplett IN sphere - bool cutInsSp2 /*true */= test.isCellInsideOrCuttingGbObject3D(0,0,0,20,20,20); //cell umhuellt sphere - bool cutInsSp3 /*true */= test.isCellInsideOrCuttingGbObject3D(0,0,0,10,10,10); //cell cutted sphere - bool cutInsSp4 /*false*/= test.isCellInsideOrCuttingGbObject3D(100,100,100,101,101,101); //cell nix sphere - - GbCuboid3D test1(0,0,0,10,10,10); - - bool cutCu1 /*false*/= test1.isCellCuttingGbObject3D(4,4,4,6,6,6); //cell komplett IN cube - bool cutCu2 /*true */= test1.isCellCuttingGbObject3D(-1,-1,-1,11,11,11); //cell umhuellt cube - bool cutCu3 /*true */= test1.isCellCuttingGbObject3D(5,5,5,15,15,15); //cell cutted cube - bool cutCu4 /*false*/= test1.isCellCuttingGbObject3D(12,12,12,15,15,15); //cell nix cube - - bool cutInsCu1 /*true */= test1.isCellInsideOrCuttingGbObject3D(4,4,4,6,6,6); //cell komplett IN cube - bool cutInsCu2 /*true */= test1.isCellInsideOrCuttingGbObject3D(-1,-1,-1,11,11,11); //cell umhuellt cube - bool cutInsCu3 /*true */= test1.isCellInsideOrCuttingGbObject3D(5,5,5,15,15,15); //cell cutted cube - bool cutInsCu4 /*false*/= test1.isCellInsideOrCuttingGbObject3D(12,12,12,15,15,15); //cell nix cube - - GbCylinder3D test2( 0,0,0, 20, 0, 0, 10); - - bool cutCy1 /*false*/ = test2.isCellCuttingGbObject3D(1,-1,-1,4,1,1); //cell komplett IN cyl - bool cutCy2 /*true */ = test2.isCellCuttingGbObject3D(10,0,0,15,12,11); //cell umhuellt cyl - bool cutCy3a /*true */ = test2.isCellCuttingGbObject3D(5,5,5,15,15,15); //cell cutted cyl im kreisbreich - bool cutCy3b /*true */ = test2.isCellCuttingGbObject3D(-5,-1,-1,5,1,1); //cell cutted cyl am stirn - bool cutCy4 /*false*/= test2.isCellCuttingGbObject3D(-10,-10,-10,-5,-5,-5); //cell nix cyl - - - bool cutInsCy1 /*true */= test2.isCellInsideOrCuttingGbObject3D(4,4,4,6,6,6); //cell komplett IN cube - bool cutInsCy2 /*true */= test2.isCellInsideOrCuttingGbObject3D(10,0,0,15,12,11); //cell umhuellt cyl - bool cutInsCy3a /*true */= test2.isCellInsideOrCuttingGbObject3D(5,5,5,15,15,15); //cell cutted cyl im kreisbreich - bool cutInsCy3b /*true */= test2.isCellInsideOrCuttingGbObject3D(-5,-1,-1,5,1,1); //cell cutted cube - bool cutInsCy4 /*false*/= test2.isCellInsideOrCuttingGbObject3D(-10,-10,-10,-5,-5,-5); //cell nix cube -} \ No newline at end of file diff --git a/src/basics/numerics/geometry3d/examples/stl2inp/CMakeLists.txt b/src/basics/numerics/geometry3d/examples/stl2inp/CMakeLists.txt deleted file mode 100644 index 8046a72e2d3188e21adb33d8b46e7661d31aabea..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/examples/stl2inp/CMakeLists.txt +++ /dev/null @@ -1,140 +0,0 @@ -SET(SOURCE_ROOT $ENV{CAB_DIR} CACHE PATH "(e.g. d:/temp/source)" ) -STRING(REGEX REPLACE "\\\\" "/" SOURCE_ROOT ${SOURCE_ROOT}) # "\" --> "/" - -IF(EXISTS ${SOURCE_ROOT}) - IF(EXISTS ${SOURCE_ROOT}/basics) - - INCLUDE(${SOURCE_ROOT}/CMakeCABMacros.txt) - - PROJECT (STL2INP) - SET(EXECUTABLE_NAME stl2inp) - - ################################################################# - ### PACKAGES ### - ################################################################# - - INCLUDE(${SOURCE_ROOT}/basics/objects/CMakeLists.txt) - INCLUDE(${SOURCE_ROOT}/basics/utilities/CMakeLists.txt) - INCLUDE(${SOURCE_ROOT}/basics/relation/CMakeLists.txt) - - - INCLUDE(${SOURCE_ROOT}/numerics/geometry2d/CMakeLists.txt) - INCLUDE(${SOURCE_ROOT}/numerics/geometry2d/creator/CMakeLists.txt) - - INCLUDE(${SOURCE_ROOT}/numerics/geometry3d/CMakeLists.txt) - INCLUDE(${SOURCE_ROOT}/numerics/geometry3d/creator/CMakeLists.txt) - - INCLUDE(${SOURCE_ROOT}/octree/CMakeLists.txt) - INCLUDE(${SOURCE_ROOT}/octree/facette/CMakeLists.txt) - - INCLUDE(${SOURCE_ROOT}/quadtree/CMakeLists.txt) - INCLUDE(${SOURCE_ROOT}/quadtree/nodeadaptation/CMakeLists.txt) - - - ################################################################# - ### OWN DEFINES ### - ################################################################# - # ADD_DEFINITIONS( -DCAB_QT ) - # ADD_DEFINITIONS( -DCAB_QTONLY ) - ADD_DEFINITIONS( -DMEMPOOL_A2PIIOCTNODEVD) - SET(SPECIFIC_FILES main.cpp stl2inp.h stl2inp.cpp QDefineUniformMesh.h QDefineUniformMesh.cpp) - SET(ALL_SOURCES ${ALL_SOURCES} ${SPECIFIC_FILES}) - SOURCE_GROUP(z_specific FILES ${SPECIFIC_FILES}) - - IF(WIN32) - ADD_CXX_FLAGS("/wd4996") - ELSE(WIN32) - ADD_CXX_FLAGS("-O3 -mcpu=athlon-4 -fomit-frame-pointer -finline-functions -funroll-all-loops") - ENDIF(WIN32) - - - - ################################################################# - ### QT SPECIFIC (only has effects if a QT source is included) ### - ################################################################# - #QT specific - SET(NEED_QT "YES") - INCLUDE(${SOURCE_ROOT}/CMakeQtMacros.txt) - - IF(QT_FOUND) - INCLUDE_DIRECTORIES( ${QT_INCLUDE_DIR} - ${QT_INCLUDE_PATH} - ${QT_QTCORE_INCLUDE_DIR} - ${QT_QTGUI_INCLUDE_DIR} - ) - LINK_LIBRARIES ( ${QT_QTCORE_LIBRARY} - ${QT_QTGUI_LIBRARY} - ) - ADD_DEFINITIONS( ${QT_DEFINITIONS}) - ELSE(QT_FOUND) - IF(${NEED_QT} MATCHES "YES") - MESSAGE("Ups\nAt least one package needs Qt!\nPlease check Qt settings\n(e.g. librarys within Advanced Values)") - ENDIF(${NEED_QT} MATCHES "YES") - - - ENDIF(QT_FOUND) - - IF(QT_FOUND) - SET(SUBDIRPATH numerics/geometry3d/examples/stl2inp) - SET(CURRENT_DIR ${SOURCE_ROOT}/${SUBDIRPATH}) - - ################################################################ - ### Qt4 UI FILES ### - ################################################################ - FILE(GLOB UI_FILES ${CURRENT_DIR}/*.ui) #collect ui files - QT4_WRAP_UI(${CURRENT_DIR} OUTFILES ${UI_FILES}) #wrap ui files - REMOVE(TEMP_FILES ${OUTFILES} ) - SET(TEMP_FILES ${TEMP_FILES} ${OUTFILES} ) - - #make subfolders for VS with new files - SOURCE_GROUP(${SUBDIRPATH} FILES ${OUTFILES}) - - IF(WIN32) - SET(ALL_SOURCES ${ALL_SOURCES} ${UI_FILES}) - SOURCE_GROUP(${SUBDIRPATH} FILES ${UI_FILES}) - ENDIF(WIN32) - - ################################################################ - ### Qt4 HEADERS TO BE MOCED ### - ################################################################ - MAKE_DIRECTORY(${CURRENT_DIR}${QTGEN_MOC}) - SET(MOC_FILES ) #empty MOC_FILES - #SET(MOC_CLASSES ${CURRENT_DIR}/stl2inp.h QDefineUniformMesh.ui ) - - QT4_WRAP_CPP(${CURRENT_DIR}${QTGEN_MOC} MOC_FILES ${MOC_CLASSES}) - REMOVE(TEMP_FILES ${MOC_FILES}) - SET(TEMP_FILES ${TEMP_FILES} ${MOC_FILES}) - SOURCE_GROUP(${SUBDIRPATH}${QTGEN_MOC} FILES ${MOC_FILES}) - - SET(ALL_SOURCES ${ALL_SOURCES} ${TEMP_FILES}) - - ENDIF(QT_FOUND) - - - ################################################################# - ### ADDITIONAL_MAKE_CLEAN_FILES ### - ################################################################# - SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${GENERATED_FILES}") - - ################################################################# - ### EXCECUTABLE ### - ################################################################# - ADD_EXECUTABLE( ${EXECUTABLE_NAME} - ${ALL_SOURCES} - ) - - - ################################################################# - ### ADDITIONAL LINK PROPERTIES ### - ################################################################# - IF(CAB_ADDITIONAL_LINK_FLAGS) - SET_TARGET_PROPERTIES(${EXECUTABLE_NAME} PROPERTIES LINK_FLAGS ${CAB_ADDITIONAL_LINK_FLAGS}) - ENDIF(CAB_ADDITIONAL_LINK_FLAGS) - - ELSE(EXISTS ${SOURCE_ROOT}/basics) - MESSAGE("Set Path to \"source\" directory at\nSOURCE_ROOT\nis not correct") - ENDIF(EXISTS ${SOURCE_ROOT}/basics) -ELSE(EXISTS ${SOURCE_ROOT}) - SET(SOURCE_ROOT "CAB_DIR NOT FOUND" CACHE PATH "(e.g. d:/temp/source)" FORCE) - MESSAGE("Please Set Path to \"source\" directory at\nSOURCE_ROOT\n(e.g. D:/temp/source)") -ENDIF(EXISTS ${SOURCE_ROOT}) diff --git a/src/basics/numerics/geometry3d/examples/stl2inp/QDefineUniformMesh.cpp b/src/basics/numerics/geometry3d/examples/stl2inp/QDefineUniformMesh.cpp deleted file mode 100644 index 0676719cd8acd3bf5ccec29793bedd6e42405240..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/examples/stl2inp/QDefineUniformMesh.cpp +++ /dev/null @@ -1,17 +0,0 @@ -#include "./QDefineUniformMesh.h" -#include <QtGui/QFileDialog> -#include <QString> -#include <QFile> -#include <QMessageBox> -#include <cstdio> - - -QDefineUniformMesh::QDefineUniformMesh(QWidget *parent, Qt::WFlags flags) -{ - ui.setupUi(this); -} - -QDefineUniformMesh::~QDefineUniformMesh() -{ - -} diff --git a/src/basics/numerics/geometry3d/examples/stl2inp/QDefineUniformMesh.h b/src/basics/numerics/geometry3d/examples/stl2inp/QDefineUniformMesh.h deleted file mode 100644 index 0648b9ae20f4d9452b0e7beb087607b0613beded..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/examples/stl2inp/QDefineUniformMesh.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef QDEFINEUNIFORMMESH_H -#define QDEFINEUNIFORMMESH_H - -#include <QtGui/QDialog> -#include "./QDefineUniformMeshUI.h" - -class QDefineUniformMesh : public QDialog -{ - Q_OBJECT - -public: - QDefineUniformMesh(QWidget *parent = 0, Qt::WFlags flags = 0); - ~QDefineUniformMesh(); - - void setStartLevel(int startLevel) { ui.spinBox_startLevel->setValue(startLevel); } - void setStopLevel(int stopLevel) { ui.spinBox_stopLevel->setValue(stopLevel); } - void setDelta(double delta) { ui.doubleSpinBox_delta->setValue(delta); } - void setNX1(int nx1) { ui.spinBox_nx1->setValue(nx1); } - void setNX2(int nx2) { ui.spinBox_nx2->setValue(nx2); } - void setNX3(int nx3) { ui.spinBox_nx3->setValue(nx3); } - - int getStartLevel() { return ui.spinBox_startLevel->value(); } - int getStopLevel() { return ui.spinBox_stopLevel->value(); } - double getDelta() { return ui.doubleSpinBox_delta->value(); } - int getNX1() { return ui.spinBox_nx1->value(); } - int getNX2() { return ui.spinBox_nx2->value(); } - int getNX3() { return ui.spinBox_nx3->value(); } - -private: - Ui::QDefineUniformMesh ui; - -//private slots: -}; - -#endif // QDEFINEUNIFORMMESH_H diff --git a/src/basics/numerics/geometry3d/examples/stl2inp/QDefineUniformMesh.ui b/src/basics/numerics/geometry3d/examples/stl2inp/QDefineUniformMesh.ui deleted file mode 100644 index c03b2513f5b64cfb9a4e1a5ea3ce9cbab96e11b2..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/examples/stl2inp/QDefineUniformMesh.ui +++ /dev/null @@ -1,258 +0,0 @@ -<ui version="4.0" > - <author></author> - <comment></comment> - <exportmacro></exportmacro> - <class>QDefineUniformMesh</class> - <widget class="QDialog" name="QDefineUniformMesh" > - <property name="geometry" > - <rect> - <x>0</x> - <y>0</y> - <width>180</width> - <height>220</height> - </rect> - </property> - <property name="windowTitle" > - <string>Define Mesh Parameters</string> - </property> - <layout class="QGridLayout" > - <property name="margin" > - <number>9</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item row="0" column="0" > - <layout class="QGridLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item row="1" column="0" > - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QLabel" name="label" > - <property name="toolTip" > - <string>Stop-Level der Verfeinerung</string> - </property> - <property name="text" > - <string>Stop-Level</string> - </property> - </widget> - </item> - <item> - <widget class="QSpinBox" name="spinBox_stopLevel" /> - </item> - </layout> - </item> - <item row="0" column="0" > - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QLabel" name="label_6" > - <property name="toolTip" > - <string>Start-Level der Verfeinerung</string> - </property> - <property name="text" > - <string>Start-Level</string> - </property> - </widget> - </item> - <item> - <widget class="QSpinBox" name="spinBox_startLevel" /> - </item> - </layout> - </item> - </layout> - </item> - <item row="1" column="0" > - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QLabel" name="label_2" > - <property name="toolTip" > - <string>Größe der Zellen</string> - </property> - <property name="text" > - <string>Delta</string> - </property> - </widget> - </item> - <item> - <widget class="QDoubleSpinBox" name="doubleSpinBox_delta" /> - </item> - </layout> - </item> - <item row="3" column="0" > - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <spacer> - <property name="orientation" > - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" > - <size> - <width>131</width> - <height>31</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QPushButton" name="okButton" > - <property name="text" > - <string>OK</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="cancelButton" > - <property name="text" > - <string>Cancel</string> - </property> - </widget> - </item> - </layout> - </item> - <item row="2" column="0" > - <layout class="QVBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QLabel" name="label_3" > - <property name="toolTip" > - <string>Anzahl Zellen in X-Richtung</string> - </property> - <property name="text" > - <string>nx1</string> - </property> - </widget> - </item> - <item> - <widget class="QSpinBox" name="spinBox_nx1" /> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QLabel" name="label_4" > - <property name="toolTip" > - <string>Anzahl Zellen in Y-Richtung</string> - </property> - <property name="text" > - <string>nx2</string> - </property> - </widget> - </item> - <item> - <widget class="QSpinBox" name="spinBox_nx2" /> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QLabel" name="label_5" > - <property name="toolTip" > - <string>Anzahl Zellen in Z-Richtung</string> - </property> - <property name="text" > - <string>nx3</string> - </property> - </widget> - </item> - <item> - <widget class="QSpinBox" name="spinBox_nx3" /> - </item> - </layout> - </item> - </layout> - </item> - </layout> - </widget> - <pixmapfunction></pixmapfunction> - <resources/> - <connections> - <connection> - <sender>okButton</sender> - <signal>clicked()</signal> - <receiver>QDefineUniformMesh</receiver> - <slot>accept()</slot> - <hints> - <hint type="sourcelabel" > - <x>286</x> - <y>257</y> - </hint> - <hint type="destinationlabel" > - <x>96</x> - <y>254</y> - </hint> - </hints> - </connection> - <connection> - <sender>cancelButton</sender> - <signal>clicked()</signal> - <receiver>QDefineUniformMesh</receiver> - <slot>reject()</slot> - <hints> - <hint type="sourcelabel" > - <x>369</x> - <y>257</y> - </hint> - <hint type="destinationlabel" > - <x>179</x> - <y>282</y> - </hint> - </hints> - </connection> - </connections> -</ui> diff --git a/src/basics/numerics/geometry3d/examples/stl2inp/main.cpp b/src/basics/numerics/geometry3d/examples/stl2inp/main.cpp deleted file mode 100644 index 70f49c728e124f6692f30c79a9fdc05f3a6b84f6..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/examples/stl2inp/main.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include <iostream> -#include <cstdlib> - -#include <QtGui/QApplication> -#include "./stl2inp.h" - -int main(int argc, char *argv[]) -{ - QApplication a(argc, argv); - STL2INP w; - - w.show(); - a.connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); - return a.exec(); -} diff --git a/src/basics/numerics/geometry3d/examples/stl2inp/stl2inp.cpp b/src/basics/numerics/geometry3d/examples/stl2inp/stl2inp.cpp deleted file mode 100644 index a476b0ced782a3936d8f11d4858970eb303fbf6f..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/examples/stl2inp/stl2inp.cpp +++ /dev/null @@ -1,261 +0,0 @@ -#include "stl2inp.h" -#include <QtGui/QFileDialog> -#include <QString> -#include <QFile> -#include <QMessageBox> -#include <cstdio> - -#include "./QDefineUniformMesh.h" - -#include "./../../../../../source/basics/utilities/UbFileInputASCII.h" -#include "./../../../../../source/basics/utilities/UbFileOutputASCII.h" -#include "./../../../../../source/basics/utilities/UbFileOutputBinary.h" -#include "./../../../../../source/numerics/geometry3d/GbTriangularMesh3D.h" -#include "./../../../../../source/numerics/geometry3d/creator/GbTriangularMesh3DCreator.h" -#include "./../../../../../source/numerics/geometry3D/CoordinateTransformation3D.h" -#include "./../../../../../source/basics/utilities/UbTiming.h" -#include "./../../../../../source/octree/facette/OctFacettenGrid2.h" - -STL2INP::STL2INP(QWidget *parent, Qt::WFlags flags) -: QMainWindow(parent, flags) -{ - ui.setupUi(this); - startLevel = 0; - stopLevel = 3; - delta = 10.00; - nx1 = 30; - nx2 = 15; - nx3 = 5; - -} - -STL2INP::~STL2INP() -{ - -} - -void STL2INP::on_pBtn_Input_pressed() -{ - QString s = QFileDialog::getOpenFileName( - this, - "Choose a file", - "E:/", - "STL-Files (*.stl)"); - if(s != ""){ - ui.lineEdit_In->setText(s); - ui.statusBar->showMessage("Input-File: Filename defined", 3000); - } - else - ui.statusBar->showMessage("Input-File: No file found", 3000); - -} - -void STL2INP::on_lineEdit_In_returnPressed(){ - QString s = ui.lineEdit_In->text(); - if(s != ""){ - if(!s.endsWith(".stl",Qt::CaseSensitivity(false))) - { - s.append(".stl"); - ui.lineEdit_In->setText(s); - } - if(QFile::exists(s)) - ui.statusBar->showMessage("Inputput-File: File found", 3000); - else - ui.statusBar->showMessage("Input-File: File does not exist", 3000); - } - else - ui.statusBar->showMessage("Input-File: no Filename", 3000); -} - -void STL2INP::on_pBtn_Output_pressed(){ - QString s = QFileDialog::getSaveFileName( - this, - "Choose a filename to save under", - "E:/", - "AVS-File (*.inp)"); - if(s != ""){ - ui.lineEdit_Out->setText(s); - ui.statusBar->showMessage("Output-File: Filename defined", 3000); - } - else - ui.statusBar->showMessage("Output-File: No file defined", 3000); -} - -void STL2INP::on_lineEdit_Out_returnPressed(){ - QString s = ui.lineEdit_Out->text(); - if(s != ""){ - if(!s.endsWith(".inp",Qt::CaseSensitivity(false))) - { - s.append(".inp"); - ui.lineEdit_Out->setText(s); - } - if (QFile::exists(s)) - if(QMessageBox::question(this, - tr("Overwrite File? -- Application Name"), - tr("A file called %1 already exists." - "Do you want to overwrite it?") - .arg(s), - tr("&Yes"), tr("&No"), - QString(), 0, 1)) - ui.lineEdit_Out->setText(""); - else - ui.statusBar->showMessage("Output-File: overwrite existing File", 3000); - else - ui.statusBar->showMessage("Output-File: Filename defined", 3000); - } - else - ui.statusBar->showMessage("Output-File: No file defined", 3000); -} - -void STL2INP::on_pBtn_Output_2_pressed(){ - QString s = QFileDialog::getSaveFileName( - this, - "Choose a filename to save under", - "E:/", - "Data-File (*.dat)"); - if(s != ""){ - ui.pBtn_EditMesh->setEnabled(true); - ui.lineEdit_Out_2->setText(s); - ui.statusBar->showMessage("Output-File: Filename defined", 3000); - on_pBtn_EditMesh_pressed(); - } - else - ui.statusBar->showMessage("Output-File: No file defined", 3000); -} - -void STL2INP::on_lineEdit_Out_2_returnPressed(){ - QString s = ui.lineEdit_Out_2->text(); - if(s != ""){ - ui.pBtn_EditMesh->setEnabled(true); - if(!s.endsWith(".dat",Qt::CaseSensitivity(false))) - { - s.append(".dat"); - ui.lineEdit_Out_2->setText(s); - } - if (QFile::exists(s)) - if(QMessageBox::question(this, - tr("Overwrite File? -- Application Name"), - tr("A file called %1 already exists." - "Do you want to overwrite it?") - .arg(s), - tr("&Yes"), tr("&No"), - QString(), 0, 1)){ - ui.lineEdit_Out_2->setText(""); - ui.pBtn_EditMesh->setEnabled(false); - } - else{ - ui.statusBar->showMessage("Output-File: overwrite existing File", 3000); - ui.pBtn_EditMesh->setEnabled(true); - } - else{ - ui.statusBar->showMessage("Output-File: Filename defined", 3000); - on_pBtn_EditMesh_pressed(); - } - } - else - ui.statusBar->showMessage("Output-File: No file defined", 3000); -} - -void STL2INP::on_pBtn_Convert_pressed(){ - if(ui.lineEdit_In->text() == "") - QMessageBox::warning(this,"ERROR", "No Input-File defined!", - QMessageBox::Ok, QMessageBox::NoButton, QMessageBox::NoButton); - else if(ui.lineEdit_Out->text() == "" && ui.lineEdit_Out_2->text() == "") - QMessageBox::warning(this,"ERROR", "No Output-File defined!", - QMessageBox::Ok, QMessageBox::NoButton, QMessageBox::NoButton); - else - { - UbFileInputASCII *fileInput = new UbFileInputASCII(std::string(ui.lineEdit_In->text().toAscii())); - GbTriangularMesh3D *mesh = GbTriangularMesh3DCreator::readMeshFromSTLFile(fileInput, "Cube"); - ui.statusBar->showMessage("Input-File was read", 3000); - delete fileInput; - cout<<mesh->toString()<<endl; - if(ui.checkBox_writeAVS->isChecked()){ - if(ui.checkBox_Binary->isChecked()){ - UbFileOutputBinary *fileOutput_AVS = new UbFileOutputBinary(std::string(ui.lineEdit_Out->text().toAscii())); - mesh->writeAVSMesh(fileOutput_AVS); - delete fileOutput_AVS; - } - else{ - UbFileOutputASCII *fileOutput_AVS = new UbFileOutputASCII(std::string(ui.lineEdit_Out->text().toAscii())); - mesh->writeAVSMesh(fileOutput_AVS); - delete fileOutput_AVS; - } - ui.statusBar->showMessage("wrote AVS-Output-File"); - } - if(ui.checkBox_writeUM->isChecked()){ - cout<<"MinX:"<<mesh->getX1Minimum()<<endl; - cout<<"MaxX:"<<mesh->getX1Maximum()<<endl; - cout<<"MinY:"<<mesh->getX2Minimum()<<endl; - cout<<"MaxY:"<<mesh->getX2Maximum()<<endl; - cout<<"MinZ:"<<mesh->getX3Minimum()<<endl; - cout<<"MaxZ:"<<mesh->getX3Maximum()<<endl; - ui.statusBar->showMessage("start Writing Uniform-Mesh-File"); - double minX = 0.0; - double minY = 0.0; - double minZ = 0.0; - - CoordinateTransformation3D *trafo = new CoordinateTransformation3D(minX, minY, minZ, delta, delta, delta); - - UbTiming time; - time.initTiming(); - time.startTiming(); - - ui.statusBar->showMessage("start Building FacetteGrid", 3000); - OctFacettenGrid2 *facettegrid = new OctFacettenGrid2("FacettenGrid", nx1, nx2, nx3, startLevel, stopLevel, mesh, trafo); - ui.statusBar->showMessage("end Building FacetteGrid", 3000); - - UbFileOutputASCII out("E:/DATA/test.inp"); - facettegrid->writeCellsToAVS(&out); - - time.endTiming(); - cout<<"Dauer:"<<time.getDuration()<<endl; - cout<<"Number of cells:"<<facettegrid->getNumberOfCells()<<endl; - cout<<"after generation ..."<<endl<<endl; - double mydouble=0.0; - - time.initTiming(); - time.startTiming(); - ui.statusBar->showMessage("start writing", 3000); - UbFileOutputASCII *fileOutput_UM = new UbFileOutputASCII(std::string(ui.lineEdit_Out_2->text().toAscii())); - facettegrid->writeToUniformGridFile2(fileOutput_UM); - delete fileOutput_UM; - time.endTiming(); - cout<<"Dauer:"<<time.getDuration()<<endl; - int number = (int)facettegrid->getCells()->size(); - delete trafo; - delete mesh; - delete facettegrid; - cout<<"Ready!!!"<<endl; - ui.statusBar->showMessage("wrote Unstructured-Mesh Output-File", 3000); - } - } -} - -void STL2INP::on_checkBox_stateChanged(int) -{ - -} - -void STL2INP::on_pBtn_EditMesh_pressed() -{ - QDefineUniformMesh *meshdef = new QDefineUniformMesh(this); - meshdef->setStartLevel(startLevel); - meshdef->setStopLevel(stopLevel); - meshdef->setDelta(delta); - meshdef->setNX1(nx1); - meshdef->setNX2(nx2); - meshdef->setNX3(nx3); - meshdef->exec(); - - startLevel = meshdef->getStartLevel(); - stopLevel = meshdef->getStopLevel(); - //cout<<"Start-Level: "<<startLevel<<" Stop-Level: "<<stopLevel<<endl; - delta = meshdef->getDelta(); - //cout<<"Delta: "<<delta<<endl; - nx1 = meshdef->getNX1(); - nx2 = meshdef->getNX2(); - nx3 = meshdef->getNX3(); - //cout<<"nx1: "<<nx1<<" nx2: "<<nx2<<" nx3: "<<nx3<<endl; - delete meshdef; -} \ No newline at end of file diff --git a/src/basics/numerics/geometry3d/examples/stl2inp/stl2inp.h b/src/basics/numerics/geometry3d/examples/stl2inp/stl2inp.h deleted file mode 100644 index 353f2a2a72a2b9f6677029a4976da697cd141ef2..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/examples/stl2inp/stl2inp.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef STL2INP_H -#define STL2INP_H - -#include <QtGui/QMainWindow> -#include <QtGui/QProgressBar> -#include <QTimer> -#include "stl2inpUI.h" - -class STL2INP : public QMainWindow -{ - Q_OBJECT - -public: - STL2INP(QWidget *parent = 0, Qt::WFlags flags = 0); - ~STL2INP(); - - int startLevel, stopLevel; - double delta; - int nx1, nx2, nx3; - -private: - Ui::STL2INPClass ui; - - private slots: - void on_checkBox_stateChanged(int); - void on_pBtn_Input_pressed(); - void on_pBtn_Output_pressed(); - void on_pBtn_Output_2_pressed(); - void on_pBtn_Convert_pressed(); - void on_lineEdit_In_returnPressed(); - void on_lineEdit_Out_returnPressed(); - void on_lineEdit_Out_2_returnPressed(); - void on_pBtn_EditMesh_pressed(); -}; - -#endif // STL2INP_H diff --git a/src/basics/numerics/geometry3d/examples/stl2inp/stl2inp.ui b/src/basics/numerics/geometry3d/examples/stl2inp/stl2inp.ui deleted file mode 100644 index 28d3ab49ca511a249430e804088b461320d72d0a..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/examples/stl2inp/stl2inp.ui +++ /dev/null @@ -1,452 +0,0 @@ -<ui version="4.0" > - <author></author> - <comment></comment> - <exportmacro></exportmacro> - <class>STL2INPClass</class> - <widget class="QMainWindow" name="STL2INPClass" > - <property name="geometry" > - <rect> - <x>0</x> - <y>0</y> - <width>400</width> - <height>350</height> - </rect> - </property> - <property name="windowTitle" > - <string>STL2INP</string> - </property> - <property name="statusTip" > - <string>...</string> - </property> - <widget class="QWidget" name="centralWidget" > - <layout class="QGridLayout" > - <property name="margin" > - <number>9</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item row="4" column="0" colspan="2" > - <widget class="QGroupBox" name="groupBox_2" > - <property name="title" > - <string>Output-Files</string> - </property> - <layout class="QGridLayout" > - <property name="margin" > - <number>9</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item row="0" column="0" > - <widget class="QCheckBox" name="checkBox_writeAVS" > - <property name="text" > - <string>write AVS-File</string> - </property> - </widget> - </item> - <item row="0" column="1" colspan="3" > - <widget class="QCheckBox" name="checkBox_Binary" > - <property name="text" > - <string>write *.inp to Binary</string> - </property> - </widget> - </item> - <item row="4" column="0" > - <widget class="QCheckBox" name="checkBox_writeUM" > - <property name="text" > - <string>write Uniform-Mesh-File</string> - </property> - </widget> - </item> - <item row="1" column="0" colspan="3" > - <widget class="QLineEdit" name="lineEdit_Out" > - <property name="enabled" > - <bool>false</bool> - </property> - <property name="minimumSize" > - <size> - <width>300</width> - <height>17</height> - </size> - </property> - </widget> - </item> - <item row="5" column="3" > - <widget class="QPushButton" name="pBtn_Output_2" > - <property name="enabled" > - <bool>false</bool> - </property> - <property name="maximumSize" > - <size> - <width>25</width> - <height>23</height> - </size> - </property> - <property name="text" > - <string>...</string> - </property> - </widget> - </item> - <item row="5" column="0" colspan="3" > - <widget class="QLineEdit" name="lineEdit_Out_2" > - <property name="enabled" > - <bool>false</bool> - </property> - <property name="minimumSize" > - <size> - <width>300</width> - <height>17</height> - </size> - </property> - </widget> - </item> - <item row="1" column="3" > - <widget class="QPushButton" name="pBtn_Output" > - <property name="enabled" > - <bool>false</bool> - </property> - <property name="maximumSize" > - <size> - <width>25</width> - <height>23</height> - </size> - </property> - <property name="text" > - <string>...</string> - </property> - </widget> - </item> - <item rowspan="2" row="2" column="0" colspan="4" > - <widget class="Line" name="line" > - <property name="orientation" > - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item rowspan="2" row="3" column="2" colspan="2" > - <widget class="QPushButton" name="pBtn_EditMesh" > - <property name="enabled" > - <bool>false</bool> - </property> - <property name="minimumSize" > - <size> - <width>51</width> - <height>20</height> - </size> - </property> - <property name="maximumSize" > - <size> - <width>51</width> - <height>20</height> - </size> - </property> - <property name="text" > - <string>Edit Mesh</string> - </property> - </widget> - </item> - <item row="4" column="1" > - <spacer> - <property name="orientation" > - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" > - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </widget> - </item> - <item row="0" column="0" > - <widget class="QLabel" name="label_3" > - <property name="font" > - <font> - <family>Tahoma</family> - <pointsize>14</pointsize> - <weight>75</weight> - <italic>false</italic> - <bold>true</bold> - <underline>false</underline> - <strikeout>false</strikeout> - </font> - </property> - <property name="text" > - <string>STL2INP</string> - </property> - </widget> - </item> - <item row="1" column="0" > - <spacer> - <property name="orientation" > - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" > - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item row="6" column="0" > - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QPushButton" name="pushButton_4" > - <property name="text" > - <string>EXIT</string> - </property> - </widget> - </item> - <item> - <spacer> - <property name="orientation" > - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" > - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QPushButton" name="pBtn_Convert" > - <property name="text" > - <string>Convert</string> - </property> - </widget> - </item> - </layout> - </item> - <item row="5" column="0" > - <spacer> - <property name="orientation" > - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" > - <size> - <width>20</width> - <height>21</height> - </size> - </property> - </spacer> - </item> - <item row="2" column="0" > - <widget class="QGroupBox" name="groupBox" > - <property name="title" > - <string>Input-File</string> - </property> - <layout class="QGridLayout" > - <property name="margin" > - <number>9</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item row="0" column="1" > - <widget class="QPushButton" name="pBtn_Input" > - <property name="maximumSize" > - <size> - <width>25</width> - <height>23</height> - </size> - </property> - <property name="text" > - <string>...</string> - </property> - </widget> - </item> - <item row="0" column="0" > - <widget class="QLineEdit" name="lineEdit_In" > - <property name="minimumSize" > - <size> - <width>300</width> - <height>17</height> - </size> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item row="3" column="0" > - <spacer> - <property name="orientation" > - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" > - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </widget> - <widget class="QStatusBar" name="statusBar" > - <property name="geometry" > - <rect> - <x>0</x> - <y>331</y> - <width>400</width> - <height>19</height> - </rect> - </property> - </widget> - </widget> - <layoutdefault spacing="6" margin="11" /> - <pixmapfunction></pixmapfunction> - <tabstops> - <tabstop>lineEdit_In</tabstop> - <tabstop>pBtn_Input</tabstop> - <tabstop>lineEdit_Out</tabstop> - <tabstop>pBtn_Output</tabstop> - <tabstop>checkBox_Binary</tabstop> - <tabstop>pBtn_Convert</tabstop> - <tabstop>pushButton_4</tabstop> - </tabstops> - <resources/> - <connections> - <connection> - <sender>pushButton_4</sender> - <signal>clicked()</signal> - <receiver>STL2INPClass</receiver> - <slot>close()</slot> - <hints> - <hint type="sourcelabel" > - <x>82</x> - <y>320</y> - </hint> - <hint type="destinationlabel" > - <x>222</x> - <y>349</y> - </hint> - </hints> - </connection> - <connection> - <sender>checkBox_writeAVS</sender> - <signal>clicked(bool)</signal> - <receiver>lineEdit_Out</receiver> - <slot>setEnabled(bool)</slot> - <hints> - <hint type="sourcelabel" > - <x>43</x> - <y>189</y> - </hint> - <hint type="destinationlabel" > - <x>99</x> - <y>210</y> - </hint> - </hints> - </connection> - <connection> - <sender>checkBox_writeAVS</sender> - <signal>clicked(bool)</signal> - <receiver>pBtn_Output</receiver> - <slot>setEnabled(bool)</slot> - <hints> - <hint type="sourcelabel" > - <x>130</x> - <y>189</y> - </hint> - <hint type="destinationlabel" > - <x>380</x> - <y>209</y> - </hint> - </hints> - </connection> - <connection> - <sender>checkBox_writeUM</sender> - <signal>clicked(bool)</signal> - <receiver>lineEdit_Out_2</receiver> - <slot>setEnabled(bool)</slot> - <hints> - <hint type="sourcelabel" > - <x>74</x> - <y>237</y> - </hint> - <hint type="destinationlabel" > - <x>88</x> - <y>258</y> - </hint> - </hints> - </connection> - <connection> - <sender>checkBox_writeUM</sender> - <signal>clicked(bool)</signal> - <receiver>pBtn_Output_2</receiver> - <slot>setEnabled(bool)</slot> - <hints> - <hint type="sourcelabel" > - <x>152</x> - <y>237</y> - </hint> - <hint type="destinationlabel" > - <x>380</x> - <y>257</y> - </hint> - </hints> - </connection> - <connection> - <sender>lineEdit_In</sender> - <signal>selectionChanged()</signal> - <receiver>pBtn_Input</receiver> - <slot>animateClick()</slot> - <hints> - <hint type="sourcelabel" > - <x>236</x> - <y>105</y> - </hint> - <hint type="destinationlabel" > - <x>345</x> - <y>98</y> - </hint> - </hints> - </connection> - <connection> - <sender>lineEdit_Out</sender> - <signal>selectionChanged()</signal> - <receiver>pBtn_Output</receiver> - <slot>animateClick()</slot> - <hints> - <hint type="sourcelabel" > - <x>302</x> - <y>203</y> - </hint> - <hint type="destinationlabel" > - <x>362</x> - <y>202</y> - </hint> - </hints> - </connection> - <connection> - <sender>lineEdit_Out_2</sender> - <signal>selectionChanged()</signal> - <receiver>pBtn_Output_2</receiver> - <slot>animateClick()</slot> - <hints> - <hint type="sourcelabel" > - <x>256</x> - <y>249</y> - </hint> - <hint type="destinationlabel" > - <x>365</x> - <y>253</y> - </hint> - </hints> - </connection> - </connections> -</ui> diff --git a/src/basics/numerics/geometry3d/fem/FeAdhocTriFaceMesh3D.cpp b/src/basics/numerics/geometry3d/fem/FeAdhocTriFaceMesh3D.cpp deleted file mode 100644 index 86b7cc239d0a33da9db6a6263d8959863bcfa0da..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/fem/FeAdhocTriFaceMesh3D.cpp +++ /dev/null @@ -1,124 +0,0 @@ -#include "./FeAdhocTriFaceMesh3D.h" - -#include "./../GbPoint3D.h" -#include "./../GbTriangle3D.h" -#include "./../GbTriangularMesh3D.h" - -#include "./../../../basics/utilities/UbFileOutputASCII.h" -#include "./../../../basics/utilities/UbLogger.h" - -/*====================================================*/ -FeAdhocTriFaceMesh3D::FeAdhocTriFaceMesh3D():FeTriFaceMesh3D() -{ -} -/*====================================================*/ -FeAdhocTriFaceMesh3D::FeAdhocTriFaceMesh3D(std::string name, Mesh* mesh):FeTriFaceMesh3D() -{ - this->mesh = mesh; - this->setName(name); - - std::cout << "FeAdhocTriFaceMesh3D:Konstruktor !!!"<<std::endl; - std::cout << "num vertices: " << mesh->VL->nitem << ", num triangles: " << mesh->TL->nitem - << ", num quads: " << mesh->QL->nitem << std::endl; - - // this->writeAdhoCMeshForStefan("/scratch/geller/StudienMitAdhoC3D/mesh.inp"); - this->adhocVertices = new vector< ::Vertex*>; - - List *vertexlist = mesh->VL; - List *elementlist = mesh->TL; - - ListItem* LI; - ListItem* LI2; - Tri* triangle; - // double z1, z2, z3; - int id1, id2, id3; - ::Vertex *v1, *v2, *v3; - - //if (mesh->VL->status==open) close_Vertex_List(mesh->VL); - - FOR_ALL(vertexlist->first, LI, 0) - { - ::Vertex* V = get_Vertex(LI); - this->nodes->push_back(GbTriFaceMesh3D::Vertex((float)V->x, (float)V->y, (float)V->z)); - this->adhocVertices->push_back(V); - } - int countTris=0; - int fred=0; - FOR_ALL(elementlist->first, LI, 0) - { - triangle = get_Tri(LI); - if(triangle==NULL) UBLOG(logINFO, "hugo - dreieck ist NULL"); - v1 = triangle->V[0]; - v2 = triangle->V[1]; - v3 = triangle->V[2]; - int count=0; - id1=-1; id2=-1; id3=-1; - FOR_ALL(vertexlist->first, LI2, 0) - { - ::Vertex* V = get_Vertex(LI2); - if(v1==V) id1=count; - if(v2==V) id2=count; - if(v3==V) id3=count; - if((id1!=-1) && (id2!=-1) && (id3!=-1)) - { - break; - } - count++; - } - // this->triangles->push_back(GbTriFaceMesh3D::TriFace(v1->id, v2->id, v3->id)); - // das geht bei Winkelplatte und Bathe - this->triangles->push_back(GbTriFaceMesh3D::TriFace(id2, id1, id3)); - // this->triangles->push_back(GbTriFaceMesh3D::TriFace(id1, id2, id3)); - countTris++; - } - - std::cout<<"#################################"<<std::endl; - std::cout<<"countTris:"<<countTris<<std::endl; - std::cout<<"vecSize:"<<this->triangles->size()<<std::endl; - this->attributes->resize(nodes->size()); - - countTris=0; - for(int u=0;u<(int)this->triangles->size(); u++) - { - double area = (*this->triangles)[u].getArea(*this->nodes); - if(UbMath::zero(area)) countTris++; - } - std::cout<<"#################################"<<std::endl; - std::cout<<"Area 0 für:"<<countTris<<" Dreiecke"<<std::endl; - - this->calculateValues(); - - this->createVertexTriFaceMap(); -} -/*===============================================================================*/ -void FeAdhocTriFaceMesh3D::writeAdhoCMeshForStefan(string filename) -{ - std::cout << "FeAdhocTriFaceMesh3D::writeAdhoCMeshForStefan ...\n"; - List *elementlist = mesh->TL; - - ListItem* LI; - Tri* triangle; - - vector<GbPoint3D*>* tmnodes = new vector<GbPoint3D*>; - vector<GbTriangle3D*>* tmtriangles = new vector<GbTriangle3D*>; - - FOR_ALL(elementlist->first, LI, 0) - { - triangle = get_Tri(LI); - - GbPoint3D *node1 = new GbPoint3D(triangle->V[0]->x, triangle->V[0]->y, triangle->V[0]->z); - GbPoint3D *node2 = new GbPoint3D(triangle->V[1]->x, triangle->V[1]->y, triangle->V[1]->z); - GbPoint3D *node3 = new GbPoint3D(triangle->V[2]->x, triangle->V[2]->y, triangle->V[2]->z); - - tmnodes->push_back(node1); - tmnodes->push_back(node2); - tmnodes->push_back(node3); - tmtriangles->push_back(new GbTriangle3D(node1, node2, node3)); - - } - - GbTriangularMesh3D tmmesh("Name", tmnodes, tmtriangles); - UbFileOutputASCII out(filename); - tmmesh.writeAVSMesh(&out); -} - diff --git a/src/basics/numerics/geometry3d/fem/FeAdhocTriFaceMesh3D.h b/src/basics/numerics/geometry3d/fem/FeAdhocTriFaceMesh3D.h deleted file mode 100644 index 99a0a983fc1783d8f4931b1411be9b75c97b9e72..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/fem/FeAdhocTriFaceMesh3D.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef FEADHOCTRIFACEMESH3D_H -#define FEADHOCTRIFACEMESH3D_H - -#include <sstream> -#include <iostream> -#include <vector> -using namespace std; - -//extern "C" -//{ - //#include "mshpi.h" - #include "fsi_interface.h" - #include "fsi_user_interface.h" -//} - -#include "./FeTriFaceMesh3D.h" - -#ifdef CAB_RCF -#include <3rdParty/rcf/RcfSerializationIncludes.h> -#endif //CAB_RCF - - -/*=========================================================================*/ -/* FeAdhocTriFaceMesh3D */ -/* */ -/** - * This Class provides the triangular meshes. - * Note, that up to now no methods for checking consistency are included. - * in this context this class describes facettes from an 3D-object !!! -*/ -class FeAdhocTriFaceMesh3D : public FeTriFaceMesh3D -{ -public: - FeAdhocTriFaceMesh3D(); - FeAdhocTriFaceMesh3D(std::string name, Mesh *mesh); - - Mesh* getMesh() { return mesh; } - - void writeAdhoCMeshForStefan(string filename); - std::vector< ::Vertex*>* getAdhocVertices() { return this->adhocVertices; } - -#ifdef CAB_RCF - template<class Archive> - void serialize(Archive & ar, const unsigned int version) - { - serializeParent<FeTriFaceMesh3D>(ar, *this); - } -#endif //CAB_RCF - -private: - Mesh* mesh; - std::vector< ::Vertex*>* adhocVertices; -}; - -#ifdef RCF_USE_SF_SERIALIZATION -UB_AUTO_RUN_NAMED( SF::registerType<FeAdhocTriFaceMesh3D >("FeAdhocTriFaceMesh3D ") , SF_FeAdhocTriFaceMesh3D ); -UB_AUTO_RUN_NAMED( ( SF::registerBaseAndDerived< FeTriFaceMesh3D, FeAdhocTriFaceMesh3D>() ), SF_FeAdhocTriFaceMesh3D_BD1 ); -UB_AUTO_RUN_NAMED( ( SF::registerBaseAndDerived< GbTriFaceMesh3D, FeAdhocTriFaceMesh3D>() ), SF_FeAdhocTriFaceMesh3D_BD2 ); -UB_AUTO_RUN_NAMED( ( SF::registerBaseAndDerived< GbObject3D, FeAdhocTriFaceMesh3D>() ), SF_FeAdhocTriFaceMesh3D_BD3 ); -#endif //RCF_USE_SF_SERIALIZATION - -#endif //FEADHOCTRIFACEMESH3D_H diff --git a/src/basics/numerics/geometry3d/fem/FeHalfDisc3D.cpp b/src/basics/numerics/geometry3d/fem/FeHalfDisc3D.cpp deleted file mode 100644 index b3751d20d04f2968c0d6cb97d25333c26d371463..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/fem/FeHalfDisc3D.cpp +++ /dev/null @@ -1,622 +0,0 @@ -#include <numerics/geometry3d/fem/FeHalfDisc3D.h> -#include <numerics/geometry3d/GbSystem3D.h> -#include <numerics/geometry3d/GbLine3D.h> -#include <numerics/geometry3d/GbTriangle3D.h> -#include <numerics/geometry3d/fem/FePoint3D.h> -#include <basics/utilities/UbInfinity.h> - -using namespace std; - -/*=======================================================*/ -ObObjectCreator* FeHalfDisc3D::getCreator() -{ - return NULL;//FeHalfDisc3DCreator::getInstance(); -} -// Konstruktor -/*==========================================================*/ -FeHalfDisc3D::FeHalfDisc3D() -{ - GbPoint3D* p1 = new GbPoint3D(); - GbPoint3D* p2 = new GbPoint3D(); - mLine = new GbLine3D(p1,p2); - this->mLine->addObserver(this); - mRad = 0.0; - cylinderType = FeHalfDisc3D::NOTPARALLELTOAXIS; -} -/*=======================================================*/ -FeHalfDisc3D::FeHalfDisc3D(FeHalfDisc3D* cylinder) -{ - mRad = cylinder->getRadius(); - cylinderType = cylinder->cylinderType; - mLine = cylinder->getLine()->clone(); - - this->mLine->addObserver(this); -} -/*==========================================================*/ -FeHalfDisc3D::FeHalfDisc3D(const double& x1a,const double& x2a, const double& x3a, const double& x1b,const double& x2b, const double& x3b, const double& rad) -{ - mLine = new GbLine3D; - mLine->setPoints( new GbPoint3D(min(x1a,x1b), min(x2a,x2b), min(x3a,x3b)) - ,new GbPoint3D(max(x1a,x1b), max(x2a,x2b), max(x3a,x3b))); - this->mLine->addObserver(this); - mRad = fabs(rad); - - this->initCylinderType(); - if((this->cylinderType & NOTPARALLELTOAXIS)==NOTPARALLELTOAXIS) - throw UbException(UB_EXARGS,"derzeit nur zu Achsen orthogonale Cylinder erlaubt... isPointInObject3D funzt sonst ned"); -} -/*==========================================================*/ -FeHalfDisc3D::FeHalfDisc3D(GbPoint3D* p1, GbPoint3D* p2, const double& rad) -{ - mRad = rad; - - mLine = new GbLine3D(p1,p2); - this->mLine->addObserver(this); - this->initCylinderType(); - if((this->cylinderType & NOTPARALLELTOAXIS)==NOTPARALLELTOAXIS) - throw UbException(UB_EXARGS,"derzeit nur zu Achsen orthogonale Cylinder erlaubt... isPointInObject3D funzt sonst ned"); -} -/*==========================================================*/ -FeHalfDisc3D::FeHalfDisc3D(GbLine3D* line, const double& rad) -{ - mRad = rad; - - this->mLine = line; - this->mLine->addObserver(this); - this->initCylinderType(); - if((this->cylinderType & NOTPARALLELTOAXIS)==NOTPARALLELTOAXIS) - throw UbException(UB_EXARGS,"derzeit nur zu Achsen orthogonale Cylinder erlaubt... isPointInObject3D funzt sonst ned"); -} -/*==========================================================*/ -// Destruktor -FeHalfDisc3D::~FeHalfDisc3D() -{ - if(mLine) this->mLine->removeObserver(this); - mLine = NULL; -} -/*=======================================================*/ -void FeHalfDisc3D::initCylinderType() -{ - double x1a = mLine->getPoint1()->x1; double x1b = mLine->getPoint2()->x1; - double x2a = mLine->getPoint1()->x2; double x2b = mLine->getPoint2()->x2; - double x3a = mLine->getPoint1()->x3; double x3b = mLine->getPoint2()->x3; - - if (x1a!=x1b && x2a==x2b && x3a==x3b) this->cylinderType = X1PARALLEL; - else if(x2a!=x2b && x1a==x1b && x3a==x3b) this->cylinderType = X2PARALLEL; - else if(x3a!=x3b && x1a==x1b && x2a==x2b) this->cylinderType = X3PARALLEL; - else this->cylinderType = NOTPARALLELTOAXIS; -} -/*=======================================================*/ -void FeHalfDisc3D::finalize() -{ - if(this->mLine) - { - mLine->finalize(); - delete mLine; - mLine=NULL; - } -} -/*=======================================================*/ -double FeHalfDisc3D::getHeight() -{ - if(mLine) return mLine->getLength(); return 0.0; -} -/*=======================================================*/ -GbPoint3D* FeHalfDisc3D::getPoint1() -{ - if(this->mLine) return this->mLine->getPoint1(); - return NULL; -} -/*=======================================================*/ -GbPoint3D* FeHalfDisc3D::getPoint2() -{ - if(this->mLine) return this->mLine->getPoint2(); - return NULL; -} -/*=======================================================*/ -void FeHalfDisc3D::setRadius(const double& radius) -{ - this->mRad = std::fabs(radius); - this->notifyObserversObjectChanged(); -} -/*=======================================================*/ -void FeHalfDisc3D::setLine(GbLine3D* line) -{ - if(this->mLine) this->mLine->removeObserver(this); - this->mLine = line; - this->mLine->addObserver(this); - this->initCylinderType(); - - this->notifyObserversObjectChanged(); -} -/*=======================================================*/ -void FeHalfDisc3D::setPoint1(const double& x1, const double& x2, const double& x3) -{ - if(!mLine->getPoint1()) throw UbException(UB_EXARGS,"line has no point1"); - mLine->getPoint1()->setCoordinates(x1,x2,x3); - this->initCylinderType(); - - //this->notifyObserversObjectChanged(); //wird automatisch aufgerufen, da der point (this) benachrichtigt... -} -/*=======================================================*/ -void FeHalfDisc3D::setPoint2(const double& x1, const double& x2, const double& x3) -{ - if(!mLine->getPoint2()) throw UbException(UB_EXARGS,"line has no point2"); - mLine->getPoint2()->setCoordinates(x1,x2,x3); - this->initCylinderType(); - - //this->notifyObserversObjectChanged(); //wird automatisch aufgerufen, da der point (this) benachrichtigt... -} -/*==========================================================*/ -double FeHalfDisc3D::getX1Centroid() -{ - return mLine->getX1Centroid(); -} -/*==========================================================*/ -double FeHalfDisc3D::getX1Minimum() -{ - if (this->isParallelToX1Axis()) return mLine->getX1Minimum(); - else if(this->isParallelToX2Axis()) return mLine->getX1Centroid()-mRad; - else if(this->isParallelToX3Axis()) return mLine->getX1Centroid()-mRad; - else throw UbException(UB_EXARGS,"derzeit nur zu Achsen orthogonale Cylinder erlaubt... isPointInObject3D funzt sonst ned"); -} -/*==========================================================*/ -double FeHalfDisc3D::getX1Maximum() -{ - if (this->isParallelToX1Axis()) return mLine->getX1Maximum(); - else if(this->isParallelToX2Axis()) return mLine->getX1Centroid()+mRad; - else if(this->isParallelToX3Axis()) return mLine->getX1Centroid()+mRad; - else throw UbException(UB_EXARGS,"derzeit nur zu Achsen orthogonale Cylinder erlaubt... isPointInObject3D funzt sonst ned"); -} -/*==========================================================*/ -double FeHalfDisc3D::getX2Centroid() -{ - return mLine->getX2Centroid(); -} -/*==========================================================*/ -double FeHalfDisc3D::getX2Minimum() -{ - if (this->isParallelToX1Axis()) return mLine->getX2Centroid()-mRad; - else if(this->isParallelToX2Axis()) return mLine->getX2Minimum(); - else if(this->isParallelToX3Axis()) return mLine->getX2Centroid()-mRad; - else throw UbException(UB_EXARGS,"derzeit nur zu Achsen orthogonale Cylinder erlaubt... isPointInObject3D funzt sonst ned"); -} -/*==========================================================*/ -double FeHalfDisc3D::getX2Maximum() -{ - if (this->isParallelToX1Axis()) return mLine->getX2Centroid()+mRad; - else if(this->isParallelToX2Axis()) return mLine->getX2Maximum(); - else if(this->isParallelToX3Axis()) return mLine->getX2Centroid()+mRad; - else throw UbException(UB_EXARGS,"derzeit nur zu Achsen orthogonale Cylinder erlaubt... isPointInObject3D funzt sonst ned"); -} -/*==========================================================*/ -double FeHalfDisc3D::getX3Centroid() -{ - return mLine->getX3Centroid(); -} -/*==========================================================*/ -double FeHalfDisc3D::getX3Minimum() -{ - if (this->isParallelToX1Axis()) return mLine->getX3Centroid()-mRad; - else if(this->isParallelToX2Axis()) return mLine->getX3Centroid()-mRad; - else if(this->isParallelToX3Axis()) return mLine->getX3Minimum(); - else throw UbException(UB_EXARGS,"derzeit nur zu Achsen orthogonale Cylinder erlaubt... isPointInObject3D funzt sonst ned"); -} -/*==========================================================*/ -double FeHalfDisc3D::getX3Maximum() -{ - if (this->isParallelToX1Axis()) return mLine->getX3Centroid()+mRad; - else if(this->isParallelToX2Axis()) return mLine->getX3Centroid()+mRad; - else if(this->isParallelToX3Axis()) return mLine->getX3Maximum(); - else throw UbException(UB_EXARGS,"derzeit nur zu Achsen orthogonale Cylinder erlaubt... isPointInObject3D funzt sonst ned"); -} -/*==========================================================*/ -bool FeHalfDisc3D::isPointInGbObject3D(const double& x1p, const double& x2p, const double& x3p) -{ - throw UbException(UB_EXARGS,"sollte mal einer machen ... "); -} -/*==========================================================*/ -bool FeHalfDisc3D::isPointInGbObject3D(const double& x1p, const double& x2p, const double& x3p, bool& pointIsOnBoundary) -{ - throw UbException(UB_EXARGS,"sollte mal einer machen ... "); -} -/*=======================================================*/ -bool FeHalfDisc3D::isCellInsideGbObject3D(const double& x1a,const double& x2a,const double& x3a,const double& x1b,const double& x2b,const double& x3b) -{ - throw UbException(UB_EXARGS,"sollte mal einer machen ... "); -} - -/*==========================================================*/ -string FeHalfDisc3D::toString() -{ - stringstream ss; - ss<<"FeHalfDisc3D["; - ss<<"line="<<this->mLine->toString(); - ss<<", r="<<this->mRad; - ss<<"]"; - return(ss.str()); -} -/*==========================================================*/ -bool FeHalfDisc3D::isCellInsideOrCuttingGbObject3D(const double& x1a,const double& x2a,const double& x3a,const double& x1b,const double& x2b,const double& x3b) -{ - throw UbException(UB_EXARGS,"sollte mal einer machen ... "); -} -/*==========================================================*/ -bool FeHalfDisc3D::isCellCuttingGbObject3D(const double& x1a,const double& x2a,const double& x3a,const double& x1b,const double& x2b,const double& x3b) -{ - throw UbException(UB_EXARGS,"sollte mal einer machen ... "); -} -/*==========================================================*/ -GbLine3D* FeHalfDisc3D::createClippedLine3D(GbPoint3D& point1, GbPoint3D& point2) -{ - throw UbException(UB_EXARGS,"sollte mal einer machen ... "); -} -/*==========================================================*/ -vector<GbTriangle3D*> FeHalfDisc3D::getSurfaceTriangleSet() -{ - double x1ma,x1mb,x2m,x3m; - if( this->isParallelToX1Axis() ) - { - x1ma = this->getX1Minimum(); - x1mb = this->getX1Maximum(); - x2m = this->getX2Centroid(); - x3m = this->getX3Centroid(); - } - else if( this->isParallelToX2Axis() ) - { - x1ma = this->getX2Minimum(); - x1mb = this->getX2Maximum(); - x2m = this->getX1Centroid(); - x3m = this->getX3Centroid(); - } - else if( this->isParallelToX3Axis() ) - { - x1ma = this->getX3Minimum(); - x1mb = this->getX3Maximum(); - x2m = this->getX2Centroid(); - x3m = this->getX1Centroid(); - } - else throw UbException(UB_EXARGS,"cylinder is not axis prallel"); - - vector<GbTriangle3D*> triangles; - - int segmentsCircle = 14; - double deltaPhi = UbMath::PI/(double)segmentsCircle; - - double phiX1a,phiX1b; - double x1a,x2a,x3a,x1b,x2b,x3b,x1c,x2c,x3c,x1d,x2d,x3d; - - double dXCylinder = fabs((x1mb-x1ma)); ///(double)0.5; - int segmentsCylinder = (int)(fabs(x1mb-x1ma)/dXCylinder); - for(int segCyl = 0; segCyl<segmentsCylinder; segCyl++) - { - x1a = x1d = x1ma+segCyl*dXCylinder; - x1b = x1c = x1a+dXCylinder; - - for(phiX1a=UbMath::PI-deltaPhi; phiX1a>-deltaPhi; phiX1a-=deltaPhi) - { - phiX1b = phiX1a+deltaPhi; - - x2a = x2m+mRad*std::sin(phiX1a); - x3a = x3m+mRad*std::cos(phiX1a); - x2b = x2m+mRad*std::sin(phiX1b); - x3b = x3m+mRad*std::cos(phiX1b); - - if( this->isParallelToX1Axis() ) - { - triangles.push_back(new GbTriangle3D(new FePoint3D(x1b,x2a,x3a),new FePoint3D(x1b,x2b,x3b),new FePoint3D(x1a,x2a,x3a))); - triangles.push_back(new GbTriangle3D(new FePoint3D(x1a,x2b,x3b),new FePoint3D(x1a,x2a,x3a),new FePoint3D(x1b,x2b,x3b))); - } - else if( this->isParallelToX2Axis() ) - { - triangles.push_back(new GbTriangle3D(new FePoint3D(x2b,x1b,x3b),new FePoint3D(x2a,x1b,x3a),new FePoint3D(x2a,x1a,x3a))); - triangles.push_back(new GbTriangle3D(new FePoint3D(x2a,x1a,x3a),new FePoint3D(x2b,x1a,x3b),new FePoint3D(x2b,x1b,x3b))); - } - else if( this->isParallelToX3Axis() ) - { - triangles.push_back(new GbTriangle3D(new FePoint3D(x3b,x2b,x1b),new FePoint3D(x3a,x2a,x1b),new FePoint3D(x3a,x2a,x1a))); - triangles.push_back(new GbTriangle3D(new FePoint3D(x3a,x2a,x1a),new FePoint3D(x3b,x2b,x1a),new FePoint3D(x3b,x2b,x1b))); - } - - } - } - - x2a = x2m; - x3a = x3m; - x2d = x2m; - x3d = x3m+mRad; - x3b = x3m; - x3c = x3m-mRad; - - triangles.push_back(new GbTriangle3D(new FePoint3D(x1ma,x2a,x3a),new FePoint3D(x1mb,x2a,x3a),new FePoint3D(x1ma,x2a,x3d))); - triangles.push_back(new GbTriangle3D(new FePoint3D(x1ma,x2a,x3d),new FePoint3D(x1mb,x2a,x3a),new FePoint3D(x1mb,x2a,x3d))); - triangles.push_back(new GbTriangle3D(new FePoint3D(x1mb,x2a,x3b),new FePoint3D(x1ma,x2a,x3b),new FePoint3D(x1ma,x2a,x3c))); - triangles.push_back(new GbTriangle3D(new FePoint3D(x1mb,x2a,x3b),new FePoint3D(x1ma,x2a,x3c),new FePoint3D(x1mb,x2a,x3c))); - - for(phiX1a=UbMath::PI-deltaPhi; phiX1a>-deltaPhi; phiX1a-=deltaPhi) - { - phiX1b = phiX1a+deltaPhi; - - x2a = x2m; - x3a = x3m; - x2b = x2m; - x3b = x3m; - x2c = x2m+mRad*std::sin(phiX1b); - x3c = x3m+mRad*std::cos(phiX1b); - x2d = x2m+mRad*std::sin(phiX1a); - x3d = x3m+mRad*std::cos(phiX1a); - - if( this->isParallelToX1Axis() ) - { - triangles.push_back(new GbTriangle3D(new FePoint3D(x1ma,x2d,x3d),new FePoint3D(x1ma,x2c,x3c),new FePoint3D(x1ma,x2a,x3a))); - triangles.push_back(new GbTriangle3D(new FePoint3D(x1mb,x2d,x3d),new FePoint3D(x1mb,x2a,x3a),new FePoint3D(x1mb,x2c,x3c))); - } - else if( this->isParallelToX2Axis() ) - { - triangles.push_back(new GbTriangle3D(new FePoint3D(x2a,x1ma,x3a),new FePoint3D(x2b,x1ma,x3b),new FePoint3D(x2c,x1ma,x3c))); - triangles.push_back(new GbTriangle3D(new FePoint3D(x2c,x1ma,x3c),new FePoint3D(x2d,x1ma,x3d),new FePoint3D(x2a,x1ma,x3a))); - triangles.push_back(new GbTriangle3D(new FePoint3D(x2c,x1mb,x3c),new FePoint3D(x2b,x1mb,x3b),new FePoint3D(x2a,x1mb,x3a))); - triangles.push_back(new GbTriangle3D(new FePoint3D(x2a,x1mb,x3a),new FePoint3D(x2d,x1mb,x3d),new FePoint3D(x2c,x1mb,x3c))); - } - else if( this->isParallelToX3Axis() ) - { - triangles.push_back(new GbTriangle3D(new FePoint3D(x3a,x2a,x1ma),new FePoint3D(x3b,x2b,x1ma),new FePoint3D(x3c,x2c,x1ma))); - triangles.push_back(new GbTriangle3D(new FePoint3D(x3c,x2c,x1ma),new FePoint3D(x3d,x2d,x1ma),new FePoint3D(x3a,x2a,x1ma))); - triangles.push_back(new GbTriangle3D(new FePoint3D(x3c,x2c,x1mb),new FePoint3D(x3b,x2b,x1mb),new FePoint3D(x3a,x2a,x1mb))); - triangles.push_back(new GbTriangle3D(new FePoint3D(x3a,x2a,x1mb),new FePoint3D(x3d,x2d,x1mb),new FePoint3D(x3c,x2c,x1mb))); - } - } - - return triangles; -} -/*==========================================================*/ -void FeHalfDisc3D::objectChanged(UbObservable* changedObject) -{ - GbLine3D* line = dynamic_cast<GbLine3D*>(changedObject); - if(!line || this->mLine!=line) return; - - this->notifyObserversObjectChanged(); -} -/*==========================================================*/ -void FeHalfDisc3D::objectWillBeDeleted(UbObservable* objectForDeletion) -{ - if(this->mLine) - { - UbObservable* observedObj = dynamic_cast<UbObservable*>(this->mLine); - if(objectForDeletion == observedObj) { this->mLine = NULL; } - } -} -/*=======================================================*/ -void FeHalfDisc3D::scale(const double& sx1, const double& sx2, const double& sx3) -{ - if( this->isParallelToX1Axis() ) - { - if(!UbMath::equal(sx2,sx3)) throw UbException(UB_EXARGS,"|| to x1 -> different scaling sx2 and sx3 not possible"); - this->mRad*=sx2; - } - else if( this->isParallelToX2Axis() ) - { - if(!UbMath::equal(sx1,sx3)) throw UbException(UB_EXARGS,"|| to x2 -> different scaling sx1 and sx3 not possible"); - this->mRad*=sx1; - } - else if( this->isParallelToX3Axis() ) - { - if(!UbMath::equal(sx1,sx2)) throw UbException(UB_EXARGS,"|| to x3 -> different scaling sx1 and sx2 not possible"); - this->mRad*=sx1; - } - else throw UbException(UB_EXARGS,"unknown direction"); - - this->mLine->scale(sx1,sx2,sx3); - //notify observer wird automatisch aufgerufen -} -/*==========================================================*/ -void FeHalfDisc3D::write(UbFileOutput* out) -{ - out->writeString(this->getCreator()->getTypeID()); - mLine->write(out); - out->writeDouble(mRad); - out->writeInteger(cylinderType); -} -/*==========================================================*/ -void FeHalfDisc3D::read(UbFileInput* in) -{ - in->readString(); - mLine = new GbLine3D; - mLine->read(in); - mRad = in->readDouble(); - cylinderType = in->readInteger(); -} -/*==========================================================*/ -double FeHalfDisc3D::getIntersectionRaytraceFactor(const double& x1, const double& x2, const double& x3, const double& rx1, const double& rx2, const double& rx3) -{ - /* - Distance D of the intersection between a Ray((ox1,ox2,ox3),(dx1,dx2,dx3)) and a Plane P: ax+by+cz+d=0 - dc = a*dx1 + b*dx2 + c*dx3 - dw = a*ox1 + b*ox2 + c*ox3 + d - D = - dw / dc - */ - double px1, px2, px3; - double d = Ub::inf; // Distance to Min or Max Plane of the Cylinder - // final distance should be less that d - - if( this->isParallelToX1Axis() ) - { - double minX1 = this->getX1Minimum(); - double maxX1 = this->getX1Maximum(); - - if (UbMath::equal(x1 ,minX1) && UbMath::negative(rx1)) return -1.0; - else if(UbMath::equal(x1 ,maxX1) && UbMath::positive(rx1)) return -1.0; - - //falls die Linie nicht parallel zu den Seitenflächen ist - if( x1< minX1 || x1 > maxX1 ) //nur für punkte links und rechts des cylinders - { - px1 = (x1 < minX1 ? minX1 : maxX1); - //falls die Linie nicht parallel zu den Seitenflächen ist - if( !UbMath::zero(rx1) ) - { - // Plane a= 0, b= 1, c=0 d= -1*px2 - d = -1.0*(x1 - px1) / rx1; - px2 = x2 + d*rx2; - px3 = x3 + d*rx3; - - if(UbMath::greater(mLine->getDistance(px1,px2,px3) , mRad)) - { - if (x1 < minX1 && rx1>0.0 ) d = Ub::inf; //punkt liegt "links" vom cylinder und strahl hat evtl weiteren SP auf oberfläche - else if(x1 > maxX1 && rx1<0.0 ) d = Ub::inf; - else return -1.0; - } - else return d; - } - else return -1.0; - } - else - { - if (UbMath::negative(rx1)) d = -1.0 * (x1 - minX1) / rx1; - else if(UbMath::positive(rx1)) d = -1.0 * (x1 - maxX1) / rx1; - } - } - else if( this->isParallelToX2Axis() ) - { - double minX2 = this->getX2Minimum(); - double maxX2 = this->getX2Maximum(); - - if (UbMath::equal(x2 ,minX2) && UbMath::negative(rx2)) return -1; - else if(UbMath::equal(x2 ,maxX2) && UbMath::positive(rx2)) return -1; - - if( minX2 > x2 || x2 > maxX2 ) - { - px2 = (x2 < minX2 ? minX2 : maxX2); - //falls die Linie nicht parallel zu den Seitenflächen ist - if( !UbMath::zero(rx2) ) - { - // Plane a= 0, b= 1, c=0 d= -1*px2 - d = -1*(x2 - px2) / rx2; - px1 = x1 + d*rx1; - px3 = x3 + d*rx3; - - if (UbMath::greater(mLine->getDistance(px1,px2,px3) , mRad)) - { - if (x2 < minX2 && rx2>0.0 ) d = Ub::inf; //punkt liegt "links oberhalb" vom cylinder und strahl mit pos x1 hat evtl weiteren SP auf oberfläche - else if(x2 > maxX2 && rx2<0.0 ) d = Ub::inf; - else return -1.0; - } - else return d; - } - else return -1.0; - } - else - { - if (UbMath::negative(rx2)) d = -1.0 * (x2 - minX2) / rx2; - else if(UbMath::positive(rx2)) d = -1.0 * (x2 - maxX2) / rx2; - } - } - else if( this->isParallelToX3Axis() ) - { - double minX3 = this->getX3Minimum(); - double maxX3 = this->getX3Maximum(); - - if (UbMath::equal(x3, minX3) && UbMath::negative(rx3)) return -1.0; - else if(UbMath::equal(x3, maxX3) && UbMath::positive(rx3)) return -1.0; - - if(minX3 > x3 || x3 > maxX3 ) - { - px3 = (x3 < minX3 ? minX3 : maxX3); - //falls die Linie nicht parallel zu den Seitenflächen ist - if (!UbMath::zero(rx3)) - { - // Plane a= 0, b= 0, c=1 d= -1*px3 - d = -1.0*(x3 - px3) / rx3; - px2 = x2 + d*rx2; - px1 = x1 + d*rx1; - if( UbMath::greater(mLine->getDistance(px1,px2,px3) , mRad) ) - { - if (x3 < minX3 && rx3>0.0 ) d = Ub::inf; - else if(x3 > maxX3 && rx3<0.0 ) d = Ub::inf; - else return -1.0; - } - else return d; - } - else return -1.0; - } - else - { - if (UbMath::negative(rx3)) d = -1.0 * (x3 - minX3) / rx3; - else if(UbMath::positive(rx3)) d = -1.0 * (x3 - maxX3) / rx3; - } - } - else throw UbException(UB_EXARGS,"funzt nur bei achsen parallelem cylinder"); - ////////////////////////////////////////////////////////////////////////// - //Q berechnen für Infinity Cylinder - GbPoint3D* p1 = mLine->getPoint1(); - GbPoint3D* p2 = mLine->getPoint2(); - - double axisX1 = p2->x1 - p1->x1; /* Axis of the cylinder */ - double axisX2 = p2->x2 - p1->x2; /* mit p1 als base of cylinder */ - double axisX3 = p2->x3 - p1->x3; - - //double dirlen = mLine->getLength(); - //double abs, t, s; - - double RCx1 = x1 - p1->x1; - double RCx2 = x2 - p1->x2; - double RCx3 = x3 - p1->x3; - - //n = ray x axis - double nx1 = rx2*axisX3 - rx3*axisX2; - double nx2 = rx3*axisX1 - rx1*axisX3; - double nx3 = rx1*axisX2 - rx2*axisX1; - double nLength = nx1*nx1 + nx2*nx2 + nx3*nx3; - - double abs; - if( UbMath::zero( nLength ) ) - { /* ray parallel to cyl */ - //abs = RC dot axis - double abs = RCx1*axisX1 + RCx2*axisX2 + RCx3*axisX3; - double dx1 = RCx1 - abs*axisX1; - double dx2 = RCx2 - abs*axisX2; - double dx3 = RCx3 - abs*axisX3; - //abs = sqrt(dx1*dx1 + dx2*dx2 + dx3*dx3); - if( UbMath::greater( dx1*dx1 + dx2*dx2 + dx3*dx3 , mRad*mRad) ) - return -1.0; - } - - //normalize "n" - nLength = std::sqrt(nLength); - double invnLength = 1.0/nLength; - nx1*=invnLength; - nx2*=invnLength; - nx3*=invnLength; - - //shortest distance = fabs( RC dot n ) - abs = fabs( RCx1*nx1 + RCx2*nx2 + RCx3*nx3 ); - - if( UbMath::lessEqual(abs, mRad) ) - { /* if ray hits cylinder */ - //Ox1 = RC x axis - double Ox1 = RCx2*axisX3 - RCx3*axisX2; - double Ox2 = RCx3*axisX1 - RCx1*axisX3; - double Ox3 = RCx1*axisX2 - RCx2*axisX1; - //t = - O dot n / nLength; - double t = - (Ox1*nx1 + Ox2*nx2 + Ox3*nx3) / nLength; - - //O = n x axis; - Ox1 = nx2*axisX3 - nx3*axisX2; - Ox2 = nx3*axisX1 - nx1*axisX3; - Ox3 = nx1*axisX2 - nx2*axisX1; - - //normalize O - invnLength = 1.0/sqrt(Ox1*Ox1 + Ox2*Ox2 + Ox3*Ox3); - Ox1*=invnLength; - Ox2*=invnLength; - Ox3*=invnLength; - - double s = fabs( sqrt(mRad*mRad - abs*abs) / (rx1*Ox1 + rx2*Ox2 + rx3*Ox3) ); - - if( UbMath::greater(t-s,d) ) return -1.0; - - return t - s; - } - - return -1.0; -} -/*==========================================================*/ diff --git a/src/basics/numerics/geometry3d/fem/FeHalfDisc3D.h b/src/basics/numerics/geometry3d/fem/FeHalfDisc3D.h deleted file mode 100644 index 4855dac3fad7928ef16cd9662a85202b8a11772c..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/fem/FeHalfDisc3D.h +++ /dev/null @@ -1,104 +0,0 @@ -// _ ___ __ __________ _ __ -// | | / (_)____/ /___ ______ _/ / ____/ /_ __(_)___/ /____ -// | | / / / ___/ __/ / / / __ `/ / /_ / / / / / / __ / ___/ -// | |/ / / / / /_/ /_/ / /_/ / / __/ / / /_/ / / /_/ (__ ) -// |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/ -// -#ifndef FEHALFDISC3D_H -#define FEHALFDISC3D_H - -#include <vector> -#include <cmath> - -#include <numerics/geometry3d/GbObject3D.h> -#include <basics/utilities/UbObserver.h> - -class GbPoint3D; -class GbLine3D; -class GbTriangle3D; - -class GbObject3DCreator; - -class FeHalfDisc3D : public GbObject3D , public UbObserver -{ -public: - FeHalfDisc3D(); - FeHalfDisc3D(const double& x1a,const double& x2a, const double& x3a, const double& x1b,const double& x2b, const double& x3b, const double& radius); - FeHalfDisc3D(GbPoint3D* p1, GbPoint3D* p2, const double& radius); - FeHalfDisc3D(GbLine3D* line, const double& rad); - FeHalfDisc3D(FeHalfDisc3D* cylinder); - ~FeHalfDisc3D(); - - FeHalfDisc3D* clone() { return new FeHalfDisc3D(this); } - void finalize(); - - double getRadius() { return this->mRad; }; - GbLine3D* getLine() {return mLine;} - GbPoint3D* getPoint1(); - GbPoint3D* getPoint2(); - - void setRadius(const double& radius); - void setLine(GbLine3D* line); - void setPoint1(const double& x1, const double& x2, const double& x3); - void setPoint2(const double& x1, const double& x2, const double& x3); - - bool isParallelToX1Axis() { return((this->cylinderType & X1PARALLEL ) == X1PARALLEL );} - bool isParallelToX2Axis() { return((this->cylinderType & X2PARALLEL ) == X2PARALLEL );} - bool isParallelToX3Axis() { return((this->cylinderType & X3PARALLEL ) == X3PARALLEL );} - bool isNotParallelToAxis(){ return((this->cylinderType & NOTPARALLELTOAXIS ) == NOTPARALLELTOAXIS );} - - double getHeight(); - - void scale(const double& sx1, const double& sx2, const double& sx3); - - double getX1Centroid(); - double getX1Minimum() ; - double getX1Maximum() ; - double getX2Centroid(); - double getX2Minimum() ; - double getX2Maximum() ; - double getX3Centroid(); - double getX3Minimum() ; - double getX3Maximum() ; - - bool isPointInGbObject3D(const double& x1p, const double& x2p, const double& x3p); - bool isPointInGbObject3D(const double& x1p, const double& x2p, const double& x3p, bool& pointIsOnBoundary); - bool isCellInsideGbObject3D(const double& x1a,const double& x2a,const double& x3a,const double& x1b,const double& x2b,const double& x3b); - bool isCellCuttingGbObject3D(const double& x1a,const double& x2a,const double& x3a,const double& x1b,const double& x2b,const double& x3b); - bool isCellInsideOrCuttingGbObject3D(const double& x1a,const double& x2a,const double& x3a,const double& x1b,const double& x2b,const double& x3b); - - GbLine3D* createClippedLine3D(GbPoint3D& point1, GbPoint3D& point2); - - bool hasRaytracing() { return true; } - /*|r| must be 1! einheitsvector!!*/ - double getIntersectionRaytraceFactor(const double& x1, const double& x2, const double& x3, const double& rx1, const double& rx2, const double& rx3); - - std::vector<GbTriangle3D*> getSurfaceTriangleSet(); - - std::string toString(); - ObObjectCreator* getCreator(); - void write(UbFileOutput* out); - void read(UbFileInput* in); - - //virtuelle Methoden von UbObserver - void objectChanged(UbObservable* changedObject); - void objectWillBeDeleted(UbObservable* objectForDeletion); - - using GbObject3D::isPointInGbObject3D; //Grund: dadurch muss man hier isPointInGbObject3D(GbPoint3D*) nicht ausprogrammieren, welche sonst hier "ueberdeckt" waere - -protected: - void initCylinderType(); - - GbLine3D* mLine; - double mRad; - - int cylinderType; - - //void berechneQuerschnittsWerte(); - static const int NOTPARALLELTOAXIS = (1<<0); //1 - static const int X1PARALLEL = (1<<1); //2 - static const int X2PARALLEL = (1<<2); //4 - static const int X3PARALLEL = (1<<3); //8 -}; - -#endif diff --git a/src/basics/numerics/geometry3d/fem/FePlateTriangularMesh3D.cpp b/src/basics/numerics/geometry3d/fem/FePlateTriangularMesh3D.cpp deleted file mode 100644 index 8654792cba9d79c95bf745af9642a9c9143e5aed..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/fem/FePlateTriangularMesh3D.cpp +++ /dev/null @@ -1,223 +0,0 @@ -#include <numerics/geometry3d/fem/FePlateTriangularMesh3D.h> - -using namespace std; - -FePlateTriangularMesh3D::FePlateTriangularMesh3D() : GbTriangularMesh3D() -{ -} - -FePlateTriangularMesh3D::FePlateTriangularMesh3D(string name, vector<GbPoint3D*> *nodes, vector<GbTriangle3D*> *triangles) : GbTriangularMesh3D(name, nodes, triangles) -{ -} - -/*=============================================================================================*/ - -FePlateTriangularMesh3D::FePlateTriangularMesh3D(string name, vector<GbTriangle3D*> *triangles) : GbTriangularMesh3D(name, triangles) -{ -} - -/*=============================================================================================*/ -FePlateTriangularMesh3D::FePlateTriangularMesh3D(string name, vector<GbPoint3D*> *nodes, vector<GbLine3D*> *edges, vector<GbTriangle3D*> *triangles) : GbTriangularMesh3D(name, nodes, edges, triangles) -{ -} -/*=============================================================================================*/ -FePlateTriangularMesh3D::~FePlateTriangularMesh3D() -{ - -} -/*======================================================================*/ - -/*======================================================================*/ -bool FePlateTriangularMesh3D::isPointInGbObject3D(const double& x1, const double& x2, const double& x3) -{ - //cout<<"GbTriangularMesh3D::isPointInGbObject3D"<<endl; - //Sebastian - //double xmin=this->getX1Minimum(); double xmax=this->getX1Maximum(); - // double ymin=this->getX2Minimum(); double ymax=this->getX2Maximum(); - // double zmin=this->getX3Minimum(); double zmax=this->getX3Maximum(); - // double dX = (xmax-xmin)/100.; - // double dY = (ymax-ymin)/100.; - // double dZ = (zmax-zmin)/100.; - // GbCuboid3D boundingCube(xmin-dX, ymin-dY, zmin-dZ, xmax+dX, ymax+dY, zmax+dZ); - // - //if(this->isPointInObject3DHalfSpace(x1,x2,x3)) - //{ - // return true; - //} - //if(!boundingCube.isPointInGbObject3D(x1, x2, x3)) - //{ - // return false; - //} - - //return false; - //Marco - int inside = 0; - int nx1 = this->getNodesX1Dir()-1; - int nx2 = this->getNodesX2Dir()-1; - int maxTriangels = 2*nx1*nx2; - - //Überprüft, ob der Punkt innerhalb des Netzes liegt - double xmin=this->getX1Minimum(); double xmax=this->getX1Maximum(); - double ymin=this->getX2Minimum(); double ymax=this->getX2Maximum(); - double zmin=this->getX3Minimum(); double zmax=this->getX3Maximum(); - if( x1<=xmax && x1>=xmin - && x2<=ymax && x2>=ymin - && x3<=zmax && x3>=zmin) - { - //Achtung Sonderfall - //Es wird nur gegen die obere Lage Dreiecke getestet, da die untere Lage um den Abstand 'height' verschoben ist! - //Die Seiten müssen somit auch nicht berücksichtigt werden - for(int i=0; i<int(maxTriangels);i++) - { - if( (triangles->at(i))->enclosesPoint2D(x1, x2) - && x3<triangles->at(i)->getX3Centroid() - && x3>triangles->at(i)->getX3Centroid() - this->height ) - { - inside++; - } - } - } - - if(inside!=0) - { - return true; - } - else return false; -} -/*======================================================================*/ -FePlateTriangularMesh3D* FePlateTriangularMesh3D::createMeshByElements(int ElementsX1, int ElementsX2, double nulllevel, double deltaX1, double deltaX2, double height) -{ - FePlateTriangularMesh3D* triMesh = FePlateTriangularMesh3D::createMeshByNodes(ElementsX1+1, ElementsX2+1, nulllevel, deltaX1, deltaX2, height); - return triMesh; -} -/*======================================================================*/ -FePlateTriangularMesh3D* FePlateTriangularMesh3D::createMeshByNodes(int nodesX1, int nodesX2, double nulllevel, double deltaX1, double deltaX2, double height) -{ - cout<<"erstelle GbTriangularMesh3D -> "; - vector<GbTriangle3D*> *triangles = new vector<GbTriangle3D*>; - vector<GbPoint3D*> *points = new vector<GbPoint3D*>; - double h1=nulllevel+0.5*height; - double h2=nulllevel-0.5*height; - GbPoint3D* point1; - GbPoint3D* point2; - GbPoint3D* point3; - GbPoint3D* point4; - //Erstelle Knoten - //oben - for(int i=0; i<nodesX1; i++) - { - for(int j=0; j<nodesX2; j++) - { - GbPoint3D* point = new GbPoint3D(i*deltaX1,j*deltaX2,h1); - points->push_back(point); - } - } - //unten - for(int i=0; i<nodesX1; i++) - { - for(int j=0; j<nodesX2; j++) - { - GbPoint3D* point = new GbPoint3D(i*deltaX1,j*deltaX2,h2); - points->push_back(point); - } - } - int size=int(points->size()); - //Erstelle Dreiecke - //oben - for(int i=0; i<(size/2)-nodesX2; i+=nodesX2) - { - for(int j=0; j<nodesX2-1; j++) - { - point1 = points->at(i+j); - point2 = points->at(i+j+1); - point3 = points->at(i+j+nodesX2); - point4 = points->at(i+j+nodesX2+1); - GbTriangle3D* tri1 = new GbTriangle3D(point1,point3,point4); - GbTriangle3D* tri2 = new GbTriangle3D(point1,point4,point2); - triangles->push_back(tri1); - triangles->push_back(tri2); - } - } - //unten - for(int i=(size/2); i<size-nodesX2; i+=nodesX2) - { - for(int j=0; j<nodesX2-1; j++) - { - point1 = points->at(i+j); - point2 = points->at(i+j+1); - point3 = points->at(i+j+nodesX2); - point4 = points->at(i+j+nodesX2+1); - GbTriangle3D* tri1 = new GbTriangle3D(point4,point3,point1); - GbTriangle3D* tri2 = new GbTriangle3D(point2,point4,point1); - triangles->push_back(tri1); - triangles->push_back(tri2); - } - } - //Rand - //Nord - for(int i=0;i<nodesX1-1;i++) - { - int a = i*nodesX2+nodesX2-1; - int b = (i+1)*nodesX2+nodesX2-1; - point1 = points->at(a); - point2 = points->at(b); - point3 = points->at(a+size/2); - point4 = points->at(b+size/2); - GbTriangle3D* tri1 = new GbTriangle3D(point1,point2,point3); - GbTriangle3D* tri2 = new GbTriangle3D(point2,point4,point3); - triangles->push_back(tri1); - triangles->push_back(tri2); - } - //Süd - for(int i=0;i<nodesX1-1;i++) - { - int a = i*nodesX2; - int b = (i+1)*nodesX2; - point1 = points->at(a); - point2 = points->at(b); - point3 = points->at(a+size/2); - point4 = points->at(b+size/2); - GbTriangle3D* tri1 = new GbTriangle3D(point3,point2,point1); - GbTriangle3D* tri2 = new GbTriangle3D(point3,point4,point2); - triangles->push_back(tri1); - triangles->push_back(tri2); - } - //Ost - for(int j=0;j<nodesX2-1;j++) - { - int a = j; - int b = j+1; - point1 = points->at(a); - point2 = points->at(b); - point3 = points->at(a+size/2); - point4 = points->at(b+size/2); - GbTriangle3D* tri1 = new GbTriangle3D(point1,point2,point3); - GbTriangle3D* tri2 = new GbTriangle3D(point4,point3,point2); - triangles->push_back(tri1); - triangles->push_back(tri2); - } - //West - for(int j=0;j<nodesX2-1;j++) - { - int a = j+(nodesX1-1)*nodesX2; - int b = j+(nodesX1-1)*nodesX2+1; - point1 = points->at(a); - point2 = points->at(b); - point3 = points->at(a+size/2); - point4 = points->at(b+size/2); - GbTriangle3D* tri1 = new GbTriangle3D(point3,point2,point1); - GbTriangle3D* tri2 = new GbTriangle3D(point2,point3,point4); - triangles->push_back(tri1); - triangles->push_back(tri2); - } - string name = "TriMesh"; - FePlateTriangularMesh3D* triMesh = new FePlateTriangularMesh3D(name,points,triangles); - triMesh->setNullLevel((float)nulllevel); - triMesh->setHeight(height); - triMesh->setNodesX1Dir(nodesX1); - triMesh->setNodesX2Dir(nodesX2); - cout<<"done"<<endl; - return triMesh; -} - - diff --git a/src/basics/numerics/geometry3d/fem/FePlateTriangularMesh3D.h b/src/basics/numerics/geometry3d/fem/FePlateTriangularMesh3D.h deleted file mode 100644 index 19fc2a07cbe9322cfc92a748b11b6d7c43d5d22e..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/fem/FePlateTriangularMesh3D.h +++ /dev/null @@ -1,50 +0,0 @@ -#ifndef FEPLATETRIANGULARMESH_H -#define FEPLATETRIANGULARMESH_H - -#include <sstream> -#include <iostream> - -#include <numerics/geometry3d/GbTriangularMesh3D.h> - - -/*=========================================================================*/ -/* GbTriangularMesh3D */ -/* */ -/** - * This Class provides the triangular meshes. - * Note, that up to now no methods for checking consistency are included. - * in this context this class describes facettes from an 3D-object !!! -*/ -class FePlateTriangularMesh3D : public GbTriangularMesh3D -{ -public: - FePlateTriangularMesh3D(); - FePlateTriangularMesh3D(std::string name, std::vector<GbPoint3D*> *nodes, std::vector<GbTriangle3D*> *triangles); - FePlateTriangularMesh3D(std::string name, std::vector<GbTriangle3D*> *triangles); - FePlateTriangularMesh3D(std::string name, std::vector<GbPoint3D*> *nodes, std::vector<GbLine3D*> *edges, std::vector<GbTriangle3D*> *triangles); - virtual ~FePlateTriangularMesh3D(); - - static FePlateTriangularMesh3D* createMeshByNodes(int nodesX1, int nodesX2, double nulllevel, double deltaX1, double deltaX2, double height); - static FePlateTriangularMesh3D* createMeshByElements(int ElementsX1, int ElementsX2, double nulllevel, double deltaX1, double deltaX2, double height); - - - float getNullLevel() { return this->nulllevel; } - void setNullLevel(float nulllevel) { this->nulllevel = nulllevel; } - double getHeight() { return this->height; } - void setHeight(double height) { this->height = height; } - int getNodesX1Dir() { return this->nodesX1Dir; } - void setNodesX1Dir(int nodesX1Dir) { this->nodesX1Dir = nodesX1Dir; } - int getNodesX2Dir() { return this->nodesX2Dir; } - void setNodesX2Dir(int nodesX2Dir) { this->nodesX2Dir = nodesX2Dir; } - - bool isPointInGbObject3D(const double& x1, const double& x2, const double& x3); - - /*======================================================================*/ -private: - float nulllevel; - double height; - int nodesX1Dir; - int nodesX2Dir; -}; -/*=========================================================================*/ -#endif diff --git a/src/basics/numerics/geometry3d/fem/FePoint3D.h b/src/basics/numerics/geometry3d/fem/FePoint3D.h deleted file mode 100644 index 8e0eb8a7a08e33f4b8f3c629ffd59ce326bb7798..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/fem/FePoint3D.h +++ /dev/null @@ -1,148 +0,0 @@ -#ifndef FEPOINT3D_H -#define FEPOINT3D_H - -#include <sstream> -#include <numerics/geometry3d/GbPoint3D.h> - - -/*=========================================================================*/ -/* GbPoint3D */ -/* */ -/** - * This Class provides basic 3D point objects. - * <BR><BR><HR> - * @author <A HREF="mailto:geller@bauinf.tu-cottbus.de">S. Geller</A> - * @version 1.0 - 10.02.07 - * - */ -class FePoint3D : public GbPoint3D -{ -private: - - double Fx; - double Fy; - double Fz; - //double oldFx; - //double oldFy; - double sumFx; - double sumFy; - double sumFz; - double velocityX; - double velocityY; - double velocityZ; - //double accelerationX; - //double accelerationY; - UbTupleDouble6 stresses; - - double area; -public: - FePoint3D():GbPoint3D() - { - this->init(); - } - FePoint3D(double x, double y, double z):GbPoint3D(x,y,z) - { - this->init(); - } - FePoint3D(GbPoint3D *point):GbPoint3D(point) - { - this->init(); - } - - FePoint3D(FePoint3D *point):GbPoint3D(point) - { - this->Fx = point->Fx; - this->Fy = point->Fy; - this->Fz = point->Fz; - throw UbException(__FILE__,__LINE__,"spaeter fertig machen..."); - } - - virtual ~FePoint3D() - { - } - - void init() - { - this->Fx = 0.0; - this->Fy = 0.0; - this->Fz = 0.0; - //this->oldFx = 0.0; - //this->oldFy = 0.0; - this->sumFx = 0.0; - this->sumFy = 0.0; - this->sumFz = 0.0; - val<1>(stresses) = 0.0; - val<2>(stresses) = 0.0; - val<3>(stresses) = 0.0; - val<4>(stresses) = 0.0; - val<5>(stresses) = 0.0; - val<6>(stresses) = 0.0; - this->area = 0.0; - this->velocityX = 0.0; - this->velocityY = 0.0; - this->velocityZ = 0.0; - } - /*======================================================================*/ - FePoint3D* clone() - { - return(new FePoint3D(this)); - } - - double getVelocityX() { return(this->velocityX); } - double getVelocityY() { return(this->velocityY); } - double getVelocityZ() { return(this->velocityZ); } - void setVelocityX(double x) { this->velocityX = x; } - void setVelocityY(double y) { this->velocityY = y; } - void setVelocityZ(double z) { this->velocityZ = z; } - - double getFX() { return(this->Fx); } - double getFY() { return(this->Fy); } - double getFZ() { return(this->Fz); } - void setFX(double FX) { this->Fx = FX; } - void setFY(double FY) { this->Fy = FY; } - void setFZ(double FZ) { this->Fz = FZ; } - void addFX(double FX) { this->Fx += FX; } - void addFY(double FY) { this->Fy += FY; } - void addFZ(double FZ) { this->Fz += FZ; } - - double getSumFX() { return(this->sumFx); } - double getSumFY() { return(this->sumFy); } - double getSumFZ() { return(this->sumFz); } - void setSumFX(double FX) { this->sumFx = FX; } - void setSumFY(double FY) { this->sumFy = FY; } - void setSumFZ(double FZ) { this->sumFz = FZ; } - void addSumFX(double FX) { this->sumFx += FX; } - void addSumFY(double FY) { this->sumFy += FY; } - void addSumFZ(double FZ) { this->sumFz += FZ; } - - UbTupleDouble6& getStresses() { return this->stresses; } -// void setS11(double S11) { this->S11 = S11; } -// void setS12(double S12) { this->S12 = S12; } -// void setS22(double S22) { this->S22 = S22; } - double getArea() { return this->area; } - void setArea(double area) { this->area = area; } - void addArea(double area) { this->area += area; } - - /** - * Returns a string representation of this 3D fe-point. - * @return a string representation of this 3D fe-point - */ - std::string toString() - { - std::stringstream ss; - ss<<"FePoint3D["; - ss<<"x1="<<this->x1; - ss<<", x2="<<this->x2; - ss<<", x3="<<this->x3; - ss<<", Fx="<<this->Fx; - ss<<", Fy="<<this->Fy; - ss<<", Fz="<<this->Fz<<"]"; - return((ss.str()).c_str()); - } - /*======================================================================*/ -}; -/*=========================================================================*/ -#endif - - - diff --git a/src/basics/numerics/geometry3d/fem/FeRing3D.cpp b/src/basics/numerics/geometry3d/fem/FeRing3D.cpp deleted file mode 100644 index 320e4d2b169f0f66c09551c8e4761df734469b08..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/fem/FeRing3D.cpp +++ /dev/null @@ -1,468 +0,0 @@ -#include <numerics/geometry3d/fem/FeRing3D.h> -#include <numerics/geometry3d/GbSystem3D.h> -#include <numerics/geometry3d/fem/FePoint3D.h> -#include <numerics/geometry3d/GbLine3D.h> -#include <numerics/geometry3d/GbTriangle3D.h> - -using namespace std; - -/*=======================================================*/ -ObObjectCreator* FeRing3D::getCreator() -{ - return NULL; //FeRing3DCreator::getInstance(); -} -// Konstruktor -/*==========================================================*/ -FeRing3D::FeRing3D() -{ - GbPoint3D* p1 = new GbPoint3D(); - GbPoint3D* p2 = new GbPoint3D(); - mLine = new GbLine3D(p1,p2); - this->mLine->addObserver(this); - inRadius = 0.0; - outRadius = 0.0; - ringType = FeRing3D::NOTPARALLELTOAXIS; -} -/*=======================================================*/ -FeRing3D::FeRing3D(FeRing3D* ring) -{ - inRadius = ring->getInRadius(); - outRadius = ring->getOutRadius(); - ringType = ring->ringType; - mLine = ring->getLine()->clone(); - - this->mLine->addObserver(this); -} -/*==========================================================*/ -FeRing3D::FeRing3D(const double& x1a,const double& x2a, const double& x3a, const double& x1b,const double& x2b, const double& x3b, const double& inradius, const double& outradius) -{ - mLine = new GbLine3D; - mLine->setPoints( new GbPoint3D(min(x1a,x1b), min(x2a,x2b), min(x3a,x3b)) - ,new GbPoint3D(max(x1a,x1b), max(x2a,x2b), max(x3a,x3b))); - this->mLine->addObserver(this); - this->inRadius = inradius; - this->outRadius = outradius; - - this->initRingType(); - if((this->ringType & NOTPARALLELTOAXIS)==NOTPARALLELTOAXIS) - throw UbException("FeRing3D::FeRing3D - derzeit nur zu Achsen orthogonale Cylinder erlaubt... isPointInObject3D funzt sonst ned"); -} -/*==========================================================*/ -FeRing3D::FeRing3D(GbPoint3D* p1, GbPoint3D* p2, const double& inradius, const double& outradius) -{ - this->inRadius = inradius; - this->outRadius = outradius; - - mLine = new GbLine3D(p1,p2); - this->mLine->addObserver(this); - this->initRingType(); - if((this->ringType & NOTPARALLELTOAXIS)==NOTPARALLELTOAXIS) - throw UbException("FeRing3D::FeRing3D - derzeit nur zu Achsen orthogonale Cylinder erlaubt... isPointInObject3D funzt sonst ned"); -} -/*==========================================================*/ -FeRing3D::FeRing3D(GbLine3D* line, const double& inradius, const double& outradius) -{ - this->inRadius = inradius; - this->outRadius = outradius; - - this->mLine = line; - this->mLine->addObserver(this); - this->initRingType(); - if((this->ringType & NOTPARALLELTOAXIS)==NOTPARALLELTOAXIS) - throw UbException("FeRing3D::FeRing3D - derzeit nur zu Achsen orthogonale Cylinder erlaubt... isPointInObject3D funzt sonst ned"); -} -/*==========================================================*/ -// Destruktor -FeRing3D::~FeRing3D() -{ - if(mLine) this->mLine->removeObserver(this); - mLine = NULL; -} -/*=======================================================*/ -void FeRing3D::initRingType() -{ - double x1a = mLine->getPoint1()->x1; double x1b = mLine->getPoint2()->x1; - double x2a = mLine->getPoint1()->x2; double x2b = mLine->getPoint2()->x2; - double x3a = mLine->getPoint1()->x3; double x3b = mLine->getPoint2()->x3; - - if (x1a!=x1b && x2a==x2b && x3a==x3b) this->ringType = X1PARALLEL; - else if(x2a!=x2b && x1a==x1b && x3a==x3b) this->ringType = X2PARALLEL; - else if(x3a!=x3b && x1a==x1b && x2a==x2b) this->ringType = X3PARALLEL; - else this->ringType = NOTPARALLELTOAXIS; -} -/*=======================================================*/ -void FeRing3D::finalize() -{ - if(this->mLine) - { - mLine->finalize(); - delete mLine; - mLine=NULL; - } -} -/*=======================================================*/ -double FeRing3D::getHeight() -{ - if(mLine) return mLine->getLength(); return 0.0; -} -/*=======================================================*/ -GbPoint3D* FeRing3D::getPoint1() -{ - if(this->mLine) return this->mLine->getPoint1(); - return NULL; -} -/*=======================================================*/ -GbPoint3D* FeRing3D::getPoint2() -{ - if(this->mLine) return this->mLine->getPoint2(); - return NULL; -} -/*=======================================================*/ -void FeRing3D::setInRadius(const double& radius) -{ - this->inRadius = std::fabs(radius); - this->notifyObserversObjectChanged(); -} -/*=======================================================*/ -void FeRing3D::setOutRadius(const double& radius) -{ - this->outRadius = std::fabs(radius); - this->notifyObserversObjectChanged(); -} -/*=======================================================*/ -void FeRing3D::setLine(GbLine3D* line) -{ - if(this->mLine) this->mLine->removeObserver(this); - this->mLine = line; - this->mLine->addObserver(this); - this->initRingType(); - - this->notifyObserversObjectChanged(); -} -/*=======================================================*/ -void FeRing3D::setPoint1(const double& x1, const double& x2, const double& x3) -{ - if(!mLine->getPoint1()) throw UbException("FeRing3D::setPoint1() - line has no point1"); - mLine->getPoint1()->setCoordinates(x1,x2,x3); - this->initRingType(); - - //this->notifyObserversObjectChanged(); //wird automatisch aufgerufen, da der point (this) benachrichtigt... -} -/*=======================================================*/ -void FeRing3D::setPoint2(const double& x1, const double& x2, const double& x3) -{ - if(!mLine->getPoint2()) throw UbException("FeRing3D::setPoint1() - line has no point2"); - mLine->getPoint2()->setCoordinates(x1,x2,x3); - this->initRingType(); - - //this->notifyObserversObjectChanged(); //wird automatisch aufgerufen, da der point (this) benachrichtigt... -} -/*==========================================================*/ -double FeRing3D::getX1Centroid() -{ - return mLine->getX1Centroid(); -} -/*==========================================================*/ -double FeRing3D::getX1Minimum() -{ - if (this->isParallelToX1Axis()) return mLine->getX1Minimum(); - else if(this->isParallelToX2Axis()) return mLine->getX1Centroid()-outRadius; - else if(this->isParallelToX3Axis()) return mLine->getX1Centroid()-outRadius; - else throw UbException(__FILE__, __LINE__, "FeRing3D::getX3Minimum - derzeit nur zu Achsen orthogonale Cylinder erlaubt... isPointInObject3D funzt sonst ned"); -} -/*==========================================================*/ -double FeRing3D::getX1Maximum() -{ - if (this->isParallelToX1Axis()) return mLine->getX1Maximum(); - else if(this->isParallelToX2Axis()) return mLine->getX1Centroid()+outRadius; - else if(this->isParallelToX3Axis()) return mLine->getX1Centroid()+outRadius; - else throw UbException(__FILE__, __LINE__, "FeRing3D::getX3Maximum - derzeit nur zu Achsen orthogonale Cylinder erlaubt... isPointInObject3D funzt sonst ned"); -} -/*==========================================================*/ -double FeRing3D::getX2Centroid() -{ - return mLine->getX2Centroid(); -} -/*==========================================================*/ -double FeRing3D::getX2Minimum() -{ - if (this->isParallelToX1Axis()) return mLine->getX2Centroid()-outRadius; - else if(this->isParallelToX2Axis()) return mLine->getX2Minimum(); - else if(this->isParallelToX3Axis()) return mLine->getX2Centroid()-outRadius; - else throw UbException(__FILE__, __LINE__, "FeRing3D::getX3Minimum - derzeit nur zu Achsen orthogonale Cylinder erlaubt... isPointInObject3D funzt sonst ned"); -} -/*==========================================================*/ -double FeRing3D::getX2Maximum() -{ - if (this->isParallelToX1Axis()) return mLine->getX2Centroid()+outRadius; - else if(this->isParallelToX2Axis()) return mLine->getX2Maximum(); - else if(this->isParallelToX3Axis()) return mLine->getX2Centroid()+outRadius; - else throw UbException(__FILE__, __LINE__, "FeRing3D::getX3Maximum - derzeit nur zu Achsen orthogonale Cylinder erlaubt... isPointInObject3D funzt sonst ned"); -} -/*==========================================================*/ -double FeRing3D::getX3Centroid() -{ - return mLine->getX3Centroid(); -} -/*==========================================================*/ -double FeRing3D::getX3Minimum() -{ - if (this->isParallelToX1Axis()) return mLine->getX3Centroid()-outRadius; - else if(this->isParallelToX2Axis()) return mLine->getX3Centroid()-outRadius; - else if(this->isParallelToX3Axis()) return mLine->getX3Minimum(); - else throw UbException(__FILE__, __LINE__, "FeRing3D::getX3Minimum - derzeit nur zu Achsen orthogonale Cylinder erlaubt... isPointInObject3D funzt sonst ned"); -} -/*==========================================================*/ -double FeRing3D::getX3Maximum() -{ - if (this->isParallelToX1Axis()) return mLine->getX3Centroid()+outRadius; - else if(this->isParallelToX2Axis()) return mLine->getX3Centroid()+outRadius; - else if(this->isParallelToX3Axis()) return mLine->getX3Maximum(); - else throw UbException(__FILE__, __LINE__, "FeRing3D::getX3Maximum - derzeit nur zu Achsen orthogonale Cylinder erlaubt... isPointInObject3D funzt sonst ned"); -} -/*==========================================================*/ -bool FeRing3D::isPointInGbObject3D(const double& x1p, const double& x2p, const double& x3p) -{ - throw UbException(__FILE__,__LINE__,"FeRing3D function not implemented"); - -} -/*==========================================================*/ -bool FeRing3D::isPointInGbObject3D(const double& x1p, const double& x2p, const double& x3p, bool& pointIsOnBoundary) -{ - throw UbException(__FILE__,__LINE__,"FeRing3D function not implemented"); -} -/*=======================================================*/ -bool FeRing3D::isCellInsideGbObject3D(const double& x1a,const double& x2a,const double& x3a,const double& x1b,const double& x2b,const double& x3b) -{ - throw UbException(__FILE__,__LINE__,"FeRing3D function not implemented"); -} - -/*==========================================================*/ -string FeRing3D::toString() -{ - stringstream ss; - ss<<"FeRing3D["; - ss<<"line="<<this->mLine->toString(); - ss<<", inRadius="<<this->inRadius; - ss<<", outRadius="<<this->outRadius; - ss<<"]"; - return(ss.str()); -} -/*==========================================================*/ -bool FeRing3D::isCellInsideOrCuttingGbObject3D(const double& x1a,const double& x2a,const double& x3a,const double& x1b,const double& x2b,const double& x3b) -{ - throw UbException(__FILE__,__LINE__,"FeRing3D function not implemented"); -} -/*==========================================================*/ -bool FeRing3D::isCellCuttingGbObject3D(const double& x1a,const double& x2a,const double& x3a,const double& x1b,const double& x2b,const double& x3b) -{ - throw UbException(__FILE__,__LINE__,"FeRing3D function not implemented"); -} -/*==========================================================*/ -GbLine3D* FeRing3D::createClippedLine3D(GbPoint3D& point1, GbPoint3D& point2) -{ - throw UbException(__FILE__,__LINE__,"FeRing3D function not implemented"); -} -/*==========================================================*/ -vector<GbTriangle3D*> FeRing3D::getSurfaceTriangleSet() -{ - double x1ma,x1mb,x2m,x3m; - if( this->isParallelToX1Axis() ) - { - x1ma = this->getX1Minimum(); - x1mb = this->getX1Maximum(); - x2m = this->getX2Centroid(); - x3m = this->getX3Centroid(); - } - else if( this->isParallelToX2Axis() ) - { - x1ma = this->getX2Minimum(); - x1mb = this->getX2Maximum(); - x2m = this->getX1Centroid(); - x3m = this->getX3Centroid(); - } - else if( this->isParallelToX3Axis() ) - { - x1ma = this->getX3Minimum(); - x1mb = this->getX3Maximum(); - x2m = this->getX2Centroid(); - x3m = this->getX1Centroid(); - } - else throw UbException(__FILE__, __LINE__, "FeRing3D::getSurfaceTriangleSet() - ring not axis prallel"); - - vector<GbTriangle3D*> triangles; - - int segmentsCircle = 14; - double deltaPhi = UbMath::PI/(double)segmentsCircle; - - double phiX1a,phiX1b; - double x1a,x2a,x3a,x1b,x2b,x3b,x1c,x2c,x3c,x1d,x2d,x3d; - double x2aa,x3aa,x2bb,x3bb; - - double dXCylinder = fabs((x1mb-x1ma)); // /(double)segmentsCircle; - int segmentsCylinder = (int)(fabs(x1mb-x1ma)/dXCylinder); - for(int segCyl = 0; segCyl<segmentsCylinder; segCyl++) - { - x1a = x1d = x1ma+segCyl*dXCylinder; - x1b = x1c = x1a+dXCylinder; - - for(phiX1a=2.0*UbMath::PI; phiX1a>0; phiX1a-=deltaPhi) - { - phiX1b = phiX1a+deltaPhi; - - x2a = x2m+this->outRadius*std::sin(phiX1a); - x3a = x3m+this->outRadius*std::cos(phiX1a); - x2b = x2m+this->outRadius*std::sin(phiX1b); - x3b = x3m+this->outRadius*std::cos(phiX1b); - - x2aa = x2m+this->inRadius*std::sin(phiX1a); - x3aa = x3m+this->inRadius*std::cos(phiX1a); - x2bb = x2m+this->inRadius*std::sin(phiX1b); - x3bb = x3m+this->inRadius*std::cos(phiX1b); - - if( this->isParallelToX1Axis() ) - { - triangles.push_back(new GbTriangle3D(new FePoint3D(x1b,x2a,x3a),new FePoint3D(x1b,x2b,x3b),new FePoint3D(x1a,x2a,x3a))); - triangles.push_back(new GbTriangle3D(new FePoint3D(x1a,x2b,x3b),new FePoint3D(x1a,x2a,x3a),new FePoint3D(x1b,x2b,x3b))); - triangles.push_back(new GbTriangle3D(new FePoint3D(x1b,x2bb,x3bb),new FePoint3D(x1b,x2aa,x3aa),new FePoint3D(x1a,x2aa,x3aa))); - triangles.push_back(new GbTriangle3D(new FePoint3D(x1a,x2aa,x3aa),new FePoint3D(x1a,x2bb,x3bb),new FePoint3D(x1b,x2bb,x3bb))); - } - else if( this->isParallelToX2Axis() ) - { - throw UbException(__FILE__,__LINE__," sollte man mal machen"); - //triangles.push_back(new GbTriangle3D(new FePoint3D(x2b,x1b,x3b),new FePoint3D(x2a,x1b,x3a),new FePoint3D(x2a,x1a,x3a))); - //triangles.push_back(new GbTriangle3D(new FePoint3D(x2a,x1a,x3a),new FePoint3D(x2b,x1a,x3b),new FePoint3D(x2b,x1b,x3b))); - //triangles.push_back(new GbTriangle3D(new FePoint3D(x2bb,x1b,x3bb),new FePoint3D(x2aa,x1b,x3aa),new FePoint3D(x2aa,x1a,x3aa))); - //triangles.push_back(new GbTriangle3D(new FePoint3D(x2aa,x1a,x3aa),new FePoint3D(x2bb,x1a,x3bb),new FePoint3D(x2bb,x1b,x3bb))); - } - else if( this->isParallelToX3Axis() ) - { - throw UbException(__FILE__,__LINE__," sollte man mal machen"); - //triangles.push_back(new GbTriangle3D(new FePoint3D(x3b,x2b,x1b),new FePoint3D(x3a,x2a,x1b),new FePoint3D(x3a,x2a,x1a))); - //triangles.push_back(new GbTriangle3D(new FePoint3D(x3a,x2a,x1a),new FePoint3D(x3b,x2b,x1a),new FePoint3D(x3b,x2b,x1b))); - //triangles.push_back(new GbTriangle3D(new FePoint3D(x3bb,x2bb,x1b),new FePoint3D(x3aa,x2aa,x1b),new FePoint3D(x3aa,x2aa,x1a))); - //triangles.push_back(new GbTriangle3D(new FePoint3D(x3aa,x2aa,x1a),new FePoint3D(x3bb,x2bb,x1a),new FePoint3D(x3bb,x2bb,x1b))); - } - - } - } - - //int segmentsSide = (int)(this->outRadius/dXCylinder); - - double radius0, radius1; - //for(int segCyl = 10; segCyl<segmentsSide; segCyl++) - //{ - radius0 = inRadius;//segCyl*dXCylinder; - radius1 = outRadius;//radius0+dXCylinder; - //if(segCyl==segmentsSide-1) radius1=outRadius; - - for(phiX1a=2.0*UbMath::PI; phiX1a>0; phiX1a-=deltaPhi) - { - phiX1b = phiX1a+deltaPhi; - - x2a = x2m+radius0*std::sin(phiX1a); - x3a = x3m+radius0*std::cos(phiX1a); - x2b = x2m+radius0*std::sin(phiX1b); - x3b = x3m+radius0*std::cos(phiX1b); - x2c = x2m+radius1*std::sin(phiX1b); - x3c = x3m+radius1*std::cos(phiX1b); - x2d = x2m+radius1*std::sin(phiX1a); - x3d = x3m+radius1*std::cos(phiX1a); - - if( this->isParallelToX1Axis() ) - { - triangles.push_back(new GbTriangle3D(new FePoint3D(x1ma,x2b,x3b),new FePoint3D(x1ma,x2a,x3a),new FePoint3D(x1ma,x2c,x3c))); - triangles.push_back(new GbTriangle3D(new FePoint3D(x1ma,x2d,x3d),new FePoint3D(x1ma,x2c,x3c),new FePoint3D(x1ma,x2a,x3a))); - triangles.push_back(new GbTriangle3D(new FePoint3D(x1mb,x2b,x3b),new FePoint3D(x1mb,x2c,x3c),new FePoint3D(x1mb,x2a,x3a))); - triangles.push_back(new GbTriangle3D(new FePoint3D(x1mb,x2d,x3d),new FePoint3D(x1mb,x2a,x3a),new FePoint3D(x1mb,x2c,x3c))); - } - else if( this->isParallelToX2Axis() ) - { - throw UbException(__FILE__,__LINE__," sollte man mal machen"); - //triangles.push_back(new GbTriangle3D(new FePoint3D(x2a,x1ma,x3a),new FePoint3D(x2b,x1ma,x3b),new FePoint3D(x2c,x1ma,x3c))); - //triangles.push_back(new GbTriangle3D(new FePoint3D(x2c,x1ma,x3c),new FePoint3D(x2d,x1ma,x3d),new FePoint3D(x2a,x1ma,x3a))); - //triangles.push_back(new GbTriangle3D(new FePoint3D(x2c,x1mb,x3c),new FePoint3D(x2b,x1mb,x3b),new FePoint3D(x2a,x1mb,x3a))); - //triangles.push_back(new GbTriangle3D(new FePoint3D(x2a,x1mb,x3a),new FePoint3D(x2d,x1mb,x3d),new FePoint3D(x2c,x1mb,x3c))); - } - else if( this->isParallelToX3Axis() ) - { - throw UbException(__FILE__,__LINE__," sollte man mal machen"); - //triangles.push_back(new GbTriangle3D(new FePoint3D(x3a,x2a,x1ma),new FePoint3D(x3b,x2b,x1ma),new FePoint3D(x3c,x2c,x1ma))); - //triangles.push_back(new GbTriangle3D(new FePoint3D(x3c,x2c,x1ma),new FePoint3D(x3d,x2d,x1ma),new FePoint3D(x3a,x2a,x1ma))); - //triangles.push_back(new GbTriangle3D(new FePoint3D(x3c,x2c,x1mb),new FePoint3D(x3b,x2b,x1mb),new FePoint3D(x3a,x2a,x1mb))); - //triangles.push_back(new GbTriangle3D(new FePoint3D(x3a,x2a,x1mb),new FePoint3D(x3d,x2d,x1mb),new FePoint3D(x3c,x2c,x1mb))); - } - } - // } - - return triangles; -} -/*==========================================================*/ -void FeRing3D::objectChanged(UbObservable* changedObject) -{ - GbLine3D* line = dynamic_cast<GbLine3D*>(changedObject); - if(!line || this->mLine!=line) return; - - this->notifyObserversObjectChanged(); -} -/*==========================================================*/ -void FeRing3D::objectWillBeDeleted(UbObservable* objectForDeletion) -{ - if(this->mLine) - { - UbObservable* observedObj = dynamic_cast<UbObservable*>(this->mLine); - if(objectForDeletion == observedObj) { this->mLine = NULL; } - } -} -/*=======================================================*/ -void FeRing3D::scale(const double& sx1, const double& sx2, const double& sx3) -{ - if( this->isParallelToX1Axis() ) - { - if(!UbMath::equal(sx2,sx3)) throw UbException("FeRing3D::scale - || to x1 -> different scaling sx2 and sx3 not possible"); - this->inRadius*=sx2; - this->outRadius*=sx2; - } - else if( this->isParallelToX2Axis() ) - { - if(!UbMath::equal(sx1,sx3)) throw UbException("FeRing3D::scale - || to x2 -> different scaling sx1 and sx3 not possible"); - this->inRadius*=sx1; - this->outRadius*=sx1; - } - else if( this->isParallelToX3Axis() ) - { - if(!UbMath::equal(sx1,sx2)) throw UbException("FeRing3D::scale - || to x3 -> different scaling sx1 and sx2 not possible"); - this->inRadius*=sx1; - this->outRadius*=sx1; - } - else throw UbException("FeRing3D::scale - unknown direction"); - - this->mLine->scale(sx1,sx2,sx3); - //notify observer wird automatisch aufgerufen -} -/*==========================================================*/ -void FeRing3D::write(UbFileOutput* out) -{ - out->writeString(this->getCreator()->getTypeID()); - mLine->write(out); - out->writeDouble(inRadius); - out->writeDouble(outRadius); - out->writeInteger(ringType); -} -/*==========================================================*/ -void FeRing3D::read(UbFileInput* in) -{ - in->readString(); - mLine = new GbLine3D; - mLine->read(in); - inRadius = in->readDouble(); - outRadius = in->readDouble(); - ringType = in->readInteger(); -} -/*==========================================================*/ -double FeRing3D::getIntersectionRaytraceFactor(const double& x1, const double& x2, const double& x3, const double& rx1, const double& rx2, const double& rx3) -{ - throw UbException(__FILE__,__LINE__,"FeRing3D function not implemented"); -} -/*==========================================================*/ - diff --git a/src/basics/numerics/geometry3d/fem/FeRing3D.h b/src/basics/numerics/geometry3d/fem/FeRing3D.h deleted file mode 100644 index 65e9a7ba4dedb63f4b4b6f0c75b5b3348827bfef..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/fem/FeRing3D.h +++ /dev/null @@ -1,107 +0,0 @@ -// _ ___ __ __________ _ __ -// | | / (_)____/ /___ ______ _/ / ____/ /_ __(_)___/ /____ -// | | / / / ___/ __/ / / / __ `/ / /_ / / / / / / __ / ___/ -// | |/ / / / / /_/ /_/ / /_/ / / __/ / / /_/ / / /_/ (__ ) -// |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/ -// -#ifndef FERING3D_H -#define FERING3D_H - -#include <vector> -#include <cmath> - -#include <numerics/geometry3d/GbObject3D.h> -#include <basics/utilities/UbObserver.h> - -class GbPoint3D; -class GbLine3D; -class GbTriangle3D; - -class GbObject3DCreator; - -class FeRing3D : public GbObject3D , public UbObserver -{ -public: - FeRing3D(); - FeRing3D(const double& x1a,const double& x2a, const double& x3a, const double& x1b,const double& x2b, const double& x3b, const double& inradius, const double& outradius); - FeRing3D(GbPoint3D* p1, GbPoint3D* p2, const double& inradius, const double& outradius); - FeRing3D(GbLine3D* line, const double& inradius, const double& outradius); - FeRing3D(FeRing3D* ring); - ~FeRing3D(); - - FeRing3D* clone() { return new FeRing3D(this); } - void finalize(); - - double getInRadius() { return this->inRadius; }; - double getOutRadius() { return this->outRadius; }; - GbLine3D* getLine() {return mLine;} - GbPoint3D* getPoint1(); - GbPoint3D* getPoint2(); - - void setInRadius(const double& radius); - void setOutRadius(const double& radius); - void setLine(GbLine3D* line); - void setPoint1(const double& x1, const double& x2, const double& x3); - void setPoint2(const double& x1, const double& x2, const double& x3); - - bool isParallelToX1Axis() { return((this->ringType & X1PARALLEL ) == X1PARALLEL );} - bool isParallelToX2Axis() { return((this->ringType & X2PARALLEL ) == X2PARALLEL );} - bool isParallelToX3Axis() { return((this->ringType & X3PARALLEL ) == X3PARALLEL );} - bool isNotParallelToAxis(){ return((this->ringType & NOTPARALLELTOAXIS ) == NOTPARALLELTOAXIS );} - - double getHeight(); - - void scale(const double& sx1, const double& sx2, const double& sx3); - - double getX1Centroid(); - double getX1Minimum() ; - double getX1Maximum() ; - double getX2Centroid(); - double getX2Minimum() ; - double getX2Maximum() ; - double getX3Centroid(); - double getX3Minimum() ; - double getX3Maximum() ; - - bool isPointInGbObject3D(const double& x1p, const double& x2p, const double& x3p); - bool isPointInGbObject3D(const double& x1p, const double& x2p, const double& x3p, bool& pointIsOnBoundary); - bool isCellInsideGbObject3D(const double& x1a,const double& x2a,const double& x3a,const double& x1b,const double& x2b,const double& x3b); - bool isCellCuttingGbObject3D(const double& x1a,const double& x2a,const double& x3a,const double& x1b,const double& x2b,const double& x3b); - bool isCellInsideOrCuttingGbObject3D(const double& x1a,const double& x2a,const double& x3a,const double& x1b,const double& x2b,const double& x3b); - - GbLine3D* createClippedLine3D(GbPoint3D& point1, GbPoint3D& point2); - - bool hasRaytracing() { return true; } - /*|r| must be 1! einheitsvector!!*/ - double getIntersectionRaytraceFactor(const double& x1, const double& x2, const double& x3, const double& rx1, const double& rx2, const double& rx3); - - std::vector<GbTriangle3D*> getSurfaceTriangleSet(); - - std::string toString(); - ObObjectCreator* getCreator(); - void write(UbFileOutput* out); - void read(UbFileInput* in); - - //virtuelle Methoden von UbObserver - void objectChanged(UbObservable* changedObject); - void objectWillBeDeleted(UbObservable* objectForDeletion); - - using GbObject3D::isPointInGbObject3D; //Grund: dadurch muss man hier isPointInGbObject3D(GbPoint3D*) nicht ausprogrammieren, welche sonst hier "ueberdeckt" waere - -protected: - void initRingType(); - - GbLine3D* mLine; - double inRadius; - double outRadius; - - int ringType; - - //void berechneQuerschnittsWerte(); - static const int NOTPARALLELTOAXIS = (1<<0); //1 - static const int X1PARALLEL = (1<<1); //2 - static const int X2PARALLEL = (1<<2); //4 - static const int X3PARALLEL = (1<<3); //8 -}; - -#endif diff --git a/src/basics/numerics/geometry3d/fem/FeTriFaceMesh3D.cpp b/src/basics/numerics/geometry3d/fem/FeTriFaceMesh3D.cpp deleted file mode 100644 index 68838ccead2c3560f45af10fe87182e28384514b..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/fem/FeTriFaceMesh3D.cpp +++ /dev/null @@ -1,256 +0,0 @@ -#include <numerics/geometry3d/fem/FeTriFaceMesh3D.h> - -#include <numerics/geometry3d/fem/creator/FeTriFaceMesh3DCreator.h> -#include <numerics/geometry3d/GbTriangle3D.h> - -#include <basics/writer/WbWriterVtkXmlBinary.h> -#include <basics/writer/WbWriterVtkXmlASCII.h> - -using namespace std; - -FeTriFaceMesh3D::FeTriFaceMesh3D():GbTriFaceMesh3D() -{ - this->attributes = new vector<VertexAttributes>; -// this->createVertexTriFaceMap(); -} -/*====================================================*/ -FeTriFaceMesh3D::FeTriFaceMesh3D(std::string name, std::vector<Vertex>* nodes, std::vector<TriFace>* triangles):GbTriFaceMesh3D(name,nodes,triangles) -{ - this->attributes = new vector<VertexAttributes>; - this->attributes->resize(nodes->size()); -// this->createVertexTriFaceMap(); -} -/*======================================================================*/ -ObObjectCreator* FeTriFaceMesh3D::getCreator() -{ - return FeTriFaceMesh3DCreator::getInstance(); -} -/*====================================================*/ -void FeTriFaceMesh3D::resizeAttributes() -{ - this->attributes->resize(nodes->size()); -} -/*====================================================*/ -//void FeTriFaceMesh3D::createVertexTriFaceMap() -//{ -// vertexTriFaceMap.clear(); -// vector<TriFace>& tris = *this->triangles; -// vector<Vertex>& pts = *this->nodes; -// -// for(size_t t=0; t<tris.size(); t++) -// { -// TriFace& tri = tris[t]; -// Vertex& vert1 = pts[tri.v1]; -// Vertex& vert2 = pts[tri.v2]; -// Vertex& vert3 = pts[tri.v3]; -// vertexTriFaceMap.setVertexTriFaceRelation(&vert1,&tri); -// vertexTriFaceMap.setVertexTriFaceRelation(&vert2,&tri); -// vertexTriFaceMap.setVertexTriFaceRelation(&vert3,&tri); -// } -//} -/*====================================================*/ -FeTriFaceMesh3D* FeTriFaceMesh3D::createMeshByTriangles(std::string name, std::vector<GbTriangle3D*> *triangles) -{ - vector<GbTriFaceMesh3D::Vertex> *nodes = new vector<GbTriFaceMesh3D::Vertex>; - vector<GbTriFaceMesh3D::TriFace> *tris = new vector<GbTriFaceMesh3D::TriFace>; - int nr=0; - for(int u=0;u<(int)triangles->size();u++) - { - if(UbMath::zero((*triangles)[u]->getArea())) continue; - - GbPoint3D* p1 = (*triangles)[u]->getPoint1(); - GbPoint3D* p2 = (*triangles)[u]->getPoint2(); - GbPoint3D* p3 = (*triangles)[u]->getPoint3(); - nodes->push_back(GbTriFaceMesh3D::Vertex((float)p1->getX1Coordinate(),(float)p1->getX2Coordinate(),(float)p1->getX3Coordinate())); - nodes->push_back(GbTriFaceMesh3D::Vertex((float)p2->getX1Coordinate(),(float)p2->getX2Coordinate(),(float)p2->getX3Coordinate())); - nodes->push_back(GbTriFaceMesh3D::Vertex((float)p3->getX1Coordinate(),(float)p3->getX2Coordinate(),(float)p3->getX3Coordinate())); - tris->push_back(GbTriFaceMesh3D::TriFace(nr,nr+1,nr+2)); - nr+=3; - } - FeTriFaceMesh3D* triMesh = new FeTriFaceMesh3D(name, nodes, tris); - triMesh->deleteRedundantNodes(); - triMesh->resizeAttributes(); - return triMesh; -} - -/*======================================================================*/ -UbTuple<string,string> FeTriFaceMesh3D::writeMesh(string filename, WbWriter* writer, bool writeNormals, std::vector< std::string >* datanames, std::vector< std::vector < double > >* nodedata) -{ - if(datanames || nodedata) - { - UBLOG(logWARNING,"FeTriFaceMesh3D::writeMesh - no support for extra datanames || nodedata"); - } - - UBLOG2(logDEBUG1,std::cout,"FeTriFaceMesh3D::writeMesh - start"); - - UbTuple<string,string> filenames; - - if( dynamic_cast<WbWriterVtkXmlBinary*>(writer) || dynamic_cast<WbWriterVtkXmlASCII*>(writer)) - { - vector< UbTupleFloat3 > triNodes( nodes->size() ); - vector< UbTupleInt3 > tris( triangles->size() ); - - for(size_t i=0; i<nodes->size(); i++) - triNodes[i] = makeUbTuple( (*nodes)[i].x, (*nodes)[i].y, (*nodes)[i].z ); - - for(size_t i=0; i<triangles->size(); i++) - tris[i] = makeUbTuple( (*triangles)[i].v1, (*triangles)[i].v2, (*triangles)[i].v3 ) ; - - vector<string> localDataNames; - localDataNames.push_back("Fx" ); - localDataNames.push_back("Fy" ); - localDataNames.push_back("Fz" ); - localDataNames.push_back("sumFx" ); - localDataNames.push_back("sumFy" ); - localDataNames.push_back("sumFz" ); - localDataNames.push_back("vx" ); - localDataNames.push_back("vy" ); - localDataNames.push_back("vz" ); - localDataNames.push_back("S1" ); - localDataNames.push_back("S2" ); - localDataNames.push_back("S3" ); - localDataNames.push_back("S4" ); - localDataNames.push_back("S5" ); - localDataNames.push_back("S6" ); - localDataNames.push_back("Pressure"); - - std::vector< std::vector < double > > localNodedata( localDataNames.size(), std::vector<double>( nodes->size() ) ); - for(size_t n=0; n<nodes->size(); n++) - { - FeTriFaceMesh3D::VertexAttributes& attribut = (*this->attributes)[n]; - - localNodedata[ 0][n] = attribut.getFX(); - localNodedata[ 1][n] = attribut.getFY(); - localNodedata[ 2][n] = attribut.getFZ(); - localNodedata[ 3][n] = attribut.getSumFX(); - localNodedata[ 4][n] = attribut.getSumFY(); - localNodedata[ 5][n] = attribut.getSumFZ(); - localNodedata[ 6][n] = attribut.getVelocityX(); - localNodedata[ 7][n] = attribut.getVelocityY(); - localNodedata[ 8][n] = attribut.getVelocityZ(); - localNodedata[ 9][n] = val<1>(attribut.getStresses()); - localNodedata[10][n] = val<2>(attribut.getStresses()); - localNodedata[11][n] = val<3>(attribut.getStresses()); - localNodedata[12][n] = val<4>(attribut.getStresses()); - localNodedata[13][n] = val<5>(attribut.getStresses()); - localNodedata[14][n] = val<6>(attribut.getStresses()); - localNodedata[15][n] = attribut.getPressure(); - } - val<1>(filenames) = writer->writeTrianglesWithNodeData(filename,triNodes,tris,localDataNames,localNodedata); - } - else - { - string avsfilename = filename+writer->getFileExtension(); - val<1>(filenames)=avsfilename; - - ofstream out(avsfilename.c_str(),ios::out); - if(!out) - { - out.clear(); //flags ruecksetzen (ansonsten liefert utern if(!outfile) weiterhin true!!! - string path = UbSystem::getPathFromString(filename); - if(path.size()>0){UbSystem::makeDirectory(path);out.open(filename.c_str(),ios::out);} - if(!out) throw UbException(UB_EXARGS,"file konnte nicht geschrieben werden"); - } - - //cout<<"AvsASCII - writeLines to "<<avsfilename<<" ..."; - - int nofNodes = (int)nodes->size(); - int nofTrian = (int)triangles->size(); - int dataSize = 16; - - out<<"# UCD-File created by WbWriterAvsASCII\n"; - out<<nofNodes<<" "<<nofTrian<<" "<<dataSize<<" 0 0 "<<endl; - - for(int i=0; i<nofNodes; i++) - out<<i+1<<" "<< (*nodes)[i].x<<" "<< (*nodes)[i].y<<" "<< (*nodes)[i].z<<" \n"; - - for(int i=0; i<nofTrian; i++) - out<<i+1<<" 2 tri "<<(*triangles)[i].v1+1<<" "<<(*triangles)[i].v2+1<<" "<<(*triangles)[i].v3+1<<" "<<endl; - - out<<dataSize; - for(int i=0;i<dataSize;i++) out<<" "<<1; - out<<endl; - - out<<"Fx, no_unit"<<endl; - out<<"Fy, no_unit"<<endl; - out<<"Fz, no_unit"<<endl; - out<<"sumFx, no_unit"<<endl; - out<<"sumFy, no_unit"<<endl; - out<<"sumFz, no_unit"<<endl; - out<<"vx, no_unit"<<endl; - out<<"vy, no_unit"<<endl; - out<<"vz, no_unit"<<endl; - out<<"S1, no_unit"<<endl; - out<<"S2, no_unit"<<endl; - out<<"S3, no_unit"<<endl; - out<<"S4, no_unit"<<endl; - out<<"S5, no_unit"<<endl; - out<<"S6, no_unit"<<endl; - out<<"Pressure, no_unit"<<endl; - - for(int n=0; n<nofNodes; n++) - { - FeTriFaceMesh3D::VertexAttributes& attribut = (*this->attributes)[n]; - - double Fx = attribut.getFX(); - double Fy = attribut.getFY(); - double Fz = attribut.getFZ(); - double sumFx = attribut.getSumFX(); - double sumFy = attribut.getSumFY(); - double sumFz = attribut.getSumFZ(); - double vx = attribut.getVelocityX(); - double vy = attribut.getVelocityY(); - double vz = attribut.getVelocityZ(); - double p = attribut.getPressure(); - UbTupleDouble6& stresses = attribut.getStresses(); - out<<n+1<<" "<<Fx<<" "<<Fy<<" "<<Fz; - out<<" "<<sumFx<<" "<<sumFy<<" "<<sumFz; - out<<" "<<vx<<" "<<vy<<" "<<vz; - out<<" "<<val<1>(stresses)<<" "<<val<2>(stresses)<<" "<<val<3>(stresses); - out<<" "<<val<4>(stresses)<<" "<<val<5>(stresses)<<" "<<val<6>(stresses); - out<<" "<<p<<endl; - } - out.close(); - } - - if(writeNormals) - { - vector<UbTupleFloat3 > lineNodes(triangles->size()*2); - vector<UbTupleInt2 > lines(triangles->size()); - for(size_t i=0; i<triangles->size(); i++) - { - TriFace& triangle = (*triangles)[i]; - lineNodes[i*2 ] = makeUbTuple( triangle.getX1Centroid(*nodes) - ,triangle.getX2Centroid(*nodes) - ,triangle.getX3Centroid(*nodes)); - lineNodes[i*2+1] = makeUbTuple( (float)(triangle.getX1Centroid(*nodes)+triangle.nx) - ,(float)(triangle.getX2Centroid(*nodes)+triangle.ny) - ,(float)(triangle.getX3Centroid(*nodes)+triangle.nz)); - - lines[i] = makeUbTuple((int)i*2,(int)i*2+1); - } - val<2>(filenames) = writer->writeLines(filename+"_normals",lineNodes,lines); - } - - - if(writeNormals) - { - vector<UbTupleFloat3 > lineNodes(nodes->size()*2); - vector<UbTupleInt2 > lines(nodes->size()); - for(size_t i=0; i<nodes->size(); i++) - { - FeTriFaceMesh3D::VertexAttributes& attribut = (*this->attributes)[i]; - lineNodes[i*2 ] = makeUbTuple((*nodes)[i].x, (*nodes)[i].y, (*nodes)[i].z ); - lineNodes[i*2+1] = makeUbTuple((*nodes)[i].x+(float)attribut.getNormalX() - ,(*nodes)[i].y+(float)attribut.getNormalY() - ,(*nodes)[i].z+(float)attribut.getNormalZ()); - - lines[i] = makeUbTuple((int)i*2,(int)i*2+1); - } - writer->writeLines(filename+"_PointNormals",lineNodes,lines); - } - - UBLOG2(logDEBUG1,std::cout,"FeTriFaceMesh3D::writeMesh - end"); - - return filenames; -} diff --git a/src/basics/numerics/geometry3d/fem/FeTriFaceMesh3D.h b/src/basics/numerics/geometry3d/fem/FeTriFaceMesh3D.h deleted file mode 100644 index 924941867af336b5fcfa69e0ce2e7f0afc4df546..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/fem/FeTriFaceMesh3D.h +++ /dev/null @@ -1,204 +0,0 @@ -#ifndef FETRIFACEMESH3D_H -#define FETRIFACEMESH3D_H - -#include <sstream> -#include <iostream> -#include <vector> -#include <map> - -#include "./../GbTriFaceMesh3D.h" - -#ifdef CAB_RCF -#include <3rdParty/rcf/RcfSerializationIncludes.h> -#endif //CAB_RCF - -/*=========================================================================*/ -/* FeTriFaceMesh3D */ -/* */ -/** - * This Class provides the triangular meshes. - * Note, that up to now no methods for checking consistency are included. - * in this context this class describes facettes from an 3D-object !!! -*/ -class FeTriFaceMesh3D : public GbTriFaceMesh3D -{ -public: - class VertexAttributes - { - private: - double Fx; - double Fy; - double Fz; - double sumFx; - double sumFy; - double sumFz; - double velocityX; - double velocityY; - double velocityZ; - double normalX; - double normalY; - double normalZ; - UbTupleDouble6 stresses; - double area; - double p; //pressure - public: - VertexAttributes() - { - this->init(); - } - ~VertexAttributes() {} - -#ifdef CAB_RCF - template<class Archive> - void SF_SERIALIZE(Archive & ar) - { - ar & Fx; ar & Fy; ar & Fz; - ar & velocityX; ar & velocityY; ar & velocityZ; - } -#endif //CAB_RCF - - void init() - { - this->Fx = 0.0; - this->Fy = 0.0; - this->Fz = 0.0; - this->sumFx = 0.0; - this->sumFy = 0.0; - this->sumFz = 0.0; - val<1>(stresses) = 0.0; - val<2>(stresses) = 0.0; - val<3>(stresses) = 0.0; - val<4>(stresses) = 0.0; - val<5>(stresses) = 0.0; - val<6>(stresses) = 0.0; - this->area = 0.0; - this->p = 0.0; - this->velocityX = 0.0; - this->velocityY = 0.0; - this->velocityZ = 0.0; - this->normalX = 0.0; - this->normalY = 0.0; - this->normalZ = 0.0; - } - double getVelocityX() { return this->velocityX; } - double getVelocityY() { return this->velocityY; } - double getVelocityZ() { return this->velocityZ; } - void setVelocityX(double x) { this->velocityX = x; } - void setVelocityY(double y) { this->velocityY = y; } - void setVelocityZ(double z) { this->velocityZ = z; } - - double getNormalX() { return this->normalX; } - double getNormalY() { return this->normalY; } - double getNormalZ() { return this->normalZ; } - void setNormalX(double x) { this->normalX = x; } - void setNormalY(double y) { this->normalY = y; } - void setNormalZ(double z) { this->normalZ = z; } - - double getFX() { return this->Fx; } - double getFY() { return this->Fy; } - double getFZ() { return this->Fz; } - void setFX(double FX) { this->Fx = FX; } - void setFY(double FY) { this->Fy = FY; } - void setFZ(double FZ) { this->Fz = FZ; } - void addFX(double FX) { this->Fx += FX; } - void addFY(double FY) { this->Fy += FY; } - void addFZ(double FZ) { this->Fz += FZ; } - - double getSumFX() { return this->sumFx; } - double getSumFY() { return this->sumFy; } - double getSumFZ() { return this->sumFz; } - void setSumFX(double FX) { this->sumFx = FX; } - void setSumFY(double FY) { this->sumFy = FY; } - void setSumFZ(double FZ) { this->sumFz = FZ; } - void addSumFX(double FX) { this->sumFx += FX; } - void addSumFY(double FY) { this->sumFy += FY; } - void addSumFZ(double FZ) { this->sumFz += FZ; } - - UbTupleDouble6& getStresses() { return this->stresses; } - - double getArea() { return this->area; } - void setArea(double area) { this->area = area; } - void addArea(double area) { this->area += area; } - - double getPressure() { return this->p; } - void setPressure(double p) { this->p = p; } - - }; -/*=========================================================================*/ -/*=========================================================================*/ -/*=========================================================================*/ - //class VertexTriFaceMap : public std::multimap<Vertex*, TriFace*> - //{ - //public: - // VertexTriFaceMap() {} - // /*=========================================================================*/ - // void setVertexTriFaceRelation(Vertex* v, TriFace* tri) - // { - // this->insert(std::pair<Vertex*,TriFace*>(v,tri)); - // } - // /*=========================================================================*/ - // int getNumberOfTriFaces(Vertex* v) - // { - // return((int)this->count(v)); - // } - // /*=========================================================================*/ - // std::vector<TriFace*> getTriFacesForVertex(Vertex* v) - // { - // std::vector<TriFace*> trivector; - // unsigned number = (unsigned)this->count(v); - // std::multimap<Vertex*,TriFace*>::iterator mapIterator = this->find(v); - // for(unsigned u =0; u<number; u++) - // { - // trivector.push_back(mapIterator->second); - // mapIterator ++; - // } - // return trivector; - // } - // //void deleteNeighbors(QtInteractor* interactor); - // ///*=========================================================================*/ - //}; -/*=========================================================================*/ -/*=========================================================================*/ -/*=========================================================================*/ -public: - //#ifndef SWIG - //VertexTriFaceMap vertexTriFaceMap; - //#endif - - FeTriFaceMesh3D(); - FeTriFaceMesh3D(std::string name, std::vector<Vertex>* nodes, std::vector<TriFace>* triangles); - - std::vector<VertexAttributes>* getAttributes() { return this->attributes; } - void resizeAttributes(); - //void createVertexTriFaceMap(); - - UbTuple<std::string,std::string> writeMesh(std::string filename, WbWriter* writer, bool writeNormals=false, std::vector< std::string >* datanames=NULL, std::vector< std::vector < double > >* nodedata=NULL); - - static FeTriFaceMesh3D* createMeshByTriangles(std::string name, std::vector<GbTriangle3D*>* triangles); - - virtual ObObjectCreator* getCreator(); - -#ifdef CAB_RCF - template<class Archive> - void SF_SERIALIZE(Archive & ar) - { - SF_SERIALIZE_PARENT<GbTriFaceMesh3D>(ar, *this); - ar & attributes; - //if( ArchiveTools::isReading(ar) ) this->createVertexTriFaceMap(); - } -#endif //CAB_RCF - - -protected: - std::vector<VertexAttributes>* attributes; - -}; - -#if defined(RCF_USE_SF_SERIALIZATION) && !defined(SWIG) - UB_AUTO_RUN_NAMED( SF::registerType<FeTriFaceMesh3D >("FeTriFaceMesh3D ") , SF_FeTriFaceMesh3D ); - UB_AUTO_RUN_NAMED( ( SF::registerBaseAndDerived< GbTriFaceMesh3D, FeTriFaceMesh3D >() ), SF_FeTriFaceMesh3D_BD1 ); - UB_AUTO_RUN_NAMED( ( SF::registerBaseAndDerived< GbObject3D, FeTriFaceMesh3D >() ), SF_FeTriFaceMesh3D_BD2 ); -#endif //RCF_USE_SF_SERIALIZATION - - -#endif //FETRIFACEMESH3D_H diff --git a/src/basics/numerics/geometry3d/fem/creator/FeTriFaceMesh3DCreator.cpp b/src/basics/numerics/geometry3d/fem/creator/FeTriFaceMesh3DCreator.cpp deleted file mode 100644 index 58a6171c1bbc33013211255cc883e58c29b72fa7..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/fem/creator/FeTriFaceMesh3DCreator.cpp +++ /dev/null @@ -1,417 +0,0 @@ -#include <numerics/geometry3d/fem/creator/FeTriFaceMesh3DCreator.h> -#include <basics/utilities/UbLogger.h> -#include <basics/utilities/UbTiming.h> - -using namespace std; - -FeTriFaceMesh3D* FeTriFaceMesh3DCreator::readMeshFromFile(string filename, string meshName, bool removeRedundantNodes) -{ - if(meshName.empty()) - { - size_t pos=filename.rfind("/"); - if(pos!=string::npos) meshName = filename.substr(pos+1); - else meshName = filename; - } - - UbFileInputASCII stlfile(filename); - if(!stlfile) throw UbException(UB_EXARGS,"cannot open file "+filename); - string ext=stlfile.getFileExtension(); - - //in "kleinbuchstaben" umwandeln - transform(ext.begin(), ext.end(), ext.begin(), (int(*)(int))tolower); //(int(*)(int)) ist irgendso ein fieser cast, weil tolower ne alte c-methode ist - - if ( !ext.compare("ply") ) return FeTriFaceMesh3DCreator::readMeshFromPLYFile(filename, meshName, removeRedundantNodes); - else if( !ext.compare("stl") ) return FeTriFaceMesh3DCreator::readMeshFromSTLFile(filename, meshName, removeRedundantNodes); - else if( !ext.compare("inp") ) return FeTriFaceMesh3DCreator::readMeshFromAVSFile(filename, meshName, removeRedundantNodes); - //else if( !ext.compare("gts") ) return FeTriFaceMesh3DCreator::readMeshFromGTSFile(filename, meshName); - //else if( !ext.compare("raw") ) return FeTriFaceMesh3DCreator::readMeshFromRAWFile(filename, meshName); - else throw UbException(UB_EXARGS,"fileformat "+ext); - - return NULL; -} -/*======================================================================*/ -FeTriFaceMesh3D* FeTriFaceMesh3DCreator::readMeshFromPLYFile(string filename, string meshName, bool removeRedundantNodes) -{ - UbFileInputASCII plyfile(filename); - if(!plyfile) throw UbException(UB_EXARGS,"cannot open file "+filename); - return FeTriFaceMesh3DCreator::readMeshFromPLYFile(&plyfile,meshName); -} -/*======================================================================*/ -FeTriFaceMesh3D* FeTriFaceMesh3DCreator::readMeshFromPLYFile(UbFileInput* in, string meshName, bool removeRedundantNodes) -{ - //cout<<"GbTriangularMesh3DFile.readMeshFromPLYFile !!! Dieses Format hat leider redundante Knoten ..."<<endl; - vector<GbTriFaceMesh3D::Vertex> *nodes = new vector<GbTriFaceMesh3D::Vertex>; - vector<GbTriFaceMesh3D::TriFace> *triangles = new vector<GbTriFaceMesh3D::TriFace>; - - float x, y, z; - string dummy; - - int numVertices = in->readIntegerAfterString("element vertex"); - int numFaces = in->readIntegerAfterString("element face"); - in->setPosAfterLineWithString("end_header"); - - UBLOG(logDEBUG1,"Number of vertices "<<numVertices); - UBLOG(logDEBUG1,"Number of faces "<<numFaces); - - nodes->resize(numVertices); - triangles->reserve(numFaces); - - int onePercent = (int)UbMath::max(1,UbMath::integerRounding(numVertices*0.01)); - for (int i=0; i<numVertices; i++) - { - if( i%onePercent==0 ) - cout<<" - read vertices (#"<<numVertices<<") "<<UbMath::integerRounding(i/(double)numVertices*100.0)<<"% "<<"\r"<<flush; - x = in->readFloat(); - y = in->readFloat(); - z = in->readFloat(); - in->readLine(); - (*nodes)[i] = GbTriFaceMesh3D::Vertex(x,y,z); - } - UBLOG(logDEBUG1," - read vertices (#"<<numVertices<<") done"); - - int p,j,k,l,n; - onePercent = (int)UbMath::max(1,UbMath::integerRounding(numFaces*0.01)); - for(int i=0; i<numFaces; i++) - { - if( i%onePercent==0 ) cout<<" - read faces (#"<<numFaces<<") "<<UbMath::integerRounding(i/(double)numFaces*100.0)<<"% "<<"\r"<<flush; - - p = in->readInteger(); - if(p==3) //Dreieck, alles andere wird stumpf ingnoriert - { - j = in->readInteger(); - k = in->readInteger(); - l = in->readInteger(); - - if( !UbMath::inClosedInterval(j,0,numVertices-1) - || !UbMath::inClosedInterval(k,0,numVertices-1) - || !UbMath::inClosedInterval(l,0,numVertices-1) ) - { - throw UbException(UB_EXARGS,"dreiecksindex ist groesser als max Knotenindex oder kleiner 0"); - } - triangles->push_back(GbTriFaceMesh3D::TriFace(j,k,l)); - } - else if(p==4) //Viereck --> wird zu zwei Dreiecken! - { - j = in->readInteger(); - k = in->readInteger(); - l = in->readInteger(); - n = in->readInteger(); - numFaces++; - i++; - - if( !UbMath::inClosedInterval(j,0,numVertices-1) - || !UbMath::inClosedInterval(k,0,numVertices-1) - || !UbMath::inClosedInterval(l,0,numVertices-1) - || !UbMath::inClosedInterval(n,0,numVertices-1) - ) - { - throw UbException(UB_EXARGS,"vierecksindex ist groesser als max Knotenindex oder kleiner 0"); - } - triangles->push_back(GbTriFaceMesh3D::TriFace(j,k,l)); - triangles->push_back(GbTriFaceMesh3D::TriFace(l,n,j)); - } - - in->readLine(); - - } - UBLOG(logDEBUG1," - read faces (#"<<(int)triangles->size()<<", #nonTriangles="<<(int)triangles->size()-numFaces<<") done"); - - FeTriFaceMesh3D* mesh = new FeTriFaceMesh3D(meshName, nodes, triangles); - - if(removeRedundantNodes) mesh->deleteRedundantNodes(); - - mesh->resizeAttributes(); - //mesh->createVertexTriFaceMap(); - mesh->calculateValues(); - - - return mesh; -} -/*======================================================================*/ -FeTriFaceMesh3D* FeTriFaceMesh3DCreator::readMeshFromSTLFile(string filename, string meshName, bool removeRedundantNodes) -{ - UbFileInputASCII stlfile(filename); - if(!stlfile) throw UbException(UB_EXARGS,"cannot open file "+filename); - return FeTriFaceMesh3DCreator::readMeshFromSTLFile(&stlfile,meshName,removeRedundantNodes); -} -/*======================================================================*/ -FeTriFaceMesh3D* FeTriFaceMesh3DCreator::readMeshFromSTLFile(UbFileInput *in, string meshName, bool removeRedundantNodes) -{ - UBLOG(logINFO,"FeTriFaceMesh3DCreator::readMeshFromSTLFile !!! Dieses Format hat leider redundante Knoten ..."); - - vector<FeTriFaceMesh3D::Vertex> *nodes = new vector<FeTriFaceMesh3D::Vertex>; - vector<FeTriFaceMesh3D::TriFace> *triangles = new vector<FeTriFaceMesh3D::TriFace>; - string dummy; - - double x, y, z; - int nr=0; - - in->readLine(); - while(dummy!="endsolid") - { - in->readLine(); - in->readLine(); - dummy = in->readString(); - if(dummy!="vertex") throw UbException(UB_EXARGS,"no vertex format"); - x=in->readDouble(); - y=in->readDouble(); - z=in->readDouble(); - nodes->push_back(FeTriFaceMesh3D::Vertex((float)x,(float)y,(float)z)); - in->readLine(); - in->readString(); - x=in->readDouble(); - y=in->readDouble(); - z=in->readDouble(); - nodes->push_back(FeTriFaceMesh3D::Vertex((float)x,(float)y,(float)z)); - in->readLine(); - in->readString(); - x=in->readDouble(); - y=in->readDouble(); - z=in->readDouble(); - nodes->push_back(FeTriFaceMesh3D::Vertex((float)x,(float)y,(float)z)); - triangles->push_back(FeTriFaceMesh3D::TriFace(nr,nr+1,nr+2)); - in->readLine(); - in->readLine(); - in->readLine(); - dummy = in->readString(); - nr+=3; - } - - - FeTriFaceMesh3D* mesh = new FeTriFaceMesh3D(meshName, nodes, triangles); - - if(removeRedundantNodes) mesh->deleteRedundantNodes(); - - mesh->resizeAttributes(); -// mesh->createVertexTriFaceMap(); - mesh->calculateValues(); - - - return mesh; -} -// /*======================================================================*/ -// FeTriFaceMesh3D* FeTriFaceMesh3DCreator::readMeshFromMeshFile(string filename, string meshName, bool removeRedundantNodes) -// { -// public static void read(String file, ArrayList<Node3d> nodeList, ArrayList<TrianglePatch> patches) throws FileReaderException { -// -// UBLOG(logINFO,"FeTriFaceMesh3DCreator::readMeshFromSTLFile !!! Dieses Format hat leider redundante Knoten ..."); -// -// vector<FeTriFaceMesh3D::Vertex> *nodes = new vector<FeTriFaceMesh3D::Vertex>; -// vector<FeTriFaceMesh3D::TriFace> *triangles = new vector<FeTriFaceMesh3D::TriFace>; -// string dummy; -// -// double x, y, z; -// int nr=0; -// -// in->readLine(); -// while(dummy!="endsolid") -// { -// in->readLine(); -// in->readLine(); -// dummy = in->readString(); -// if(dummy!="vertex") throw UbException(UB_EXARGS,"no vertex format"); -// x=in->readDouble(); -// y=in->readDouble(); -// z=in->readDouble(); -// nodes->push_back(FeTriFaceMesh3D::Vertex((float)x,(float)y,(float)z)); -// in->readLine(); -// in->readString(); -// x=in->readDouble(); -// y=in->readDouble(); -// z=in->readDouble(); -// nodes->push_back(FeTriFaceMesh3D::Vertex((float)x,(float)y,(float)z)); -// in->readLine(); -// in->readString(); -// x=in->readDouble(); -// y=in->readDouble(); -// z=in->readDouble(); -// nodes->push_back(FeTriFaceMesh3D::Vertex((float)x,(float)y,(float)z)); -// triangles->push_back(FeTriFaceMesh3D::TriFace(nr,nr+1,nr+2)); -// in->readLine(); -// in->readLine(); -// in->readLine(); -// dummy = in->readString(); -// nr+=3; -// } -// -// -// FeTriFaceMesh3D* mesh = new FeTriFaceMesh3D(meshName, nodes, triangles); -// -// if(removeRedundantNodes) mesh->deleteRedundantNodes(); -// -// return mesh; -// -// -// try { -// -// FileInput input = new FileInput(file); -// -// int line = 0; -// while(true) -// { -// if(line>1000) break; -// if(input.readLine().contains("Vertices")) -// break; -// line++; -// } -// -// int num_of_points = input.readInt(); -// -// for (int i = 0; i < num_of_points; i++) { -// float x = (float) input.readDouble(); -// float y = (float) input.readDouble(); -// float z = (float) input.readDouble(); -// int nr = input.readInt(); -// nodeList.add(new Node3d(x, y, z)); -// } -// -// input.skipLine(); -// input.skipLine(); -// int num_of_triangles = input.readInt(); -// -// for (int i = 0; i < num_of_triangles; i++) { -// -// int a = input.readInt(); -// int b = input.readInt(); -// int c = input.readInt(); -// int nr = input.readInt(); -// -// Node3d P1 = nodeList.get(a - 1); -// Node3d P2 = nodeList.get(b - 1); -// Node3d P3 = nodeList.get(c - 1); -// -// patches.add(new TrianglePatch(P1, P2, P3)); -// } -// -// // END reading mesh file -// } -// -// -- -// -// Dipl.-Ing. Sebastian Bindick -// -// Institute for Computational Modeling in Civil Engineering (iRMB) Technische Universität Braunschweig Pockelsstr. 3 (9th Floor) D-38106, Braunschweig, Germany -// -// phone +49 531/391-7598 -// fax +49 531/391-7599 -// email bindick@irmb.tu-bs.de -// web www.irmb.tu-bs.de -// -// -/*======================================================================*/ -FeTriFaceMesh3D* FeTriFaceMesh3DCreator::readMeshFromAVSFile(string filename, string meshName, bool removeRedundantNodes) -{ - UbFileInputASCII stlfile(filename); - if(!stlfile) throw UbException(UB_EXARGS,"cannot open file "+filename); - return FeTriFaceMesh3DCreator::readMeshFromAVSFile(&stlfile,meshName,removeRedundantNodes); -} -/*======================================================================*/ -FeTriFaceMesh3D* FeTriFaceMesh3DCreator::readMeshFromAVSFile(UbFileInput *in, string meshName, bool removeRedundantNodes) -{ - UBLOG(logINFO,"FeTriFaceMesh3DCreator.readMeshFromAVSFile !!! Dieses Format hat leider redundante Knoten ..."); - - vector<FeTriFaceMesh3D::Vertex> *nodes = new vector<FeTriFaceMesh3D::Vertex>; - vector<FeTriFaceMesh3D::TriFace> *triangles = new vector<FeTriFaceMesh3D::TriFace>; - string dummy; - - in->readLine(); - int numberNodes = in->readInteger(); - int numberTris = in->readInteger(); - in->readLine(); - - double x,y,z; - for(int u=0;u<numberNodes;u++) - { - in->readInteger(); - x=in->readDouble(); - y=in->readDouble(); - z=in->readDouble(); - in->readLine(); - nodes->push_back(FeTriFaceMesh3D::Vertex((float)x,(float)y,(float)z)); - } - int id1,id2,id3; - for(int u=0;u<numberTris;u++) - { - in->readInteger(); - in->readInteger(); - in->readString(); - id1 = in->readInteger(); - id2 = in->readInteger(); - id3 = in->readInteger(); - triangles->push_back(FeTriFaceMesh3D::TriFace(id1-1,id2-1,id3-1)); - } - - FeTriFaceMesh3D* mesh = new FeTriFaceMesh3D(meshName, nodes, triangles); - - if(removeRedundantNodes) mesh->deleteRedundantNodes(); - - mesh->resizeAttributes(); -// mesh->createVertexTriFaceMap(); - mesh->calculateValues(); - - - return mesh; -} -/*======================================================================*/ -FeTriFaceMesh3D* FeTriFaceMesh3DCreator::readMeshFromVTKASCIIFile(string filename, string meshName, GbTriFaceMesh3D::KDTREE_SPLITAGORITHM splitAlg, bool removeRedundantNodes) -{ - UbFileInputASCII stlfile(filename); - if(!stlfile) throw UbException(UB_EXARGS,"cannot open file "+filename); - return FeTriFaceMesh3DCreator::readMeshFromVTKASCIIFile(&stlfile,meshName,splitAlg,removeRedundantNodes); -} -/*======================================================================*/ -FeTriFaceMesh3D* FeTriFaceMesh3DCreator::readMeshFromVTKASCIIFile(UbFileInput *in, string meshName, GbTriFaceMesh3D::KDTREE_SPLITAGORITHM splitAlg, bool removeRedundantNodes) -{ - UBLOG(logDEBUG1,"GbTriFaceMesh3DCreator.readMeshFromVTKASCIIFile !!! Dieses Format hat leider redundante Knoten ..."); - - vector<GbTriFaceMesh3D::Vertex> *nodes = new vector<GbTriFaceMesh3D::Vertex>; - vector<GbTriFaceMesh3D::TriFace> *triangles = new vector<GbTriFaceMesh3D::TriFace>; - string dummy; - - in->readLine(); - in->readLine(); - in->readLine(); - in->readLine(); - - in->readString(); - int numberNodes = in->readInteger(); - in->readLine(); - - double x,y,z; - for(int u=0;u<numberNodes;u++) - { - x=in->readDouble(); - y=in->readDouble(); - z=in->readDouble(); - nodes->push_back(GbTriFaceMesh3D::Vertex((float)x,(float)y,(float)z)); - } - in->readLine(); - in->readString(); - int numberTris = in->readInteger(); - in->readLine(); - UBLOG(logDEBUG1,"numberTris:"<<numberTris); - - int id1,id2,id3; - for(int u=0;u<numberTris;u++) - { - in->readInteger(); - id1 = in->readInteger(); - id2 = in->readInteger(); - id3 = in->readInteger(); - triangles->push_back(GbTriFaceMesh3D::TriFace(id1,id2,id3)); - //cout<<u<<" - id1,id2,id3:"<<id1<<","<<id2<<","<<id3<<endl; - } - UBLOG(logDEBUG1,"Tris gelesen"); - - FeTriFaceMesh3D* mesh = new FeTriFaceMesh3D(meshName, nodes, triangles); - - if(removeRedundantNodes) mesh->deleteRedundantNodes(); - - mesh->resizeAttributes(); -// mesh->createVertexTriFaceMap(); - mesh->calculateValues(); - - UBLOG(logDEBUG1,"mesh erzeugt (with remove redundant nodes = "<< boolalpha <<removeRedundantNodes<<")"); - - return mesh; -} diff --git a/src/basics/numerics/geometry3d/fem/creator/FeTriFaceMesh3DCreator.h b/src/basics/numerics/geometry3d/fem/creator/FeTriFaceMesh3DCreator.h deleted file mode 100644 index a7e25ea1984fa557ab304ab60a81afeb958937db..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/fem/creator/FeTriFaceMesh3DCreator.h +++ /dev/null @@ -1,82 +0,0 @@ -#ifndef FETRIFACEMESH3DCREATOR_H -#define FETRIFACEMESH3DCREATOR_H - -#include <numerics/geometry3d/creator/GbObject3DCreator.h> -#include <numerics/geometry3d/fem/FeTriFaceMesh3D.h> -#include <basics/utilities/UbFileInputASCII.h> - -#ifdef CAB_QT -#include <qfiledialog.h> -#endif - -#ifdef CAB_VTK -//#include <numerics/geometry3d/presentation/vtkGbTriangularMesh3D.h> -#endif - -class FeTriFaceMesh3DCreator : public GbObject3DCreator -{ -public: - static FeTriFaceMesh3DCreator* getInstance() - { - static FeTriFaceMesh3DCreator instance; - return &instance; - } - static FeTriFaceMesh3D* readMeshFromFile(std::string filename, std::string meshName, bool removeRedundantNodes=true); - - static FeTriFaceMesh3D* readMeshFromPLYFile(std::string filename, std::string meshName, bool removeRedundantNodes=true); - static FeTriFaceMesh3D* readMeshFromPLYFile(UbFileInput* in, std::string meshName, bool removeRedundantNodes=true); - - static FeTriFaceMesh3D* readMeshFromSTLFile(std::string filename, std::string meshName, bool removeRedundantNodes=true); - static FeTriFaceMesh3D* readMeshFromSTLFile(UbFileInput* in, std::string meshName, bool removeRedundantNodes=true); - - static FeTriFaceMesh3D* readMeshFromAVSFile(std::string filename, std::string meshName, bool removeRedundantNodes=true); - static FeTriFaceMesh3D* readMeshFromAVSFile(UbFileInput* in, std::string meshName, bool removeRedundantNodes=true); - - static FeTriFaceMesh3D* readMeshFromVTKASCIIFile(std::string filename, std::string meshName="", GbTriFaceMesh3D::KDTREE_SPLITAGORITHM splitAlg = GbTriFaceMesh3D::KDTREE_SAHPLIT, bool removeRedundantNodes=true); - static FeTriFaceMesh3D* readMeshFromVTKASCIIFile(UbFileInput* in, std::string meshName="", GbTriFaceMesh3D::KDTREE_SPLITAGORITHM splitAlg = GbTriFaceMesh3D::KDTREE_SAHPLIT, bool removeRedundantNodes=true); - - - FeTriFaceMesh3D* createGbObject3D() { return new FeTriFaceMesh3D(); } - - std::string getGbObject3DTypeID(){ return "FeTriFaceMesh3D"; }; - std::string toString() { return "FeTriFaceMesh3DCreator"; } - -#ifdef CAB_QT - - - FeTriFaceMesh3D* createGbObject3DwithQt() - { - //QString s = QFileDialog::getOpenFileName(NULL,NULL,NULL,"open file dialog","Choose a STL file" ); - QString s = QFileDialog::getOpenFileName(NULL, "Choose a STL file", "/home", "*.stl"); - //QFileDialog* fd = new QFileDialog( NULL ); - //fd->setIconText(QString("Hallo")); - //fd->show(); - //TODO: Open File Dialog einbauen. - UbFileInputASCII in( s.toAscii().data() ); - stringstream stream; - stream <<"TriangularMesh3D ";//<<_objCount++; - FeTriFaceMesh3D *mesh = NULL;//FeTriFaceMesh3DCreator::readMeshFromSTLFile(&in, stream.str() ); - return mesh; - } - //QDialog* getSpecificInstrument() { return 0;} - void editGbObject3DwithQt(GbObject3D* gbObj) - { - } -#endif -#ifdef CAB_VTK -public: - Presentator* createObjectPresentator(ObObject *object) { return new vtkGbTriangularMesh3D((GbTriangularMesh3D*)object); } -#endif - - -private: - FeTriFaceMesh3DCreator( const FeTriFaceMesh3DCreator& ); //no copy allowed - const FeTriFaceMesh3DCreator& operator=( const FeTriFaceMesh3DCreator& ); //no copy allowed - FeTriFaceMesh3DCreator() : GbObject3DCreator() {} -}; - -#ifndef SWIG -UB_AUTO_RUN_NAMED( GbObject3DFactory::getInstance()->addObObjectCreator(FeTriFaceMesh3DCreator::getInstance()), CAB_FeTriFaceMesh3DCreator); -#endif - -#endif diff --git a/src/basics/numerics/geometry3d/package.include b/src/basics/numerics/geometry3d/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/basics/numerics/geometry3d/presentation/QGbCuboid3DInstrument.cpp b/src/basics/numerics/geometry3d/presentation/QGbCuboid3DInstrument.cpp deleted file mode 100644 index 0e444b4b7776031dd728f87d32d30a0cb85190a9..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/presentation/QGbCuboid3DInstrument.cpp +++ /dev/null @@ -1,67 +0,0 @@ -#include "./QGbCuboid3DInstrument.h" - -/**** Qt ****/ -#include <qlineedit.h> -#include <qstring.h> -#include <qcheckbox.h> - -/**** CAB ****/ -#include "./../GbCuboid3D.h" -#include "./../GbPoint3D.h" - - -QGbCuboid3DInstrument::QGbCuboid3DInstrument( QWidget* parent, Qt::WFlags flags ):QDialog(parent, flags) -{ - ui.setupUi(this); - - this->gbCuboid = NULL; - -} - -QGbCuboid3DInstrument::~QGbCuboid3DInstrument() -{ -} - -void QGbCuboid3DInstrument::setGbCuboid3D(GbCuboid3D* cuboid) -{ - this->gbCuboid = cuboid; - ui.lineEditPoint1X->setText( QString("%1").arg(gbCuboid->getPoint1()->getX1Coordinate() ) ); - ui.lineEditPoint1Y->setText( QString("%1").arg(gbCuboid->getPoint1()->getX2Coordinate() ) ); - ui.lineEditPoint1Z->setText( QString("%1").arg(gbCuboid->getPoint1()->getX3Coordinate() ) ); - ui.lineEditPoint2X->setText( QString("%1").arg(gbCuboid->getPoint2()->getX1Coordinate() ) ); - ui.lineEditPoint2Y->setText( QString("%1").arg(gbCuboid->getPoint2()->getX2Coordinate() ) ); - ui.lineEditPoint2Z->setText( QString("%1").arg(gbCuboid->getPoint2()->getX3Coordinate() ) ); - //this->checkBoxActive->setChecked( cuboid->isActive() ); - ui.checkBoxActive->setChecked( true ); -} - -GbCuboid3D* QGbCuboid3DInstrument::getGbCuboid3D() -{ - return this->gbCuboid; -} - -//void QGbCuboid3DInstrument::SetGbObject3D(GbObject3D* gbObj) -//{ -// this->SetGbSphere(dynamic_cast<GbSphere3D*>(gbObj)); -//} - -void QGbCuboid3DInstrument::on_pBtnOK_clicked() -{ - this->gbCuboid->getPoint1()->setX1(ui.lineEditPoint1X->text().toDouble() ); - this->gbCuboid->getPoint1()->setX2(ui.lineEditPoint1Y->text().toDouble() ); - this->gbCuboid->getPoint1()->setX3(ui.lineEditPoint1Z->text().toDouble() ); - this->gbCuboid->getPoint2()->setX1(ui.lineEditPoint2X->text().toDouble() ); - this->gbCuboid->getPoint2()->setX2(ui.lineEditPoint2Y->text().toDouble() ); - this->gbCuboid->getPoint2()->setX3(ui.lineEditPoint2Z->text().toDouble() ); - //this->gbCuboid->setActive( this->checkBoxActive->isChecked() ); - - this->gbCuboid->notifyObserversObjectChanged(); - this->accept(); -} - - -void QGbCuboid3DInstrument::on_pBtnCancel_clicked() -{ - this->reject(); -} - diff --git a/src/basics/numerics/geometry3d/presentation/QGbCuboid3DInstrument.h b/src/basics/numerics/geometry3d/presentation/QGbCuboid3DInstrument.h deleted file mode 100644 index 312fb0efa42b7bd6d6fc08ec55d4e293f727cee8..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/presentation/QGbCuboid3DInstrument.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef QGBCUBOID3DINSTRUMENT_H -#define QGBCUBOID3DINSTRUMENT_H - - -#include "./QGbCuboid3DInstrumentUI.h" - -class GbCuboid3D; -class GbObject3D; - -class QGbCuboid3DInstrument : public QDialog -{ - Q_OBJECT - -public: - QGbCuboid3DInstrument( QWidget* parent = 0, Qt::WFlags fl = 0 ); - ~QGbCuboid3DInstrument(); - void setGbCuboid3D(GbCuboid3D* cuboid); - GbCuboid3D* getGbCuboid3D(); - -protected: - GbCuboid3D* gbCuboid; - -private: - Ui::QGbCuboid3DInstrument ui; - -private slots: - void on_pBtnOK_clicked(); - void on_pBtnCancel_clicked(); -}; - -#endif diff --git a/src/basics/numerics/geometry3d/presentation/QGbCuboid3DInstrument.ui b/src/basics/numerics/geometry3d/presentation/QGbCuboid3DInstrument.ui deleted file mode 100644 index e584634af9e5b0ac129a66f4ce105d5cba6e86ee..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/presentation/QGbCuboid3DInstrument.ui +++ /dev/null @@ -1,347 +0,0 @@ -<ui version="4.0" > - <author></author> - <comment></comment> - <exportmacro></exportmacro> - <class>QGbCuboid3DInstrument</class> - <widget class="QDialog" name="QGbCuboid3DInstrument" > - <property name="geometry" > - <rect> - <x>0</x> - <y>0</y> - <width>252</width> - <height>239</height> - </rect> - </property> - <property name="windowTitle" > - <string>GbCuboid3DInstrument</string> - </property> - <layout class="QGridLayout" > - <property name="margin" > - <number>10</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item row="0" column="0" > - <widget class="QLabel" name="textLabel2" > - <property name="font" > - <font> - <family>Arial</family> - <pointsize>20</pointsize> - <weight>50</weight> - <italic>false</italic> - <bold>false</bold> - <underline>false</underline> - <strikeout>false</strikeout> - </font> - </property> - <property name="text" > - <string>Cuboid</string> - </property> - </widget> - </item> - <item row="1" column="0" colspan="4" > - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <layout class="QVBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QLabel" name="textLabelPoint1" > - <property name="font" > - <font> - <family>Arial</family> - <pointsize>10</pointsize> - <weight>50</weight> - <italic>false</italic> - <bold>false</bold> - <underline>false</underline> - <strikeout>false</strikeout> - </font> - </property> - <property name="text" > - <string>Point 1:</string> - </property> - </widget> - </item> - <item> - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QLabel" name="textLabel1" > - <property name="text" > - <string>X:</string> - </property> - </widget> - </item> - <item> - <widget class="QLineEdit" name="lineEditPoint1X" > - <property name="text" > - <string>0</string> - </property> - </widget> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QLabel" name="textLabel1_2" > - <property name="text" > - <string>Y:</string> - </property> - </widget> - </item> - <item> - <widget class="QLineEdit" name="lineEditPoint1Y" > - <property name="text" > - <string>0</string> - </property> - </widget> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QLabel" name="textLabel1_3" > - <property name="text" > - <string>Z:</string> - </property> - </widget> - </item> - <item> - <widget class="QLineEdit" name="lineEditPoint1Z" > - <property name="text" > - <string>0</string> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </item> - <item> - <layout class="QVBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QLabel" name="textLabelPoint2" > - <property name="font" > - <font> - <family>Arial</family> - <pointsize>10</pointsize> - <weight>50</weight> - <italic>false</italic> - <bold>false</bold> - <underline>false</underline> - <strikeout>false</strikeout> - </font> - </property> - <property name="text" > - <string>Point 2:</string> - </property> - </widget> - </item> - <item> - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QLabel" name="textLabel1_4" > - <property name="text" > - <string>X:</string> - </property> - </widget> - </item> - <item> - <widget class="QLineEdit" name="lineEditPoint2X" > - <property name="text" > - <string>0</string> - </property> - </widget> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QLabel" name="textLabel1_2_2" > - <property name="text" > - <string>Y:</string> - </property> - </widget> - </item> - <item> - <widget class="QLineEdit" name="lineEditPoint2Y" > - <property name="text" > - <string>0</string> - </property> - </widget> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QLabel" name="textLabel1_3_2" > - <property name="text" > - <string>Z:</string> - </property> - </widget> - </item> - <item> - <widget class="QLineEdit" name="lineEditPoint2Z" > - <property name="text" > - <string>0</string> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </item> - </layout> - </item> - <item row="0" column="2" colspan="2" > - <spacer> - <property name="orientation" > - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType" > - <enum>QSizePolicy::Expanding</enum> - </property> - <property name="sizeHint" > - <size> - <width>90</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item row="4" column="0" > - <widget class="QPushButton" name="pBtnOK" > - <property name="text" > - <string>OK</string> - </property> - </widget> - </item> - <item row="4" column="3" > - <widget class="QPushButton" name="pBtnCancel" > - <property name="text" > - <string>Cancel</string> - </property> - </widget> - </item> - <item row="3" column="0" colspan="2" > - <spacer> - <property name="orientation" > - <enum>Qt::Vertical</enum> - </property> - <property name="sizeType" > - <enum>QSizePolicy::Expanding</enum> - </property> - <property name="sizeHint" > - <size> - <width>20</width> - <height>13</height> - </size> - </property> - </spacer> - </item> - <item row="2" column="3" > - <spacer> - <property name="orientation" > - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType" > - <enum>QSizePolicy::Expanding</enum> - </property> - <property name="sizeHint" > - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item row="2" column="0" colspan="3" > - <widget class="QCheckBox" name="checkBoxActive" > - <property name="text" > - <string>Active</string> - </property> - <property name="checked" > - <bool>true</bool> - </property> - </widget> - </item> - <item row="4" column="1" > - <spacer> - <property name="orientation" > - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType" > - <enum>QSizePolicy::Expanding</enum> - </property> - <property name="sizeHint" > - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </widget> - <layoutdefault spacing="6" margin="11" /> - <pixmapfunction>qPixmapFromMimeSource</pixmapfunction> - <resources/> - <connections/> -</ui> diff --git a/src/basics/numerics/geometry3d/presentation/QGbCylinder3DInstrument.cpp b/src/basics/numerics/geometry3d/presentation/QGbCylinder3DInstrument.cpp deleted file mode 100644 index 34ff20fe1b0b771609467e1317e184b9db87ce9a..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/presentation/QGbCylinder3DInstrument.cpp +++ /dev/null @@ -1,102 +0,0 @@ -#include "./QGbCylinder3DInstrument.h" - -/**** Qt ****/ -#include <QtCore/QString> -#include <QtGui/QLineEdit> -#include <QtGui/QCheckBox> -#include <QtGui/QTabWidget> - -/**** CAB ****/ -#include "./../GbCylinder3D.h" -#include "./../GbPoint3D.h" - -QGbCylinder3DInstrument::QGbCylinder3DInstrument( QWidget* parent, Qt::WFlags flags ) -{ - ui.setupUi(this); - - /*JZ TODO daher Buttons noch ausgeschaltet (29.11.05)*/ - ui.rBtnXAxis->setEnabled(false); - ui.rBtnYAxis->setEnabled(false); - ui.rBtnZAxis->setEnabled(false); - - this->gbCylinder = NULL; -} - -QGbCylinder3DInstrument::~QGbCylinder3DInstrument(void) -{ -} - -void QGbCylinder3DInstrument::setGbCylinder3D(GbCylinder3D* cylinder) -{ - this->gbCylinder = cylinder; - ui.lineEdit1_X_1->setText( QString("%1").arg(gbCylinder->getPoint1()->x1 ) ); - ui.lineEdit1_Y_1->setText( QString("%1").arg(gbCylinder->getPoint1()->x2 ) ); - ui.lineEdit1_Z_1->setText( QString("%1").arg(gbCylinder->getPoint1()->x3 ) ); - ui.lineEdit1_X_2->setText( QString("%1").arg(gbCylinder->getPoint2()->x1 ) ); - ui.lineEdit1_Y_2->setText( QString("%1").arg(gbCylinder->getPoint2()->x2 ) ); - ui.lineEdit1_Z_2->setText( QString("%1").arg(gbCylinder->getPoint2()->x3 ) ); - ui.dSpBoxRadius1->setValue(gbCylinder->getRadius()); - ui.checkBoxActive1->setChecked( true ); - ui.lineEdit2_X->setText( QString("%1").arg(gbCylinder->getPoint1()->x1 ) ); - ui.lineEdit2_Y->setText( QString("%1").arg(gbCylinder->getPoint1()->x2 ) ); - ui.lineEdit2_Z->setText( QString("%1").arg(gbCylinder->getPoint1()->x3 ) ); - ui.dSpBoxRadius2->setValue(gbCylinder->getRadius()); - ui.checkBoxActive2->setChecked( true ); - ui.lineEditLength->setText( QString("%1").arg(gbCylinder->getHeight()) ); - //if (!this->gbCylinder->isParallelToX1Axis()) - //{ - // if (!this->gbCylinder->isParallelToX2Axis()) - // { - // ui.rBtnZAxis->setChecked(true); - // } - // else ui.rBtnYAxis->setChecked(true); - //} - //else ui.rBtnXAxis->setChecked(true); -} - -GbCylinder3D* QGbCylinder3DInstrument::getGbCylinder3D(void) -{ - return this->gbCylinder; -} - -//void QGbSphere3DInstrument::SetGbObject3D(GbObject3D* gbObj) -//{ -// this->SetGbSphere(dynamic_cast<GbSphere3D*>(gbObj)); -//} - -void QGbCylinder3DInstrument::on_pBtnOK_clicked() -{ - if(ui.tabWidget->currentIndex()==0) - { - this->gbCylinder->setPoint1( ui.lineEdit1_X_1->text().toDouble(), - ui.lineEdit1_Y_1->text().toDouble(), - ui.lineEdit1_Z_1->text().toDouble()); - - this->gbCylinder->setPoint2( ui.lineEdit1_X_2->text().toDouble(), - ui.lineEdit1_Y_2->text().toDouble(), - ui.lineEdit1_Z_2->text().toDouble()); - this->gbCylinder->setRadius(ui.dSpBoxRadius1->value()); - - this->gbCylinder->notifyObserversObjectChanged(); - } - if(ui.tabWidget->currentIndex()==1) - { - this->gbCylinder->setPoint1( ui.lineEdit2_X->text().toDouble(), - ui.lineEdit2_Y->text().toDouble(), - ui.lineEdit2_Z->text().toDouble()); - this->gbCylinder->setPoint2( ui.lineEdit2_X->text().toDouble(), - ui.lineEdit2_Y->text().toDouble()+ui.lineEditLength->text().toDouble(), - ui.lineEdit2_Z->text().toDouble()); - this->gbCylinder->setRadius(ui.dSpBoxRadius2->value()); - - this->gbCylinder->notifyObserversObjectChanged(); - } - - this->accept(); -} - - -void QGbCylinder3DInstrument::on_pBtnCancel_clicked() -{ - this->reject(); -} diff --git a/src/basics/numerics/geometry3d/presentation/QGbCylinder3DInstrument.h b/src/basics/numerics/geometry3d/presentation/QGbCylinder3DInstrument.h deleted file mode 100644 index 3ab65d38079601166ee52f09e1436d5d61325629..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/presentation/QGbCylinder3DInstrument.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef QGBCYLINDER3DINSTRUMENT_H -#define QGBCYLINDER3DINSTRUMENT_H - -#include <QtGui/QDialog> -#include <QtGui/QWidget> - -#include "./QGbCylinder3DInstrumentUI.h" -#include "./QGbObject3DInstrument.h" - -class GbCylinder3D; -class GbObject3D; - -class QGbCylinder3DInstrument : public QDialog -{ - - Q_OBJECT - -public: - QGbCylinder3DInstrument( QWidget* parent = 0, Qt::WFlags flags = 0 ); - ~QGbCylinder3DInstrument(); - void setGbCylinder3D(GbCylinder3D* cylinder); - GbCylinder3D* getGbCylinder3D(); - -protected: - GbCylinder3D* gbCylinder; - -private: - Ui::QGbCylinder3DInstrument ui; - -private slots: - void on_pBtnOK_clicked(); - void on_pBtnCancel_clicked(); -}; - -#endif \ No newline at end of file diff --git a/src/basics/numerics/geometry3d/presentation/QGbCylinder3DInstrument.ui b/src/basics/numerics/geometry3d/presentation/QGbCylinder3DInstrument.ui deleted file mode 100644 index 18f74c5767165ca2f6621611bda9f26c7d630a27..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/presentation/QGbCylinder3DInstrument.ui +++ /dev/null @@ -1,682 +0,0 @@ -<ui version="4.0" > - <author></author> - <comment></comment> - <exportmacro></exportmacro> - <class>QGbCylinder3DInstrument</class> - <widget class="QDialog" name="QGbCylinder3DInstrument" > - <property name="geometry" > - <rect> - <x>0</x> - <y>0</y> - <width>457</width> - <height>347</height> - </rect> - </property> - <property name="windowTitle" > - <string>GbCylinder3DInstrument</string> - </property> - <layout class="QGridLayout" > - <property name="margin" > - <number>8</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item row="1" column="0" > - <widget class="QTabWidget" name="tabWidget" > - <widget class="QWidget" name="tabPoints" > - <attribute name="title" > - <string>Define by Points</string> - </attribute> - <layout class="QGridLayout" > - <property name="margin" > - <number>8</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item row="0" column="0" > - <widget class="QGroupBox" name="groupBox" > - <property name="title" > - <string>Base Centerpoint</string> - </property> - <layout class="QGridLayout" > - <property name="margin" > - <number>8</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item row="2" column="0" > - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QLabel" name="textLabel1_3_2" > - <property name="text" > - <string>Z:</string> - </property> - </widget> - </item> - <item> - <widget class="QLineEdit" name="lineEdit1_Z_1" > - <property name="text" > - <string>0.0</string> - </property> - </widget> - </item> - </layout> - </item> - <item row="1" column="0" > - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QLabel" name="textLabel1_2_3" > - <property name="text" > - <string>Y:</string> - </property> - </widget> - </item> - <item> - <widget class="QLineEdit" name="lineEdit1_Y_1" > - <property name="text" > - <string>0.0</string> - </property> - </widget> - </item> - </layout> - </item> - <item row="0" column="0" > - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QLabel" name="textLabel1_5" > - <property name="text" > - <string>X:</string> - </property> - </widget> - </item> - <item> - <widget class="QLineEdit" name="lineEdit1_X_1" > - <property name="text" > - <string>0.0</string> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </widget> - </item> - <item row="0" column="1" > - <widget class="QGroupBox" name="groupBox_2" > - <property name="title" > - <string>Top Centerpoint</string> - </property> - <layout class="QGridLayout" > - <property name="margin" > - <number>8</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item row="2" column="0" > - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QLabel" name="textLabel1_3_3_2_2" > - <property name="text" > - <string>Z:</string> - </property> - </widget> - </item> - <item> - <widget class="QLineEdit" name="lineEdit1_Z_2" > - <property name="text" > - <string>0.0</string> - </property> - </widget> - </item> - </layout> - </item> - <item row="1" column="0" > - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QLabel" name="textLabel1_2_2_2_2" > - <property name="text" > - <string>Y:</string> - </property> - </widget> - </item> - <item> - <widget class="QLineEdit" name="lineEdit1_Y_2" > - <property name="text" > - <string>0.0</string> - </property> - </widget> - </item> - </layout> - </item> - <item row="0" column="0" > - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QLabel" name="textLabel1_4_2_2" > - <property name="text" > - <string>X:</string> - </property> - </widget> - </item> - <item> - <widget class="QLineEdit" name="lineEdit1_X_2" > - <property name="text" > - <string>0.0</string> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </widget> - </item> - <item row="1" column="0" colspan="2" > - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QCheckBox" name="checkBoxActive1" > - <property name="text" > - <string>Active</string> - </property> - <property name="checked" > - <bool>true</bool> - </property> - </widget> - </item> - <item> - <spacer> - <property name="orientation" > - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" > - <size> - <width>51</width> - <height>60</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QGroupBox" name="groupBox_3_2" > - <property name="minimumSize" > - <size> - <width>16</width> - <height>60</height> - </size> - </property> - <property name="title" > - <string>Radius</string> - </property> - <layout class="QGridLayout" > - <property name="margin" > - <number>8</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item row="0" column="1" > - <widget class="QDoubleSpinBox" name="dSpBoxRadius1" > - <property name="decimals" > - <number>1</number> - </property> - <property name="maximum" > - <double>100</double> - </property> - <property name="value" > - <double>3</double> - </property> - </widget> - </item> - </layout> - </widget> - </item> - </layout> - </item> - </layout> - </widget> - <widget class="QWidget" name="tabLength" > - <attribute name="title" > - <string>Define by Length</string> - </attribute> - <layout class="QGridLayout" > - <property name="margin" > - <number>8</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item row="0" column="1" > - <widget class="QGroupBox" name="groupBox_5" > - <property name="title" > - <string>Parameters</string> - </property> - <layout class="QGridLayout" > - <property name="margin" > - <number>8</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item row="2" column="0" colspan="2" > - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QRadioButton" name="rBtnXAxis" > - <property name="text" > - <string>X - Axis</string> - </property> - </widget> - </item> - <item> - <widget class="QRadioButton" name="rBtnYAxis" > - <property name="text" > - <string>Y - Axis</string> - </property> - </widget> - </item> - <item> - <widget class="QRadioButton" name="rBtnZAxis" > - <property name="text" > - <string>Z - Axis</string> - </property> - </widget> - </item> - </layout> - </item> - <item row="0" column="0" > - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QLabel" name="textLabel1_5_2_2" > - <property name="text" > - <string>Length:</string> - </property> - </widget> - </item> - <item> - <widget class="QLineEdit" name="lineEditLength" > - <property name="text" > - <string>0.0</string> - </property> - </widget> - </item> - </layout> - </item> - <item row="1" column="0" > - <widget class="QLabel" name="label" > - <property name="text" > - <string>Parallel to</string> - </property> - </widget> - </item> - <item row="0" column="1" > - <spacer> - <property name="orientation" > - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" > - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - <widget class="QWidget" name="widget_2" > - <property name="geometry" > - <rect> - <x>11</x> - <y>71</y> - <width>194</width> - <height>18</height> - </rect> - </property> - </widget> - </widget> - </item> - <item row="0" column="0" > - <widget class="QGroupBox" name="groupBox_4" > - <property name="title" > - <string>Base Centerpoint</string> - </property> - <layout class="QGridLayout" > - <property name="margin" > - <number>8</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item row="2" column="0" > - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QLabel" name="textLabel1_3_2_2" > - <property name="text" > - <string>Z:</string> - </property> - </widget> - </item> - <item> - <widget class="QLineEdit" name="lineEdit2_Z" > - <property name="text" > - <string>0.0</string> - </property> - </widget> - </item> - </layout> - </item> - <item row="1" column="0" > - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QLabel" name="textLabel1_2_3_2" > - <property name="text" > - <string>Y:</string> - </property> - </widget> - </item> - <item> - <widget class="QLineEdit" name="lineEdit2_Y" > - <property name="text" > - <string>0.0</string> - </property> - </widget> - </item> - </layout> - </item> - <item row="0" column="0" > - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QLabel" name="textLabel1_5_2" > - <property name="text" > - <string>X:</string> - </property> - </widget> - </item> - <item> - <widget class="QLineEdit" name="lineEdit2_X" > - <property name="text" > - <string>0.0</string> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </widget> - </item> - <item row="1" column="0" colspan="2" > - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QCheckBox" name="checkBoxActive2" > - <property name="text" > - <string>Active</string> - </property> - <property name="checked" > - <bool>true</bool> - </property> - </widget> - </item> - <item> - <spacer> - <property name="orientation" > - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" > - <size> - <width>51</width> - <height>60</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QGroupBox" name="groupBox_3_2_2" > - <property name="minimumSize" > - <size> - <width>16</width> - <height>60</height> - </size> - </property> - <property name="title" > - <string>Radius</string> - </property> - <layout class="QGridLayout" > - <property name="margin" > - <number>8</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item row="0" column="1" > - <widget class="QDoubleSpinBox" name="dSpBoxRadius2" > - <property name="decimals" > - <number>1</number> - </property> - <property name="maximum" > - <double>100</double> - </property> - <property name="value" > - <double>3</double> - </property> - </widget> - </item> - </layout> - </widget> - </item> - </layout> - </item> - </layout> - <widget class="QWidget" name="widget" > - <property name="geometry" > - <rect> - <x>9</x> - <y>9</y> - <width>415</width> - <height>101</height> - </rect> - </property> - </widget> - </widget> - </widget> - </item> - <item row="0" column="0" > - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QLabel" name="textLabel2" > - <property name="font" > - <font> - <family>Arial</family> - <pointsize>20</pointsize> - <weight>50</weight> - <italic>false</italic> - <bold>false</bold> - <underline>false</underline> - <strikeout>false</strikeout> - </font> - </property> - <property name="text" > - <string>Cylinder</string> - </property> - </widget> - </item> - <item> - <spacer> - <property name="orientation" > - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType" > - <enum>QSizePolicy::Expanding</enum> - </property> - <property name="sizeHint" > - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - <item row="3" column="0" > - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QPushButton" name="pBtnOK" > - <property name="text" > - <string>OK</string> - </property> - </widget> - </item> - <item> - <spacer> - <property name="orientation" > - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" > - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QPushButton" name="pBtnCancel" > - <property name="text" > - <string>Cancel</string> - </property> - </widget> - </item> - </layout> - </item> - <item row="2" column="0" > - <spacer> - <property name="orientation" > - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" > - <size> - <width>20</width> - <height>40</height> - </size> - </property> - </spacer> - </item> - </layout> - </widget> - <layoutdefault spacing="6" margin="11" /> - <pixmapfunction>qPixmapFromMimeSource</pixmapfunction> - <tabstops> - <tabstop>tabWidget</tabstop> - <tabstop>lineEdit1_X_1</tabstop> - <tabstop>lineEdit1_X_2</tabstop> - <tabstop>lineEdit1_Y_1</tabstop> - <tabstop>lineEdit1_Y_2</tabstop> - <tabstop>lineEdit1_Z_1</tabstop> - <tabstop>lineEdit1_Z_2</tabstop> - <tabstop>checkBoxActive1</tabstop> - <tabstop>dSpBoxRadius1</tabstop> - <tabstop>lineEdit2_X</tabstop> - <tabstop>lineEdit2_Y</tabstop> - <tabstop>lineEdit2_Z</tabstop> - <tabstop>lineEditLength</tabstop> - <tabstop>rBtnXAxis</tabstop> - <tabstop>rBtnYAxis</tabstop> - <tabstop>rBtnZAxis</tabstop> - <tabstop>checkBoxActive2</tabstop> - <tabstop>dSpBoxRadius2</tabstop> - <tabstop>pBtnOK</tabstop> - <tabstop>pBtnCancel</tabstop> - </tabstops> - <resources/> - <connections/> -</ui> diff --git a/src/basics/numerics/geometry3d/presentation/QGbObject3DInstrument.cpp b/src/basics/numerics/geometry3d/presentation/QGbObject3DInstrument.cpp deleted file mode 100644 index 62c4b2bf46d46b2116e849317c16341737b6541a..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/presentation/QGbObject3DInstrument.cpp +++ /dev/null @@ -1,66 +0,0 @@ -#include "./QGbObject3DInstrument.h" - -/**** Qt ****/ -#include <qlineedit.h> - -/**** vtk ****/ -#include "./../GbObject3D.h" -#include "./../../../basics/utilities/UbMath.h" - -//#define PI 3.14159265358979323846 - -QGbObject3DInstrument::QGbObject3DInstrument( QWidget* parent, Qt::WFlags flags ) -{ - ui.setupUi(this); - - this->gbObject3D = NULL; -} - -QGbObject3DInstrument::~QGbObject3DInstrument() -{ -} - -void QGbObject3DInstrument::setGbObject3D(GbObject3D* obj) -{ - this->gbObject3D = obj; -} - -GbObject3D* QGbObject3DInstrument::getGbObject3D() -{ - return this->gbObject3D; -} - -void QGbObject3DInstrument::on_pBtnOK_clicked() -{ - double rx = ui.lineEditRotationX->text().toDouble(); - double ry = ui.lineEditRotationY->text().toDouble(); - double rz = ui.lineEditRotationZ->text().toDouble(); - - rx *= UbMath::PI /180; - ry *= UbMath::PI /180; - rz *= UbMath::PI /180; - - if ( rx != 0.0 || ry != 0.0 || rz != 0.0 ) this->gbObject3D->rotate(rx, ry, rz); - - double sx = ui.lineEditScalingX->text().toDouble(); - double sy = ui.lineEditScalingY->text().toDouble(); - double sz = ui.lineEditScalingZ->text().toDouble(); - - if ( sx != 0.0 || sy != 0.0 || sz != 0.0 ) this->gbObject3D->scale(sx, sy, sz); - - double x = ui.lineEditTranlationX->text().toDouble(); - double y = ui.lineEditTranlationY->text().toDouble(); - double z = ui.lineEditTranlationZ->text().toDouble(); - - if ( x != 0.0 || y != 0.0 || z != 0.0 ) this->gbObject3D->translate(x, y, z); - - this->gbObject3D->notifyObserversObjectChanged(); - - this->accept(); -} - - -void QGbObject3DInstrument::on_pBtnCancel_clicked() -{ - this->reject(); -} diff --git a/src/basics/numerics/geometry3d/presentation/QGbObject3DInstrument.h b/src/basics/numerics/geometry3d/presentation/QGbObject3DInstrument.h deleted file mode 100644 index 5c3e556b59d1be37cf7a0794684af2a1967e4ac2..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/presentation/QGbObject3DInstrument.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef QGBOBJECT3DINSTRUMENT_H -#define QGBOBJECT3DINSTRUMENT_H - -#include <QDialog> -#include "./QGbObject3DInstrumentUI.h" - - -class GbObject3D; - -class QGbObject3DInstrument : public QDialog -{ - Q_OBJECT - -public: - QGbObject3DInstrument( QWidget* parent = 0, Qt::WFlags flags = 0 ); - ~QGbObject3DInstrument(); - void setGbObject3D(GbObject3D* gbObject); - GbObject3D* getGbObject3D(); - -protected: - GbObject3D *gbObject3D; - -private: - Ui::QGbObject3DInstrument ui; - -private slots: - void on_pBtnOK_clicked(); - void on_pBtnCancel_clicked(); -}; -#endif diff --git a/src/basics/numerics/geometry3d/presentation/QGbObject3DInstrument.ui b/src/basics/numerics/geometry3d/presentation/QGbObject3DInstrument.ui deleted file mode 100644 index 2fb6f96a9432533a5d7af0e71f3fcc6cbc5caf8a..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/presentation/QGbObject3DInstrument.ui +++ /dev/null @@ -1,512 +0,0 @@ -<ui version="4.0" > - <author></author> - <comment></comment> - <exportmacro></exportmacro> - <class>QGbObject3DInstrument</class> - <widget class="QDialog" name="QGbObject3DInstrument" > - <property name="geometry" > - <rect> - <x>0</x> - <y>0</y> - <width>391</width> - <height>167</height> - </rect> - </property> - <property name="windowTitle" > - <string>GeneralModifyInstrument</string> - </property> - <layout class="QGridLayout" > - <property name="margin" > - <number>10</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item row="2" column="1" > - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QPushButton" name="pBtnOK" > - <property name="text" > - <string>OK</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="pBtnCancel" > - <property name="text" > - <string>Cancel</string> - </property> - </widget> - </item> - </layout> - </item> - <item row="2" column="2" > - <spacer> - <property name="orientation" > - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType" > - <enum>QSizePolicy::Expanding</enum> - </property> - <property name="sizeHint" > - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item row="2" column="0" > - <spacer> - <property name="orientation" > - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType" > - <enum>QSizePolicy::Expanding</enum> - </property> - <property name="sizeHint" > - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item row="1" column="1" > - <spacer> - <property name="orientation" > - <enum>Qt::Vertical</enum> - </property> - <property name="sizeType" > - <enum>QSizePolicy::Expanding</enum> - </property> - <property name="sizeHint" > - <size> - <width>20</width> - <height>16</height> - </size> - </property> - </spacer> - </item> - <item row="0" column="0" colspan="3" > - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <layout class="QGridLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item row="0" column="0" > - <widget class="QLabel" name="textLabel1" > - <property name="font" > - <font> - <family>Tahoma</family> - <pointsize>10</pointsize> - <weight>50</weight> - <italic>false</italic> - <bold>false</bold> - <underline>false</underline> - <strikeout>false</strikeout> - </font> - </property> - <property name="text" > - <string>Translation:</string> - </property> - </widget> - </item> - <item row="3" column="0" > - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QLabel" name="textLabel2_2_2" > - <property name="font" > - <font> - <family>Tahoma</family> - <pointsize>10</pointsize> - <weight>50</weight> - <italic>false</italic> - <bold>false</bold> - <underline>false</underline> - <strikeout>false</strikeout> - </font> - </property> - <property name="text" > - <string>Z:</string> - </property> - </widget> - </item> - <item> - <widget class="QLineEdit" name="lineEditTranlationZ" > - <property name="text" > - <string>0.0</string> - </property> - </widget> - </item> - </layout> - </item> - <item row="1" column="0" > - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QLabel" name="textLabel2" > - <property name="font" > - <font> - <family>Tahoma</family> - <pointsize>10</pointsize> - <weight>50</weight> - <italic>false</italic> - <bold>false</bold> - <underline>false</underline> - <strikeout>false</strikeout> - </font> - </property> - <property name="text" > - <string>X:</string> - </property> - </widget> - </item> - <item> - <widget class="QLineEdit" name="lineEditTranlationX" > - <property name="text" > - <string>0.0</string> - </property> - </widget> - </item> - </layout> - </item> - <item row="2" column="0" > - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QLabel" name="textLabel2_2" > - <property name="font" > - <font> - <family>Tahoma</family> - <pointsize>10</pointsize> - <weight>50</weight> - <italic>false</italic> - <bold>false</bold> - <underline>false</underline> - <strikeout>false</strikeout> - </font> - </property> - <property name="text" > - <string>Y:</string> - </property> - </widget> - </item> - <item> - <widget class="QLineEdit" name="lineEditTranlationY" > - <property name="text" > - <string>0.0</string> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </item> - <item> - <layout class="QGridLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item row="0" column="0" > - <widget class="QLabel" name="textLabel1_2" > - <property name="font" > - <font> - <family>Tahoma</family> - <pointsize>10</pointsize> - <weight>50</weight> - <italic>false</italic> - <bold>false</bold> - <underline>false</underline> - <strikeout>false</strikeout> - </font> - </property> - <property name="text" > - <string>Rotation:</string> - </property> - </widget> - </item> - <item row="3" column="0" > - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QLabel" name="textLabel2_2_2_2" > - <property name="font" > - <font> - <family>Tahoma</family> - <pointsize>10</pointsize> - <weight>50</weight> - <italic>false</italic> - <bold>false</bold> - <underline>false</underline> - <strikeout>false</strikeout> - </font> - </property> - <property name="text" > - <string>Z:</string> - </property> - </widget> - </item> - <item> - <widget class="QLineEdit" name="lineEditRotationZ" > - <property name="text" > - <string>0.0</string> - </property> - </widget> - </item> - </layout> - </item> - <item row="1" column="0" > - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QLabel" name="textLabel2_3" > - <property name="font" > - <font> - <family>Tahoma</family> - <pointsize>10</pointsize> - <weight>50</weight> - <italic>false</italic> - <bold>false</bold> - <underline>false</underline> - <strikeout>false</strikeout> - </font> - </property> - <property name="text" > - <string>X:</string> - </property> - </widget> - </item> - <item> - <widget class="QLineEdit" name="lineEditRotationX" > - <property name="text" > - <string>0.0</string> - </property> - </widget> - </item> - </layout> - </item> - <item row="2" column="0" > - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QLabel" name="textLabel2_2_3" > - <property name="font" > - <font> - <family>Tahoma</family> - <pointsize>10</pointsize> - <weight>50</weight> - <italic>false</italic> - <bold>false</bold> - <underline>false</underline> - <strikeout>false</strikeout> - </font> - </property> - <property name="text" > - <string>Y:</string> - </property> - </widget> - </item> - <item> - <widget class="QLineEdit" name="lineEditRotationY" > - <property name="text" > - <string>0.0</string> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </item> - <item> - <layout class="QGridLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item row="0" column="0" > - <widget class="QLabel" name="textLabel1_2_2" > - <property name="font" > - <font> - <family>Tahoma</family> - <pointsize>10</pointsize> - <weight>50</weight> - <italic>false</italic> - <bold>false</bold> - <underline>false</underline> - <strikeout>false</strikeout> - </font> - </property> - <property name="text" > - <string>Scaling:</string> - </property> - </widget> - </item> - <item row="3" column="0" > - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QLabel" name="textLabel2_2_2_2_2" > - <property name="font" > - <font> - <family>Tahoma</family> - <pointsize>10</pointsize> - <weight>50</weight> - <italic>false</italic> - <bold>false</bold> - <underline>false</underline> - <strikeout>false</strikeout> - </font> - </property> - <property name="text" > - <string>Z:</string> - </property> - </widget> - </item> - <item> - <widget class="QLineEdit" name="lineEditScalingZ" > - <property name="text" > - <string>1.0</string> - </property> - </widget> - </item> - </layout> - </item> - <item row="1" column="0" > - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QLabel" name="textLabel2_3_2" > - <property name="font" > - <font> - <family>Tahoma</family> - <pointsize>10</pointsize> - <weight>50</weight> - <italic>false</italic> - <bold>false</bold> - <underline>false</underline> - <strikeout>false</strikeout> - </font> - </property> - <property name="text" > - <string>X:</string> - </property> - </widget> - </item> - <item> - <widget class="QLineEdit" name="lineEditScalingX" > - <property name="text" > - <string>1.0</string> - </property> - </widget> - </item> - </layout> - </item> - <item row="2" column="0" > - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QLabel" name="textLabel2_2_3_2" > - <property name="font" > - <font> - <family>Tahoma</family> - <pointsize>10</pointsize> - <weight>50</weight> - <italic>false</italic> - <bold>false</bold> - <underline>false</underline> - <strikeout>false</strikeout> - </font> - </property> - <property name="text" > - <string>Y:</string> - </property> - </widget> - </item> - <item> - <widget class="QLineEdit" name="lineEditScalingY" > - <property name="text" > - <string>1.0</string> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </item> - </layout> - </item> - </layout> - </widget> - <layoutdefault spacing="6" margin="11" /> - <pixmapfunction>qPixmapFromMimeSource</pixmapfunction> - <resources/> - <connections/> -</ui> diff --git a/src/basics/numerics/geometry3d/presentation/QGbSphere3DInstrument.cpp b/src/basics/numerics/geometry3d/presentation/QGbSphere3DInstrument.cpp deleted file mode 100644 index bb397eda50f014c0dab545780e261cb795f8cb36..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/presentation/QGbSphere3DInstrument.cpp +++ /dev/null @@ -1,60 +0,0 @@ -#include "./QGbSphere3DInstrument.h" - -/**** Qt ****/ -#include <qlineedit.h> -#include <qstring.h> -#include <qcheckbox.h> - -/**** CAB ****/ -#include "./../GbSphere3D.h" - -QGbSphere3DInstrument::QGbSphere3DInstrument( QWidget* parent, Qt::WFlags flags ):QDialog(parent,flags) -{ - - ui.setupUi(this); - - this->gbSphere = NULL; -} - -QGbSphere3DInstrument::~QGbSphere3DInstrument(void) -{ -} - -void QGbSphere3DInstrument::setGbSphere3D(GbSphere3D* sphere) -{ - this->gbSphere = sphere; - ui.lineEditX->setText( QString("%1").arg(gbSphere->getX1Centroid() ) ); - ui.lineEditY->setText( QString("%1").arg(gbSphere->getX2Centroid() ) ); - ui.lineEditZ->setText( QString("%1").arg(gbSphere->getX3Centroid() ) ); - ui.lineEditName->setText( QString(gbSphere->getName().c_str()) ); - ui.lineEditRadius->setText( QString("%1").arg(gbSphere->getRadius() ) ); - ui.checkBoxActive->setChecked( true ); -} - -GbSphere3D* QGbSphere3DInstrument::getGbSphere3D(void) -{ - return this->gbSphere; -} - -//void QGbSphere3DInstrument::SetGbObject3D(GbObject3D* gbObj) -//{ -// this->SetGbSphere(dynamic_cast<GbSphere3D*>(gbObj)); -//} - -void QGbSphere3DInstrument::on_pBtnOK_clicked() -{ - this->gbSphere->setCenterX1Coordinate(ui.lineEditX->text().toDouble()); - this->gbSphere->setCenterX2Coordinate(ui.lineEditY->text().toDouble()); - this->gbSphere->setCenterX3Coordinate(ui.lineEditZ->text().toDouble()); - this->gbSphere->setRadius(ui.lineEditRadius->text().toDouble()); - this->gbSphere->setName(ui.lineEditName->text().toStdString()); - //this->gbSphere->setActive( this->checkBoxActive->isChecked() ); - this->gbSphere->notifyObserversObjectChanged(); - this->accept(); -} - - -void QGbSphere3DInstrument::on_pBtnCancel_clicked() -{ - this->reject(); -} diff --git a/src/basics/numerics/geometry3d/presentation/QGbSphere3DInstrument.h b/src/basics/numerics/geometry3d/presentation/QGbSphere3DInstrument.h deleted file mode 100644 index afe97b1ef80e3f0c09eebdda57fbf098f159e341..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/presentation/QGbSphere3DInstrument.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef QGBSPHERE3DINSTRUMENT_H -#define QGBSPHERE3DINSTRUMENT_H - -#include <QtGui/QDialog> -#include <QtGui/QWidget> - -#include "./QGbSphere3DInstrumentUI.h" -#include "./QGbObject3DInstrument.h" - -class GbSphere3D; -class GbObject3D; - - -class QGbSphere3DInstrument : public QDialog -{ - Q_OBJECT - -public: - QGbSphere3DInstrument( QWidget* parent = 0, Qt::WFlags flags = 0 ); - ~QGbSphere3DInstrument(); - void setGbSphere3D(GbSphere3D* sphere); - GbSphere3D* getGbSphere3D(); - //void SetGbObject3D(GbObject3D*); - -protected: - GbSphere3D* gbSphere; - -private: - Ui::QGbSphere3DInstrument ui; - -private slots: - void on_pBtnOK_clicked(); - void on_pBtnCancel_clicked(); -}; - -#endif diff --git a/src/basics/numerics/geometry3d/presentation/QGbSphere3DInstrument.ui b/src/basics/numerics/geometry3d/presentation/QGbSphere3DInstrument.ui deleted file mode 100644 index dced5d31c34f6a58ac6c1c9b235f975cbc542a2f..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/presentation/QGbSphere3DInstrument.ui +++ /dev/null @@ -1,303 +0,0 @@ -<ui version="4.0" > - <author></author> - <comment></comment> - <exportmacro></exportmacro> - <class>QGbSphere3DInstrument</class> - <widget class="QDialog" name="QGbSphere3DInstrument" > - <property name="geometry" > - <rect> - <x>0</x> - <y>0</y> - <width>426</width> - <height>180</height> - </rect> - </property> - <property name="windowTitle" > - <string>GbSphere3DInstrument</string> - </property> - <widget class="QWidget" name="layoutWidget" > - <property name="geometry" > - <rect> - <x>10</x> - <y>50</y> - <width>406</width> - <height>82</height> - </rect> - </property> - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <layout class="QVBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QLabel" name="textLabel1" > - <property name="text" > - <string>X:</string> - </property> - </widget> - </item> - <item> - <widget class="QLineEdit" name="lineEditX" > - <property name="text" > - <string>0</string> - </property> - </widget> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QLabel" name="textLabel1_2" > - <property name="text" > - <string>Y:</string> - </property> - </widget> - </item> - <item> - <widget class="QLineEdit" name="lineEditY" > - <property name="text" > - <string>0</string> - </property> - </widget> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QLabel" name="textLabel1_3" > - <property name="text" > - <string>Z:</string> - </property> - </widget> - </item> - <item> - <widget class="QLineEdit" name="lineEditZ" > - <property name="text" > - <string>0</string> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </item> - <item> - <layout class="QVBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <layout class="QVBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QLabel" name="textLabel1_3_2" > - <property name="text" > - <string>Radius:</string> - </property> - </widget> - </item> - <item> - <widget class="QLineEdit" name="lineEditRadius" > - <property name="text" > - <string>5</string> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </item> - <item> - <widget class="QCheckBox" name="checkBoxActive" > - <property name="text" > - <string>Active</string> - </property> - <property name="checked" > - <bool>true</bool> - </property> - </widget> - </item> - <item> - <spacer> - <property name="orientation" > - <enum>Qt::Vertical</enum> - </property> - <property name="sizeType" > - <enum>QSizePolicy::Expanding</enum> - </property> - <property name="sizeHint" > - <size> - <width>20</width> - <height>16</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - </layout> - </widget> - <widget class="QWidget" name="layoutWidget" > - <property name="geometry" > - <rect> - <x>10</x> - <y>144</y> - <width>401</width> - <height>28</height> - </rect> - </property> - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QPushButton" name="pBtnOK" > - <property name="text" > - <string>OK</string> - </property> - </widget> - </item> - <item> - <spacer> - <property name="orientation" > - <enum>Qt::Vertical</enum> - </property> - <property name="sizeType" > - <enum>QSizePolicy::Expanding</enum> - </property> - <property name="sizeHint" > - <size> - <width>132</width> - <height>16</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QPushButton" name="pBtnCancel" > - <property name="text" > - <string>Cancel</string> - </property> - </widget> - </item> - </layout> - </widget> - <widget class="QWidget" name="" > - <property name="geometry" > - <rect> - <x>12</x> - <y>12</y> - <width>401</width> - <height>35</height> - </rect> - </property> - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QLabel" name="textLabel2" > - <property name="font" > - <font> - <family>Arial</family> - <pointsize>20</pointsize> - <weight>50</weight> - <italic>false</italic> - <bold>false</bold> - <underline>false</underline> - <strikeout>false</strikeout> - </font> - </property> - <property name="text" > - <string>Sphere</string> - </property> - </widget> - </item> - <item> - <spacer> - <property name="orientation" > - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType" > - <enum>QSizePolicy::Expanding</enum> - </property> - <property name="sizeHint" > - <size> - <width>101</width> - <height>33</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QLabel" name="textLabel1_3_3" > - <property name="text" > - <string>Name:</string> - </property> - </widget> - </item> - <item> - <widget class="QLineEdit" name="lineEditName" /> - </item> - </layout> - </widget> - </widget> - <layoutdefault spacing="6" margin="11" /> - <pixmapfunction>qPixmapFromMimeSource</pixmapfunction> - <resources/> - <connections/> -</ui> diff --git a/src/basics/numerics/geometry3d/presentation/QVTKGbObject3DViewer.cpp b/src/basics/numerics/geometry3d/presentation/QVTKGbObject3DViewer.cpp deleted file mode 100644 index 46f97bf4af49e4b096d8d067b55f4e4be1d4315f..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/presentation/QVTKGbObject3DViewer.cpp +++ /dev/null @@ -1,35 +0,0 @@ -#include "./QVTKGbObject3DViewer.h" - -/**** Qt ****/ -#include <qtabwidget.h> -#include <qlabel.h> -/**** vtk ****/ - -#include <QVTKWidget.h> -//#include "QvtkWindow.h" - -/**** CAB ****/ -#include "./../../../basics/utilities/UbMath.h" -#include "./../GbObject3DManager.h" - - -#include "./../../../userinterface/instrument/QManagerPresentatorInstrument.h" -//#include "./QGbObject3DManagerInstrument.h" - - - -QVTKGbObject3DViewer::QVTKGbObject3DViewer():QVTKViewer3DApplication() -{ - //GbObjectManagerInstrument - this->gbObject3DManager = new GbObject3DManager(); - QManagerPresentatorInstrument* gbObjManInst = new QManagerPresentatorInstrument(gbObject3DManager); - //gbObjManInst->setQViewer(this->getViewer()); - - //Instrumente hinzufügen - this->addInstrument(gbObjManInst, "Geometries"); -} - -QVTKGbObject3DViewer::~QVTKGbObject3DViewer() -{ -} - diff --git a/src/basics/numerics/geometry3d/presentation/QVTKGbObject3DViewer.h b/src/basics/numerics/geometry3d/presentation/QVTKGbObject3DViewer.h deleted file mode 100644 index 86b4cb83170fb14bfa692823306ac2e785fc5b15..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/presentation/QVTKGbObject3DViewer.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef QVTKGBOBJECT3DVIEWER_H -#define QVTGBOBJECT3DKVIEWER_H - -#include "./../../../userinterface/viewer3d/QVTKViewer3DApplication.h" - -class QVTKWindow; -class QVTKViewer3D; -class GbObject3DManager; -class OctNodeGridManager; - -class QVTKGbObject3DViewer : public QVTKViewer3DApplication -{ -public: - QVTKGbObject3DViewer(); - ~QVTKGbObject3DViewer(); - -protected: - - GbObject3DManager* gbObject3DManager; - -}; -#endif diff --git a/src/basics/numerics/geometry3d/presentation/vtkGbCuboid3D.cpp b/src/basics/numerics/geometry3d/presentation/vtkGbCuboid3D.cpp deleted file mode 100644 index bfd53a09c4a053c79f0593bbba8286483a42649b..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/presentation/vtkGbCuboid3D.cpp +++ /dev/null @@ -1,144 +0,0 @@ -#include "./vtkGbCuboid3D.h" - -#include "./../GbCuboid3D.h" -#include "./../../../userinterface/presentation/vtkEventCallbacks.h" - -#include "vtkCubeSource.h" -#include "vtkPolyDataMapper.h" -//#include "math.h" - -vtkGbCuboid3D::vtkGbCuboid3D(GbCuboid3D* gbObject) -{ - this->gbCuboid = gbObject; - this->gbCuboid->addObserver(this); - - this->setName("vtkGbCuboid3D"); - - this->source = vtkCubeSource::New(); - this->mapper = vtkPolyDataMapper::New(); - - this->setValues(); - - this->mapper->SetInput( this->source->GetOutput() ); - this->actor->SetMapper( this->mapper ); -} - -vtkGbCuboid3D::~vtkGbCuboid3D(void) -{ - this->gbCuboid->removeObserver(this); - if (this->source) this->source->Delete(); -} - -//void vtkGbCuboid3D::ModifiedEventFired() -//{ -// //double a_orien[3]; -// double a_pos[3]; -// this->actor->GetPosition(a_pos); -// //this->actor->GetOrientation(a_orien); -// this->actor->SetPosition(0.0,0.0,0.0); -// this->actor->SetOrientation(0.0,0.0,0.0); -// this->actor->SetScale(1.0,1.0,1.0); -// -// //cout<<"Orien:"<<a_orien[0]<<","<<a_orien[1]<<","<<a_orien[3]<<endl; -// //cout<<"Position:"<<a_pos[0]<<","<<a_pos[1]<<","<<a_pos[3]<<endl; -// -// this->gbCuboid->translate(a_pos[0], a_pos[1], a_pos[2]); -// this->gbCuboid->notifyObserversObjectChanged(); -//} - -void vtkGbCuboid3D::applyActorModifications() -{ - if (isModified) - { - double pos[3]; - double scale[3]; - //double orien[3]; - this->actor->GetPosition(pos); - this->actor->GetScale(scale); - //this->actor->GetOrientation(orien); - - this->actor->SetPosition(0.0,0.0,0.0); - this->actor->SetOrientation(0.0,0.0,0.0); - this->actor->SetScale(1.0,1.0,1.0); - - //cout<<"Orien:"<<a_orien[0]<<","<<a_orien[1]<<","<<a_orien[3]<<endl; - //cout<<"Position:"<<a_pos[0]<<","<<a_pos[1]<<","<<a_pos[3]<<endl; - - - //////////////////////////////////////////////////////////////////////////// - ////Rotieren - ////[Cy x1 + Sy x3, x2, -Sy x1 + Cy x3, 1] - //double center[3]; - //center[0] = this->gbCuboid->getX1Centroid(); - //center[1] = this->gbCuboid->getX2Centroid(); - //center[2] = this->gbCuboid->getX3Centroid(); - - ////Punkt1 - //double p1x = this->gbCuboid->getPoint1()->getX1Coordinate(); - //double p1y = this->gbCuboid->getPoint1()->getX2Coordinate(); - //double p1z = this->gbCuboid->getPoint1()->getX3Coordinate(); - - //p1x = cos(orien[1]) * p1x + sin(orien[1]) * p1z; - ////p1y = p1y; - //p1z = -sin(orien[1]) * p1x + cos(orien[1]) * p1z; - - //this->gbCuboid->getPoint1()->setX1(p1x); - //this->gbCuboid->getPoint1()->setX2(p1y); - //this->gbCuboid->getPoint1()->setX3(p1z); - - // - ////Punkt2 - //double p2x = this->gbCuboid->getPoint2()->getX1Coordinate(); - //double p2y = this->gbCuboid->getPoint2()->getX2Coordinate(); - //double p2z = this->gbCuboid->getPoint2()->getX3Coordinate(); - - //p2x = cos(orien[1]) * p2x + sin(orien[1]) * p2z; - ////p1y = p1y; - //p2z = -sin(orien[1]) * p2x + cos(orien[1]) * p2z; - - //this->gbCuboid->getPoint2()->setX1(p2x); - //this->gbCuboid->getPoint2()->setX2(p2y); - //this->gbCuboid->getPoint2()->setX3(p2z); - // - //////////////////////////////////////////////////////////////////////////// - - if (scale[0] != 1.0) this->gbCuboid->scale(scale[0], scale[1], scale[2]); - else this->gbCuboid->translate(pos[0], pos[1], pos[2]); - this->gbCuboid->notifyObserversObjectChanged(); - - //Methode der Basisklasse aufrufen. - vtkPoElement3D::applyActorModifications(); - } -} - -void vtkGbCuboid3D::setValues(void) -{ - double bounds[6]; - bounds[0] = this->gbCuboid->getX1Minimum(); - bounds[1] = this->gbCuboid->getX1Maximum(); - bounds[2] = this->gbCuboid->getX2Minimum(); - bounds[3] = this->gbCuboid->getX2Maximum(); - bounds[4] = this->gbCuboid->getX3Minimum(); - bounds[5] = this->gbCuboid->getX3Maximum(); - this->source->SetBounds(bounds); - -// this->actor->SetVisibility( this->gbCuboid->isActive() ); -} - -bool vtkGbCuboid3D::isPointInObject(double const point[3]) -{ - return this->gbCuboid->isPointInGbObject3D(point[0], point[1], point[2]); -} - -void vtkGbCuboid3D::objectChanged(UbObservable*) -{ - this->setValues(); - this->source->Update(); -} - -void vtkGbCuboid3D::objectWillBeDeleted(UbObservable*) -{ - //TODO: Hier muss auf jeden Fall noch was geschehen.... - this->gbCuboid->removeObserver(this); - delete this; -} diff --git a/src/basics/numerics/geometry3d/presentation/vtkGbCuboid3D.h b/src/basics/numerics/geometry3d/presentation/vtkGbCuboid3D.h deleted file mode 100644 index 4163d44672b9be917f957a9aba2587adea00b639..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/presentation/vtkGbCuboid3D.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef VTKGBCUBOID3D_H -#define VTKGBCUBOID3D_H - -#include "./../../../userinterface/presentation/vtkPoElement3D.h" - -/**** vtk ****/ -class vtkCubeSource; -class vtkPolyDataMapper; - -class GbCuboid3D; - -class vtkGbCuboid3D : public vtkPoElement3D -{ -public: - vtkGbCuboid3D(GbCuboid3D*); - ~vtkGbCuboid3D(void); - void objectChanged(UbObservable*); - void objectWillBeDeleted(UbObservable*); - //void ModifiedEventFired(void); - void applyActorModifications(); - bool isPointInObject(double const point[3]); -protected: - void setValues(); - - GbCuboid3D* gbCuboid; - vtkCubeSource* source; - vtkPolyDataMapper* mapper; -}; -#endif diff --git a/src/basics/numerics/geometry3d/presentation/vtkGbCylinder3D.cpp b/src/basics/numerics/geometry3d/presentation/vtkGbCylinder3D.cpp deleted file mode 100644 index 77390a14658bc66769cb128db680611946842f17..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/presentation/vtkGbCylinder3D.cpp +++ /dev/null @@ -1,103 +0,0 @@ -#include "./vtkGbCylinder3D.h" - -#include "./../GbCylinder3D.h" -#include "./../GbPoint3D.h" -#include "./../../../userinterface/presentation/vtkEventCallbacks.h" - -#include "vtkCylinderSource.h" -#include "vtkPolyDataMapper.h" - - -vtkGbCylinder3D::vtkGbCylinder3D(GbCylinder3D* gbObject) -{ - this->gbCylinder = gbObject; - this->gbCylinder->addObserver(this); - - this->setName("vtkGbCylinder3D"); - - this->source = vtkCylinderSource::New(); - this->mapper = vtkPolyDataMapper::New(); - - this->setValues(); - - this->mapper->SetInput( this->source->GetOutput() ); - this->actor->SetMapper( this->mapper ); - - //this->applyActorModifications(); -} - -vtkGbCylinder3D::~vtkGbCylinder3D(void) -{ - this->gbCylinder->removeObserver(this); - if (this->source) this->source->Delete(); -} - - -void vtkGbCylinder3D::setValues(void) -{ - //this->source->SetCenter( this->gbCylinder->getX1Centroid(), - // this->gbCylinder->getX2Centroid(), - // this->gbCylinder->getX3Centroid()); - //this->source->SetHeight(this->gbCylinder->getLength()); - //this->source->SetRadius( this->gbCylinder->getRadius()); - - /* JZ Attention not ready still some work TODO*/ - this->source->SetHeight(this->gbCylinder->getHeight()); - this->source->SetCenter(this->gbCylinder->getX1Centroid(), - this->gbCylinder->getX2Centroid(), - this->gbCylinder->getX3Centroid()); - this->source->SetRadius( this->gbCylinder->getRadius() ); - this->source->SetResolution(10); -} - -void vtkGbCylinder3D::applyActorModifications() -{ - //this->actor->SetScale(1.0, this->gbCylinder->getLength(), 1.0); - this->source->SetHeight(this->gbCylinder->getHeight()); - this->actor->SetPosition( this->gbCylinder->getPoint1()->x1, - this->gbCylinder->getPoint1()->x2, - this->gbCylinder->getPoint1()->x3); - this->source->SetRadius( this->gbCylinder->getRadius() ); - - - - //if (this->isModified) - //{ - // double pos[3]; - // double scale[3]; - // this->actor->GetPosition(pos); - // this->actor->GetScale(scale); - - // this->actor->SetPosition(0.0,0.0,0.0); - // this->actor->SetOrientation(0.0,0.0,0.0); - // this->actor->SetScale(1.0,1.0,1.0); - - - // if (scale[0] != 1.0) this->gbCylinder->scale(scale[0], scale[1], scale[2]); - // else this->gbCylinder->translate(pos[0], pos[1], pos[2]); - // this->gbCylinder->notifyObserversObjectChanged(); - - // vtkPoElement3D::applyActorModifications(); - //} -} - -bool vtkGbCylinder3D::isPointInObject(double const point[3]) -{ - return this->gbCylinder->isPointInGbObject3D(point[0], point[1], point[2]); -} - -//Wird aufgerufen, wenn sich das zugehörige GBObject3D ändert. -void vtkGbCylinder3D::objectChanged(UbObservable*) -{ - this->setValues(); -// this->applyActorModifications(); - this->source->Modified(); -} - -void vtkGbCylinder3D::objectWillBeDeleted(UbObservable*) -{ - //TODO: Hier muss auf jeden Fall noch was geschehen.... - this->gbCylinder->removeObserver(this); - delete this; -} - diff --git a/src/basics/numerics/geometry3d/presentation/vtkGbCylinder3D.h b/src/basics/numerics/geometry3d/presentation/vtkGbCylinder3D.h deleted file mode 100644 index 19da3417b3e00941385cc2a5bb1132257163735a..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/presentation/vtkGbCylinder3D.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef VTKGBCYLINDER3D_H -#define VTKGBCYLINDER3D_H - -#include "./../../../userinterface/presentation/vtkPoElement3D.h" - -class GbCylinder3D; - -class vtkCylinderSource; -class vtkPolyDataMapper; - - -class vtkGbCylinder3D : public vtkPoElement3D -{ -public: - vtkGbCylinder3D(GbCylinder3D* cylinder); - ~vtkGbCylinder3D(); - void objectChanged(UbObservable*); - void objectWillBeDeleted(UbObservable*); - //void ModifiedEventFired(void); - void applyActorModifications(); - bool isPointInObject(double const point[3]); -protected: - void setValues(); - - GbCylinder3D* gbCylinder; - vtkCylinderSource* source; - vtkPolyDataMapper* mapper; -}; -#endif - diff --git a/src/basics/numerics/geometry3d/presentation/vtkGbSphere3D.cpp b/src/basics/numerics/geometry3d/presentation/vtkGbSphere3D.cpp deleted file mode 100644 index bac51ecc1300d17e6b24527f22189b562298a0dd..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/presentation/vtkGbSphere3D.cpp +++ /dev/null @@ -1,112 +0,0 @@ -#include "./vtkGbSphere3D.h" - -#include "./../GbSphere3D.h" -#include "./../../../userinterface/presentation/vtkEventCallbacks.h" - -#include "vtkSphereSource.h" -#include "vtkPolyDataMapper.h" - - -vtkGbSphere3D::vtkGbSphere3D(GbSphere3D* gbObject):vtkPoElement3D() -{ - this->gbSphere = gbObject; - this->gbSphere->addObserver(this); - - this->setName("vtkGbSphere3D"); - - - this->source = vtkSphereSource::New(); - this->mapper = vtkPolyDataMapper::New(); - - this->setValues(); - - this->mapper->SetInput( this->source->GetOutput() ); - this->actor->SetMapper( this->mapper ); -// this->actor->GetProperty()->SetRepresentationToWireframe(); -} - -vtkGbSphere3D::~vtkGbSphere3D(void) -{ - this->gbSphere->removeObserver(this); - if (this->source) this->source->Delete(); -} - -//void vtkGbSphere3D::ModifiedEventFired() -//{ -// ////double a_orien[3]; -// //double a_pos[3]; -// ////double a_scale[3]; -// //this->actor->GetPosition(a_pos); -// ////this->actor->GetOrientation(a_orien); -// ////this->actor->GetScale(a_scale); -// -// //this->actor->SetPosition(0.0,0.0,0.0); -// //this->actor->SetOrientation(0.0,0.0,0.0); -// //this->actor->SetScale(1.0,1.0,1.0); -// // -// ////cout<<"Orien:"<<a_orien[0]<<","<<a_orien[1]<<","<<a_orien[3]<<endl; -// ////cout<<"Position:"<<a_pos[0]<<","<<a_pos[1]<<","<<a_pos[3]<<endl; -// ////cout<<"Scale:"<<a_scale[0]<<","<<a_scale[1]<<","<<a_scale[3]<<endl; -// -// //this->gbSphere->translate(a_pos[0], a_pos[1], a_pos[2]); -// //this->gbSphere->notifyObserversObjectChanged(); -// PoElement3D::ModifiedEventFired(); -//} - -void vtkGbSphere3D::setValues(void) -{ - this->source->SetCenter( this->gbSphere->getX1Centroid(), - this->gbSphere->getX2Centroid(), - this->gbSphere->getX3Centroid() ); - - this->source->SetRadius( this->gbSphere->getRadius() ); -// this->actor->SetVisibility( this->gbSphere->isActive() ); -} - -void vtkGbSphere3D::applyActorModifications() -{ - if (this->isModified) - { - //double a_orien[3]; - double pos[3]; - double scale[3]; - this->actor->GetPosition(pos); - //this->actor->GetOrientation(a_orien); - this->actor->GetScale(scale); - - this->actor->SetPosition(0.0,0.0,0.0); - this->actor->SetOrientation(0.0,0.0,0.0); - this->actor->SetScale(1.0,1.0,1.0); - - //cout<<"Orien:"<<a_orien[0]<<","<<a_orien[1]<<","<<a_orien[3]<<endl; - //cout<<"Position:"<<a_pos[0]<<","<<a_pos[1]<<","<<a_pos[3]<<endl; - //cout<<"Scale:"<<a_scale[0]<<","<<a_scale[1]<<","<<a_scale[3]<<endl; - - if (scale[0] != 1.0) this->gbSphere->scale(scale[0], scale[1], scale[2]); - else this->gbSphere->translate(pos[0], pos[1], pos[2]); - this->gbSphere->notifyObserversObjectChanged(); - - vtkPoElement3D::applyActorModifications(); - } -} - -bool vtkGbSphere3D::isPointInObject(double const point[3]) -{ - return this->gbSphere->isPointInGbObject3D(point[0], point[1], point[2]); -} - -//Wird aufgerufen, wenn sich das zugehörige GBObject3D ändert. -void vtkGbSphere3D::objectChanged(UbObservable*) -{ - this->setValues(); - this->source->Modified(); - this->actor->Modified(); -} - -void vtkGbSphere3D::objectWillBeDeleted(UbObservable*) -{ - //TODO: Hier muss auf jeden Fall noch was geschehen.... - this->gbSphere->removeObserver(this); - delete this; -} - diff --git a/src/basics/numerics/geometry3d/presentation/vtkGbSphere3D.h b/src/basics/numerics/geometry3d/presentation/vtkGbSphere3D.h deleted file mode 100644 index dd6c1f696d60757ba38d7c6bbc7575cfa3467921..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/presentation/vtkGbSphere3D.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef VTKGBSPHERE3D_H -#define VTKGBSPHERE3D_H - -#include "./../../../userinterface/presentation/vtkPoElement3D.h" -//#include "./../../../../vtkEventListeners.h" - -class GbSphere3D; - -class vtkSphereSource; -class vtkPolyDataMapper; - -class vtkGbSphere3D : public vtkPoElement3D -{ -public: - vtkGbSphere3D(GbSphere3D*); - ~vtkGbSphere3D(void); - void objectChanged(UbObservable*); - void objectWillBeDeleted(UbObservable*); - //void ModifiedEventFired(void); - void applyActorModifications(); - bool isPointInObject(double const point[3]); - - virtual string toString() { return "vtkGbSphere3D"; } - -protected: - void setValues(); - - GbSphere3D* gbSphere; - vtkPolyDataMapper* mapper; - vtkSphereSource* source; -}; -#endif - diff --git a/src/basics/numerics/geometry3d/presentation/vtkGbTriangularMesh3D.cpp b/src/basics/numerics/geometry3d/presentation/vtkGbTriangularMesh3D.cpp deleted file mode 100644 index f772e7c97b4bcb3948b09f9171b89325ebf78a6f..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/presentation/vtkGbTriangularMesh3D.cpp +++ /dev/null @@ -1,167 +0,0 @@ -#include "./vtkGbTriangularMesh3D.h" - -/**** CAB ****/ -#include "./../GbTriangularMesh3D.h" -#include "./../GbTriangle3D.h" -#include "./../../../basics/utilities/UbMath.h" - -/**** vtk ****/ -#include "vtkUnstructuredGrid.h" -#include "vtkDataSetMapper.h" -#include "vtkPoints.h" -#include "vtkTriangle.h" -#include "vtkIdList.h" - -/*** temp ****/ -#include "./../GbPoint3D.h" -#include "vtkMatrix4x4.h" - -//#define PI 3.14159265358979323846 - -vtkGbTriangularMesh3D::vtkGbTriangularMesh3D(GbTriangularMesh3D* mesh) -{ - this->gbTriangularMesh = mesh; - this->gbTriangularMesh->addObserver(this); - - this->setName("vtkGbTriangularMesh3D"); - - this->unstGrid = vtkUnstructuredGrid::New(); - this->buildGrid(); - - - this->dataSetMapper = vtkDataSetMapper::New(); - this->dataSetMapper->SetInput(unstGrid); - - this->actor->SetMapper( this->dataSetMapper ); -} - -vtkGbTriangularMesh3D::~vtkGbTriangularMesh3D(void) -{ - this->gbTriangularMesh->removeObserver(this); - this->unstGrid->Delete(); - this->dataSetMapper->Delete(); -} - -//void vtkGbTriangularMesh3D::ModifiedEventFired() -//{ -// double pos[3]; -// this->actor->GetPosition(pos); -// -// this->actor->SetPosition(0.0,0.0,0.0); -// this->actor->SetOrientation(0.0,0.0,0.0); -// this->actor->SetScale(1.0,1.0,1.0); -// -// double x1 = pos[0]; -// double x2 = pos[1]; -// double x3 = pos[3]; -// -// vector<GbPoint3D*>* pointList = this->gbTriangularMesh->getNodes(); -// for (int pos=0; pos<pointList->size(); pos++) -// { -// (*pointList)[pos]->translate(x1,x2,x3); -// //((*pointList)[pos])->translate(pos[0], pos[1], pos[3]); -// } -// this->gbTriangularMesh->notifyObserversObjectChanged(); -//} - -void vtkGbTriangularMesh3D::applyActorModifications() -{ - if (isModified) - { - double pos[3]; - double orien[3]; - double scale[3]; - this->actor->GetPosition(pos); - this->actor->GetOrientation(orien); - this->actor->GetScale(scale); - - orien[0] = orien[0] / 180 * UbMath::PI; - orien[1] = orien[1] / 180 * UbMath::PI; - orien[2] = orien[2] / 180 * UbMath::PI; - - //cout<<"Orien:"<<orien[0]<<","<<orien[1]<<","<<orien[3]<<endl; - //cout<<"Position:"<<pos[0]<<","<<pos[1]<<","<<pos[3]<<endl; - //cout<<"Scale:"<<scale[0]<<","<<scale[1]<<","<<scale[3]<<endl; - - this->actor->SetPosition(0.0,0.0,0.0); - this->actor->SetOrientation(0.0,0.0,0.0); - this->actor->SetScale(1.0,1.0,1.0); - - vector<GbPoint3D*>* pointList = this->gbTriangularMesh->getNodes(); - for (int index=0; index<(int)pointList->size(); index++) - { - (*pointList)[index]->rotate(orien[0], orien[1], orien[2]); - (*pointList)[index]->scale(scale[0], scale[1], scale[2]); - (*pointList)[index]->translate(pos[0], pos[1], pos[2]); - } - this->gbTriangularMesh->notifyObserversObjectChanged(); - //Methode der Basisklasse aufrufen. - vtkPoElement3D::applyActorModifications(); - } -} - -void vtkGbTriangularMesh3D::buildGrid(void) -{ - this->unstGrid->Reset(); - - vector<GbTriangle3D*>* triangles = this->gbTriangularMesh->getTriangles(); - double xyz[3]; - //this.setContext(new PoContext3D()); - - vtkPoints* points = vtkPoints::New(); - vtkTriangle* triangle = vtkTriangle::New(); - for(int u=0; u<(int)triangles->size(); u++) - { - xyz[0] = (*triangles)[u]->getPoint(0)->getX1Coordinate(); - xyz[1] = (*triangles)[u]->getPoint(0)->getX2Coordinate(); - xyz[2] = (*triangles)[u]->getPoint(0)->getX3Coordinate(); - triangle->GetPointIds()->InsertId(0, points->InsertNextPoint(xyz)); - //points.InsertPoint(u, xyz); // 3D geometry - - xyz[0] = (*triangles)[u]->getPoint(1)->getX1Coordinate(); - xyz[1] = (*triangles)[u]->getPoint(1)->getX2Coordinate(); - xyz[2] = (*triangles)[u]->getPoint(1)->getX3Coordinate(); - triangle->GetPointIds()->InsertId(1, points->InsertNextPoint(xyz)); - //points.InsertPoint(u, xyz); // 3D geometry - - xyz[0] = (*triangles)[u]->getPoint(2)->getX1Coordinate(); - xyz[1] = (*triangles)[u]->getPoint(2)->getX2Coordinate(); - xyz[2] = (*triangles)[u]->getPoint(2)->getX3Coordinate(); - triangle->GetPointIds()->InsertId(2, points->InsertNextPoint(xyz)); - //points.InsertPoint(u, xyz); // 3D geometry - - this->insertNextCell( triangle->GetCellType(), triangle->GetPointIds() ); // grid topology - - } - this->setPoints(points); - //this->source->SetCenter( this->gbSphere->getX1Centroid(), - // this->gbSphere->getX2Centroid(), - // this->gbSphere->getX3Centroid() ); - - //this->source->SetRadius( this->gbSphere->getRadius() ); - //this->actor->SetVisibility( this->gbSphere->isActive() ); - //this->unstGrid->Modified(); -} - -int vtkGbTriangularMesh3D::insertNextCell(int type, vtkIdList* idList) -{ - return this->unstGrid->InsertNextCell(type, idList); -} - -void vtkGbTriangularMesh3D::setPoints(vtkPoints* points) -{ - this->unstGrid->SetPoints(points); -} - -void vtkGbTriangularMesh3D::objectChanged(UbObservable*) -{ - this->buildGrid(); - this->unstGrid->Update(); -} - -void vtkGbTriangularMesh3D::objectWillBeDeleted(UbObservable*) -{ - //TODO: Hier muss auf jeden Fall noch was geschehen.... - this->gbTriangularMesh->removeObserver(this); - delete this; -} diff --git a/src/basics/numerics/geometry3d/presentation/vtkGbTriangularMesh3D.h b/src/basics/numerics/geometry3d/presentation/vtkGbTriangularMesh3D.h deleted file mode 100644 index 968f98846794e0ca2095e85d7b922a1eba13994c..0000000000000000000000000000000000000000 --- a/src/basics/numerics/geometry3d/presentation/vtkGbTriangularMesh3D.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef VTKGBTRIANGULARMESH3D_H -#define VTKGBTRIANGULARMESH3D_H - -#include "./../../../userinterface/presentation/vtkPoElement3D.h" - -class GbTriangularMesh3D; -class vtkUnstructuredGrid; -class vtkDataSetMapper; -class vtkIdList; -class vtkPoints; - -class vtkGbTriangularMesh3D : public vtkPoElement3D -{ -public: - vtkGbTriangularMesh3D(GbTriangularMesh3D* mesh); - ~vtkGbTriangularMesh3D(); - void objectChanged(UbObservable* ); - void objectWillBeDeleted(UbObservable* ); - int insertNextCell(int, vtkIdList*); - void setPoints(vtkPoints*); - //void ModifiedEventFired(void); - void applyActorModifications(); -protected: - void buildGrid(); - - GbTriangularMesh3D* gbTriangularMesh; - vtkUnstructuredGrid* unstGrid; - vtkDataSetMapper* dataSetMapper; -}; -#endif - diff --git a/src/cpu/DemCoupling/CMakePackage.txt b/src/cpu/DemCoupling/CMakePackage.txt deleted file mode 100644 index 1b8416f010d2a7de30b8f70c9abf19a96dd8cf8f..0000000000000000000000000000000000000000 --- a/src/cpu/DemCoupling/CMakePackage.txt +++ /dev/null @@ -1,2 +0,0 @@ -GET_FILENAME_COMPONENT( CURRENT_DIR ${CMAKE_CURRENT_LIST_FILE} PATH) -COLLECT_PACKAGE_DATA_WITH_OPTION(${CURRENT_DIR} ALL_SOURCES) diff --git a/src/cpu/DemCoupling/package.include b/src/cpu/DemCoupling/package.include deleted file mode 100644 index 8b137891791fe96927ad78e64b0aad7bded08bdc..0000000000000000000000000000000000000000 --- a/src/cpu/DemCoupling/package.include +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/cpu/DemCoupling/physicsEngineAdapter/CMakePackage.txt b/src/cpu/DemCoupling/physicsEngineAdapter/CMakePackage.txt deleted file mode 100644 index 1b8416f010d2a7de30b8f70c9abf19a96dd8cf8f..0000000000000000000000000000000000000000 --- a/src/cpu/DemCoupling/physicsEngineAdapter/CMakePackage.txt +++ /dev/null @@ -1,2 +0,0 @@ -GET_FILENAME_COMPONENT( CURRENT_DIR ${CMAKE_CURRENT_LIST_FILE} PATH) -COLLECT_PACKAGE_DATA_WITH_OPTION(${CURRENT_DIR} ALL_SOURCES) diff --git a/src/cpu/DemCoupling/physicsEngineAdapter/dummy/CMakePackage.txt b/src/cpu/DemCoupling/physicsEngineAdapter/dummy/CMakePackage.txt deleted file mode 100644 index 1b8416f010d2a7de30b8f70c9abf19a96dd8cf8f..0000000000000000000000000000000000000000 --- a/src/cpu/DemCoupling/physicsEngineAdapter/dummy/CMakePackage.txt +++ /dev/null @@ -1,2 +0,0 @@ -GET_FILENAME_COMPONENT( CURRENT_DIR ${CMAKE_CURRENT_LIST_FILE} PATH) -COLLECT_PACKAGE_DATA_WITH_OPTION(${CURRENT_DIR} ALL_SOURCES) diff --git a/src/cpu/DemCoupling/physicsEngineAdapter/dummy/package.include b/src/cpu/DemCoupling/physicsEngineAdapter/dummy/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/cpu/DemCoupling/physicsEngineAdapter/package.include b/src/cpu/DemCoupling/physicsEngineAdapter/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/cpu/DemCoupling/physicsEngineAdapter/pe/CMakePackage.txt b/src/cpu/DemCoupling/physicsEngineAdapter/pe/CMakePackage.txt deleted file mode 100644 index 1b8416f010d2a7de30b8f70c9abf19a96dd8cf8f..0000000000000000000000000000000000000000 --- a/src/cpu/DemCoupling/physicsEngineAdapter/pe/CMakePackage.txt +++ /dev/null @@ -1,2 +0,0 @@ -GET_FILENAME_COMPONENT( CURRENT_DIR ${CMAKE_CURRENT_LIST_FILE} PATH) -COLLECT_PACKAGE_DATA_WITH_OPTION(${CURRENT_DIR} ALL_SOURCES) diff --git a/src/cpu/DemCoupling/physicsEngineAdapter/pe/package.include b/src/cpu/DemCoupling/physicsEngineAdapter/pe/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/cpu/DemCoupling/reconstructor/CMakePackage.txt b/src/cpu/DemCoupling/reconstructor/CMakePackage.txt deleted file mode 100644 index 1b8416f010d2a7de30b8f70c9abf19a96dd8cf8f..0000000000000000000000000000000000000000 --- a/src/cpu/DemCoupling/reconstructor/CMakePackage.txt +++ /dev/null @@ -1,2 +0,0 @@ -GET_FILENAME_COMPONENT( CURRENT_DIR ${CMAKE_CURRENT_LIST_FILE} PATH) -COLLECT_PACKAGE_DATA_WITH_OPTION(${CURRENT_DIR} ALL_SOURCES) diff --git a/src/cpu/DemCoupling/reconstructor/package.include b/src/cpu/DemCoupling/reconstructor/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/BCAdapter.h b/src/cpu/VirtualFluidsCore/BoundaryConditions/BCAdapter.h index f91e6ad482d1b4fc81c15b59deaad2f9482cad1d..2a522376595f0b198d1dbd91db0a0064c2f7831b 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/BCAdapter.h +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/BCAdapter.h @@ -11,10 +11,8 @@ #include "BoundaryConditions.h" #include "basics/objects/ObObject.h" -#include "basics/objects/ObObjectCreator.h" #include "basics/utilities/UbFileOutput.h" #include "basics/utilities/UbFileInput.h" -#include "basics/utilities/UbAutoRun.hpp" #include "BCAlgorithm.h" diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/CMakePackage.txt b/src/cpu/VirtualFluidsCore/BoundaryConditions/CMakePackage.txt deleted file mode 100644 index de1dc5a88225180b8e40c6cf46f4a6fbb102778f..0000000000000000000000000000000000000000 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/CMakePackage.txt +++ /dev/null @@ -1,2 +0,0 @@ -GET_FILENAME_COMPONENT( CURRENT_DIR ${CMAKE_CURRENT_LIST_FILE} PATH) -COLLECT_PACKAGE_DATA_WITH_OPTION(${CURRENT_DIR} ALL_SOURCES) \ No newline at end of file diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/DensityBCAdapter.h b/src/cpu/VirtualFluidsCore/BoundaryConditions/DensityBCAdapter.h index 9da55f374a700cb82279e81aa5d3a8eb6a388ef7..64caced01d891d6b41241beec8a6caf0497b8dbc 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/DensityBCAdapter.h +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/DensityBCAdapter.h @@ -37,7 +37,6 @@ public: //------------- implements D3Q27BoundaryConditionAdapter ----- start std::string toString(); - ObObjectCreator* getCreator(); void init(const D3Q27Interactor* const& interactor, const double& time=0); void update(const D3Q27Interactor* const& interactor, const double& time=0); diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/SlipBCAdapter.cpp b/src/cpu/VirtualFluidsCore/BoundaryConditions/SlipBCAdapter.cpp index 9e367fa991036a3a80a05ff7fc2c8e703d171c92..2dbfba24283d2319a2163bb0f5afe9aa1264c93f 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/SlipBCAdapter.cpp +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/SlipBCAdapter.cpp @@ -1,7 +1,7 @@ #include "SlipBCAdapter.h" #include "D3Q27System.h" #include "D3Q27Interactor.h" -#include "numerics/geometry3d/GbCuboid3D.h" +#include "geometry3d/GbCuboid3D.h" //*==========================================================*/ diff --git a/src/cpu/VirtualFluidsCore/BoundaryConditions/SlipBCAdapter.h b/src/cpu/VirtualFluidsCore/BoundaryConditions/SlipBCAdapter.h index f846d405fb044f10493a2144ca10b9b089062a02..462cf564a2995cbdc8fa8b0e0ab96a24ad1c16ea 100644 --- a/src/cpu/VirtualFluidsCore/BoundaryConditions/SlipBCAdapter.h +++ b/src/cpu/VirtualFluidsCore/BoundaryConditions/SlipBCAdapter.h @@ -66,7 +66,6 @@ public: } //------------- implements D3Q27BoundaryConditionAdapter ----- start - ObObjectCreator* getCreator(); void init(const D3Q27Interactor* const& interactor, const double& timestep=0) {} void update(const D3Q27Interactor* const& interactor, const double& timestep=0) {} diff --git a/src/cpu/VirtualFluidsCore/CMakeLists.txt b/src/cpu/VirtualFluidsCore/CMakeLists.txt index 48e357c496102890e952fb958a25d22ef250961b..05e0d946afbfc0fcef1aef23c2270e2e06d2adba 100644 --- a/src/cpu/VirtualFluidsCore/CMakeLists.txt +++ b/src/cpu/VirtualFluidsCore/CMakeLists.txt @@ -1,35 +1,9 @@ -################################################################# -### PACKAGES ### -################################################################# -#SET(WITH_SUBFOLDERS_FOR_SG TRUE) - -#INCLUDE(${SOURCE_ROOT}/ThirdParty/MuParser/CMakePackage.txt) - -#new VirtualFluids -#sINCLUDE(${SOURCE_ROOT}/VirtualFluidsCore/BoundaryConditions/CMakePackage.txt) -#INCLUDE(${SOURCE_ROOT}/VirtualFluidsCore/Connectors/CMakePackage.txt) -#INCLUDE(${SOURCE_ROOT}/VirtualFluidsCore/Data/CMakePackage.txt) -#INCLUDE(${SOURCE_ROOT}/VirtualFluidsCore/Interactors/CMakePackage.txt) -#INCLUDE(${SOURCE_ROOT}/VirtualFluidsCore/LBM/CMakePackage.txt) -#INCLUDE(${SOURCE_ROOT}/VirtualFluidsCore/Parallel/CMakePackage.txt) -#INCLUDE(${SOURCE_ROOT}/VirtualFluidsCore/Grid/CMakePackage.txt) -#INCLUDE(${SOURCE_ROOT}/VirtualFluidsCore/Visitors/CMakePackage.txt) -#INCLUDE(${SOURCE_ROOT}/VirtualFluidsCore/CoProcessors/CMakePackage.txt) -#INCLUDE(${SOURCE_ROOT}/VirtualFluidsCore/Utilities/CMakePackage.txt) - -#old VirtualFluids -#INCLUDE(${SOURCE_ROOT}/VirtualFluidsBasic/VirtualFluidsBasic.cmake) - -#FETOL -IF(${USE_FETOL}) -INCLUDE(${SOURCE_DIR}/VirtualFluidsCore/FETOL/CMakePackage.txt) -ENDIF() -INCLUDE(${CMAKE_CURRENT_LIST_DIR}/IncludsList.cmake) -#SET(CAB_ADDITIONAL_LINK_LIBRARIES muParserLib ${Boost_LIBRARIES} ${MPI_LIBRARY}) -SET(CAB_ADDITIONAL_LINK_LIBRARIES ${MPI_LIBRARY}) +IF(${USE_FETOL}) + # INCLUDE(${SOURCE_DIR}/VirtualFluidsCore/FETOL/CMakePackage.txt) TODO: Did not exists? +ENDIF() IF(${USE_GCC}) SET(CAB_ADDITIONAL_LINK_LIBRARIES ${CAB_ADDITIONAL_LINK_LIBRARIES} rt) @@ -85,26 +59,20 @@ IF(${USE_FETOL}) ENDIF() IF(${USE_DEM_COUPLING}) - INCLUDE(${SOURCE_ROOT}/DemCoupling/DemCoupling.cmake) + INCLUDE(${CMAKE_CURRENT_LIST_DIR}/../DemCoupling/DemCoupling.cmake) ENDIF() -#message("CAB_ADDITIONAL_LINK_LIBRARIES: " ${CAB_ADDITIONAL_LINK_LIBRARIES}) -################################################################# -### CREATE PROJECT ### -################################################################# -#CREATE_CAB_PROJECT(VirtualFluids STATIC) -#include (${CMAKE_SOURCE_DIR}/CMake/VirtualFluidsMacros.cmake) +INCLUDE(${CMAKE_CURRENT_LIST_DIR}/IncludsList.cmake) -vf_add_library(BUILDTYPE static DEPENDS basics MuParser ${CAB_ADDITIONAL_LINK_LIBRARIES}) +vf_add_library(BUILDTYPE static DEPENDS basics MuParser ${MPI_LIBRARY} ${CAB_ADDITIONAL_LINK_LIBRARIES}) vf_get_library_name(library_name) -target_include_directories(${library_name} PRIVATE ${CMAKE_SOURCE_DIR}/src/basics) -target_include_directories(${library_name} PRIVATE ${CMAKE_SOURCE_DIR}/src/basics/numerics/geometry3d) -target_include_directories(${library_name} PRIVATE ${CMAKE_SOURCE_DIR}/src/basics/numerics/geometry3d/Creator) -target_include_directories(${library_name} PRIVATE ${CMAKE_SOURCE_DIR}/src/basics/numerics/geometry3d/KdTree) -target_include_directories(${library_name} PRIVATE ${CMAKE_SOURCE_DIR}/src/basics/basics/container) -target_include_directories(${library_name} PRIVATE ${CMAKE_SOURCE_DIR}/src/basics/basics/memory) -target_include_directories(${library_name} PRIVATE ${CMAKE_SOURCE_DIR}/src/basics/basics/objects) -target_include_directories(${library_name} PRIVATE ${CMAKE_SOURCE_DIR}/src/basics/basics/transmitter) -target_include_directories(${library_name} PRIVATE ${CMAKE_SOURCE_DIR}/src/basics/basics/utilities) -target_include_directories(${library_name} PRIVATE ${CMAKE_SOURCE_DIR}/src/basics/basics/writer) +target_include_directories(${library_name} PRIVATE ${VF_SRC_DIR}/basics) +target_include_directories(${library_name} PRIVATE ${VF_SRC_DIR}/basics/geometry3d) +target_include_directories(${library_name} PRIVATE ${VF_SRC_DIR}/basics/geometry3d/KdTree) +target_include_directories(${library_name} PRIVATE ${VF_SRC_DIR}/basics/basics/container) +target_include_directories(${library_name} PRIVATE ${VF_SRC_DIR}/basics/basics/memory) +target_include_directories(${library_name} PRIVATE ${VF_SRC_DIR}/basics/basics/objects) +target_include_directories(${library_name} PRIVATE ${VF_SRC_DIR}/basics/basics/transmitter) +target_include_directories(${library_name} PRIVATE ${VF_SRC_DIR}/basics/basics/utilities) +target_include_directories(${library_name} PRIVATE ${VF_SRC_DIR}/basics/basics/writer) diff --git a/src/cpu/VirtualFluidsCore/CoProcessors/CMakePackage.txt b/src/cpu/VirtualFluidsCore/CoProcessors/CMakePackage.txt deleted file mode 100644 index 9354d3d0084922c7abd6f1b22823c5c47e0befb4..0000000000000000000000000000000000000000 --- a/src/cpu/VirtualFluidsCore/CoProcessors/CMakePackage.txt +++ /dev/null @@ -1,2 +0,0 @@ -GET_FILENAME_COMPONENT( CURRENT_DIR ${CMAKE_CURRENT_LIST_FILE} PATH) -COLLECT_PACKAGE_DATA_WITH_OPTION(${CURRENT_DIR} ALL_SOURCES) diff --git a/src/cpu/VirtualFluidsCore/CoProcessors/IntegrateValuesHelper.cpp b/src/cpu/VirtualFluidsCore/CoProcessors/IntegrateValuesHelper.cpp index ac67dea0d70cc49205d415efb7193c3b8844cf67..793013dc327e63e7aaf1f4bc117bde6801fbe598 100644 --- a/src/cpu/VirtualFluidsCore/CoProcessors/IntegrateValuesHelper.cpp +++ b/src/cpu/VirtualFluidsCore/CoProcessors/IntegrateValuesHelper.cpp @@ -1,8 +1,8 @@ #include "IntegrateValuesHelper.h" -#include <numerics/geometry3d/GbCuboid3D.h> -#include <numerics/geometry3d/CoordinateTransformation3D.h> +#include <geometry3d/GbCuboid3D.h> +#include <geometry3d/CoordinateTransformation3D.h> #include <vector> #include "LBMKernel.h" diff --git a/src/cpu/VirtualFluidsCore/Connectors/CMakePackage.txt b/src/cpu/VirtualFluidsCore/Connectors/CMakePackage.txt deleted file mode 100644 index de1dc5a88225180b8e40c6cf46f4a6fbb102778f..0000000000000000000000000000000000000000 --- a/src/cpu/VirtualFluidsCore/Connectors/CMakePackage.txt +++ /dev/null @@ -1,2 +0,0 @@ -GET_FILENAME_COMPONENT( CURRENT_DIR ${CMAKE_CURRENT_LIST_FILE} PATH) -COLLECT_PACKAGE_DATA_WITH_OPTION(${CURRENT_DIR} ALL_SOURCES) \ No newline at end of file diff --git a/src/cpu/VirtualFluidsCore/Data/CMakePackage.txt b/src/cpu/VirtualFluidsCore/Data/CMakePackage.txt deleted file mode 100644 index 9354d3d0084922c7abd6f1b22823c5c47e0befb4..0000000000000000000000000000000000000000 --- a/src/cpu/VirtualFluidsCore/Data/CMakePackage.txt +++ /dev/null @@ -1,2 +0,0 @@ -GET_FILENAME_COMPONENT( CURRENT_DIR ${CMAKE_CURRENT_LIST_FILE} PATH) -COLLECT_PACKAGE_DATA_WITH_OPTION(${CURRENT_DIR} ALL_SOURCES) diff --git a/src/cpu/VirtualFluidsCore/Grid/CMakePackage.txt b/src/cpu/VirtualFluidsCore/Grid/CMakePackage.txt deleted file mode 100644 index 9354d3d0084922c7abd6f1b22823c5c47e0befb4..0000000000000000000000000000000000000000 --- a/src/cpu/VirtualFluidsCore/Grid/CMakePackage.txt +++ /dev/null @@ -1,2 +0,0 @@ -GET_FILENAME_COMPONENT( CURRENT_DIR ${CMAKE_CURRENT_LIST_FILE} PATH) -COLLECT_PACKAGE_DATA_WITH_OPTION(${CURRENT_DIR} ALL_SOURCES) diff --git a/src/cpu/VirtualFluidsCore/Grid/Grid3D.cpp b/src/cpu/VirtualFluidsCore/Grid/Grid3D.cpp index 2cbf52fa51d5f52b90391bc24726d3d8853a7a71..d83e22be30296621fec256c5124f3412ff97d9c8 100644 --- a/src/cpu/VirtualFluidsCore/Grid/Grid3D.cpp +++ b/src/cpu/VirtualFluidsCore/Grid/Grid3D.cpp @@ -2,7 +2,7 @@ #include <set> -#include <numerics/geometry3d/CoordinateTransformation3D.h> +#include <geometry3d/CoordinateTransformation3D.h> #include <basics/writer/WbWriterVtkXmlASCII.h> #include "Grid3DVisitor.h" diff --git a/src/cpu/VirtualFluidsCore/IncludsList.cmake b/src/cpu/VirtualFluidsCore/IncludsList.cmake index 878893a4faa558a0f49788e8c8262ff405f98330..b2a5a2f223c2b7a015cc36855d8455ef3a64f192 100644 --- a/src/cpu/VirtualFluidsCore/IncludsList.cmake +++ b/src/cpu/VirtualFluidsCore/IncludsList.cmake @@ -1,20 +1,18 @@ -#directory pathes for header files +set(VirtualFluidsCore_source_dir ${VF_SRC_DIR}/cpu/VirtualFluidsCore) +vf_get_library_name(library_name) -set (SOURCE_DIR "${CMAKE_SOURCE_DIR}/src/cpu/") +INCLUDE_DIRECTORIES(${VirtualFluidsCore_source_dir}/BoundaryConditions) +INCLUDE_DIRECTORIES(${VirtualFluidsCore_source_dir}/Connectors) +INCLUDE_DIRECTORIES(${VirtualFluidsCore_source_dir}/Data) +INCLUDE_DIRECTORIES(${VirtualFluidsCore_source_dir}/Interactors) +INCLUDE_DIRECTORIES(${VirtualFluidsCore_source_dir}/LBM) +INCLUDE_DIRECTORIES(${VirtualFluidsCore_source_dir}/Parallel) +INCLUDE_DIRECTORIES(${VirtualFluidsCore_source_dir}/Grid) +INCLUDE_DIRECTORIES(${VirtualFluidsCore_source_dir}/Visitors) +INCLUDE_DIRECTORIES(${VirtualFluidsCore_source_dir}/CoProcessors) +INCLUDE_DIRECTORIES(${VirtualFluidsCore_source_dir}/Utilities) -INCLUDE_DIRECTORIES(${SOURCE_DIR}/VirtualFluidsCore) -INCLUDE_DIRECTORIES(${SOURCE_DIR}/VirtualFluidsCore/BoundaryConditions) -INCLUDE_DIRECTORIES(${SOURCE_DIR}/VirtualFluidsCore/Connectors) -INCLUDE_DIRECTORIES(${SOURCE_DIR}/VirtualFluidsCore/Data) -INCLUDE_DIRECTORIES(${SOURCE_DIR}/VirtualFluidsCore/Interactors) -INCLUDE_DIRECTORIES(${SOURCE_DIR}/VirtualFluidsCore/LBM) -INCLUDE_DIRECTORIES(${SOURCE_DIR}/VirtualFluidsCore/Parallel) -INCLUDE_DIRECTORIES(${SOURCE_DIR}/VirtualFluidsCore/Grid) -INCLUDE_DIRECTORIES(${SOURCE_DIR}/VirtualFluidsCore/Visitors) -INCLUDE_DIRECTORIES(${SOURCE_DIR}/VirtualFluidsCore/CoProcessors) -INCLUDE_DIRECTORIES(${SOURCE_DIR}/VirtualFluidsCore/Utilities) - -INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/3rdParty) +INCLUDE_DIRECTORIES(${VF_THIRD_DIR}) IF(${USE_BOOST}) INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR}) @@ -27,7 +25,7 @@ IF(${USE_VTK}) INCLUDE_DIRECTORIES(${VTK_INCLUDE_DIRS}) ENDIF() IF(${USE_FETOL}) - INCLUDE_DIRECTORIES(${SOURCE_DIR}/VirtualFluidsCore/FETOL) + # INCLUDE_DIRECTORIES(${SOURCE_DIR}/VirtualFluidsCore/FETOL) TODO: Did not exists? INCLUDE_DIRECTORIES(${YAML_INCLUDEDIR}) INCLUDE_DIRECTORIES(${BOND_INCLUDEDIR}) INCLUDE_DIRECTORIES(${FETOL_INCLUDEDIR}) diff --git a/src/cpu/VirtualFluidsCore/Interactors/CMakePackage.txt b/src/cpu/VirtualFluidsCore/Interactors/CMakePackage.txt deleted file mode 100644 index 9354d3d0084922c7abd6f1b22823c5c47e0befb4..0000000000000000000000000000000000000000 --- a/src/cpu/VirtualFluidsCore/Interactors/CMakePackage.txt +++ /dev/null @@ -1,2 +0,0 @@ -GET_FILENAME_COMPONENT( CURRENT_DIR ${CMAKE_CURRENT_LIST_FILE} PATH) -COLLECT_PACKAGE_DATA_WITH_OPTION(${CURRENT_DIR} ALL_SOURCES) diff --git a/src/cpu/VirtualFluidsCore/Interactors/D3Q27Interactor.cpp b/src/cpu/VirtualFluidsCore/Interactors/D3Q27Interactor.cpp index 820324c726cd964cb7464e45a3f11931ad46f0fe..437524cf5d4f11f730e52f384925e6d7c422d16f 100644 --- a/src/cpu/VirtualFluidsCore/Interactors/D3Q27Interactor.cpp +++ b/src/cpu/VirtualFluidsCore/Interactors/D3Q27Interactor.cpp @@ -4,8 +4,8 @@ #include <basics/writer/WbWriterVtkXmlBinary.h> -#include <numerics/geometry3d/GbCuboid3D.h> -#include <numerics/geometry3d/GbLine3D.h> +#include <geometry3d/GbCuboid3D.h> +#include <geometry3d/GbLine3D.h> #include "Block3D.h" #include "Grid3D.h" #include "BCArray3D.h" diff --git a/src/cpu/VirtualFluidsCore/Interactors/D3Q27Interactor.h b/src/cpu/VirtualFluidsCore/Interactors/D3Q27Interactor.h index 796490116a48a9dba5184ab54fb8aece40227d54..8262dd1df886a4c18ab8dddff7b0af25dde3bf92 100644 --- a/src/cpu/VirtualFluidsCore/Interactors/D3Q27Interactor.h +++ b/src/cpu/VirtualFluidsCore/Interactors/D3Q27Interactor.h @@ -55,8 +55,6 @@ public: bool setDifferencesToGbObject3D(const SPtr<Block3D> block/*, const double& x1, const double& x2, const double& x3, const double& blockLengthX1, const double& blockLengthX2, const double& blockLengthX3, const double& timestep=0*/); ObObject* clone() { throw UbException(UB_EXARGS,"not implemented"); } - ObObjectCreator* getCreator(); - void writeValidationAVSFile(std::string filename); virtual std::vector< std::pair<GbPoint3D,GbPoint3D> > getQsLineSet(); diff --git a/src/cpu/VirtualFluidsCore/Interactors/D3Q27TriFaceMeshInteractor.cpp b/src/cpu/VirtualFluidsCore/Interactors/D3Q27TriFaceMeshInteractor.cpp index 3ec38f463e00d1b2f622744e03d723f64e26c0c4..89ddd366e9833908bc906c1d99037ee8f598a3d4 100644 --- a/src/cpu/VirtualFluidsCore/Interactors/D3Q27TriFaceMeshInteractor.cpp +++ b/src/cpu/VirtualFluidsCore/Interactors/D3Q27TriFaceMeshInteractor.cpp @@ -1,17 +1,16 @@ #include "D3Q27TriFaceMeshInteractor.h" #include <basics/utilities/UbMath.h> #include <basics/utilities/UbLogger.h> -#include <basics/utilities/UbStaticPathMap.h> #include <basics/writer/WbWriterVtkBinary.h> #include <basics/writer/WbWriterVtkXmlBinary.h> #include <basics/writer/WbWriterVtkASCII.h> #include "basics/writer/WbWriterVtkXmlASCII.h" -#include <numerics/geometry3d/GbSystem3D.h> -#include <numerics/geometry3d/GbCuboid3D.h> -#include <numerics/geometry3d/GbHalfSpace3D.h> -#include <numerics/geometry3d/GbMeshTools3D.h> +#include <geometry3d/GbSystem3D.h> +#include <geometry3d/GbCuboid3D.h> +#include <geometry3d/GbHalfSpace3D.h> +#include <geometry3d/GbMeshTools3D.h> #include "Block3D.h" #include "Grid3D.h" #include "BCArray3D.h" @@ -21,7 +20,7 @@ #include "BCProcessor.h" #include "basics/utilities/UbTiming.h" -#include <numerics/geometry3d/GbTriFaceMesh3D.h> +#include <geometry3d/GbTriFaceMesh3D.h> //#include <omp.h> diff --git a/src/cpu/VirtualFluidsCore/Interactors/D3Q27TriFaceMeshInteractor.h b/src/cpu/VirtualFluidsCore/Interactors/D3Q27TriFaceMeshInteractor.h index 3e2428d0cff8428853cd6d8e94c66d50154b5b32..c462b34cef388acc3eab1887791d6c26837cfac4 100644 --- a/src/cpu/VirtualFluidsCore/Interactors/D3Q27TriFaceMeshInteractor.h +++ b/src/cpu/VirtualFluidsCore/Interactors/D3Q27TriFaceMeshInteractor.h @@ -44,7 +44,6 @@ public: void setRegardPointInObjectTest( bool opt ) { this->regardPIOTest = opt; } ObObject* clone() { throw UbException(UB_EXARGS,"not implemented"); } - ObObjectCreator* getCreator(); UbTupleDouble3 getForces(); UbTupleDouble3 getForcesTriangle(); diff --git a/src/cpu/VirtualFluidsCore/Interactors/Interactor3D.cpp b/src/cpu/VirtualFluidsCore/Interactors/Interactor3D.cpp index 17adeb82a6c894804a3e3acc3b9cd861203bad59..1b39e29a4836f6d22afd90310980b62c3a3bd041 100644 --- a/src/cpu/VirtualFluidsCore/Interactors/Interactor3D.cpp +++ b/src/cpu/VirtualFluidsCore/Interactors/Interactor3D.cpp @@ -3,7 +3,7 @@ #include <fstream> -#include <numerics/geometry3d/GbCuboid3D.h> +#include <geometry3d/GbCuboid3D.h> #include <basics/utilities/UbMath.h> #include <basics/utilities/UbFileOutput.h> #include "UbException.h" diff --git a/src/cpu/VirtualFluidsCore/Interactors/package.include b/src/cpu/VirtualFluidsCore/Interactors/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/cpu/VirtualFluidsCore/LBM/CMakePackage.txt b/src/cpu/VirtualFluidsCore/LBM/CMakePackage.txt deleted file mode 100644 index 9354d3d0084922c7abd6f1b22823c5c47e0befb4..0000000000000000000000000000000000000000 --- a/src/cpu/VirtualFluidsCore/LBM/CMakePackage.txt +++ /dev/null @@ -1,2 +0,0 @@ -GET_FILENAME_COMPONENT( CURRENT_DIR ${CMAKE_CURRENT_LIST_FILE} PATH) -COLLECT_PACKAGE_DATA_WITH_OPTION(${CURRENT_DIR} ALL_SOURCES) diff --git a/src/cpu/VirtualFluidsCore/Parallel/CMakePackage.txt b/src/cpu/VirtualFluidsCore/Parallel/CMakePackage.txt deleted file mode 100644 index 9354d3d0084922c7abd6f1b22823c5c47e0befb4..0000000000000000000000000000000000000000 --- a/src/cpu/VirtualFluidsCore/Parallel/CMakePackage.txt +++ /dev/null @@ -1,2 +0,0 @@ -GET_FILENAME_COMPONENT( CURRENT_DIR ${CMAKE_CURRENT_LIST_FILE} PATH) -COLLECT_PACKAGE_DATA_WITH_OPTION(${CURRENT_DIR} ALL_SOURCES) diff --git a/src/cpu/VirtualFluidsCore/PointerDefinitions.h b/src/cpu/VirtualFluidsCore/PointerDefinitions.h deleted file mode 100644 index 8ecd34ae1c8749d28b75560cc6b9af1ed262f6b1..0000000000000000000000000000000000000000 --- a/src/cpu/VirtualFluidsCore/PointerDefinitions.h +++ /dev/null @@ -1,53 +0,0 @@ -/* -* Author: S. Peters -* mail: peters@irmb.tu-bs.de -*/ -#ifndef SHARED_POINTER_H -#define SHARED_POINTER_H - -#define useStdSmartPointer - -#ifdef useStdSmartPointer - #include <memory> - #define smartPointerNamespace std -#endif - - -template <class T> -using SPtr = smartPointerNamespace::shared_ptr<T>; - -template <class T> -using WPtr = smartPointerNamespace::weak_ptr<T>; - -//template <class T> -//using UPtr = smartPointerNamespace::unique_ptr<T>; - -template <class T> -using enableSharedFromThis = smartPointerNamespace::enable_shared_from_this<T>; - -#define dynamicPointerCast smartPointerNamespace::dynamic_pointer_cast - -template <class T> -using RPtr = T*; - -#endif - -//#ifndef VF_BOOST -// #include <memory> -// #define smartPointerNamespace std -//#else -// #include <boost/enable_shared_from_this.hpp> -// #include <boost/pointer_cast.hpp> -// #include <boost/shared_ptr.hpp> -// #define smartPointerNamespace boost -//#endif -// -//#define SPtr smartPointerNamespace::shared_ptr -// -//#define WPtr smartPointerNamespace::weak_ptr -// -//#define enableSharedFromThis smartPointerNamespace::enable_shared_from_this -// -//#define dynamicPointerCast smartPointerNamespace::dynamic_pointer_cast - -//#endif \ No newline at end of file diff --git a/src/cpu/VirtualFluidsCore/Utilities/CMakePackage.txt b/src/cpu/VirtualFluidsCore/Utilities/CMakePackage.txt deleted file mode 100644 index 9354d3d0084922c7abd6f1b22823c5c47e0befb4..0000000000000000000000000000000000000000 --- a/src/cpu/VirtualFluidsCore/Utilities/CMakePackage.txt +++ /dev/null @@ -1,2 +0,0 @@ -GET_FILENAME_COMPONENT( CURRENT_DIR ${CMAKE_CURRENT_LIST_FILE} PATH) -COLLECT_PACKAGE_DATA_WITH_OPTION(${CURRENT_DIR} ALL_SOURCES) diff --git a/src/cpu/VirtualFluidsCore/Visitors/CMakePackage.txt b/src/cpu/VirtualFluidsCore/Visitors/CMakePackage.txt deleted file mode 100644 index 9354d3d0084922c7abd6f1b22823c5c47e0befb4..0000000000000000000000000000000000000000 --- a/src/cpu/VirtualFluidsCore/Visitors/CMakePackage.txt +++ /dev/null @@ -1,2 +0,0 @@ -GET_FILENAME_COMPONENT( CURRENT_DIR ${CMAKE_CURRENT_LIST_FILE} PATH) -COLLECT_PACKAGE_DATA_WITH_OPTION(${CURRENT_DIR} ALL_SOURCES) diff --git a/src/cpu/VirtualFluidsCore/Visitors/CoarsenCrossAndInsideGbObjectBlockVisitor.cpp b/src/cpu/VirtualFluidsCore/Visitors/CoarsenCrossAndInsideGbObjectBlockVisitor.cpp index 4c76abb3e62ecfefccfc9102864b369dccbfdc6c..d4185ceff9f51fb33299f1c7a7eff927fe997d9f 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/CoarsenCrossAndInsideGbObjectBlockVisitor.cpp +++ b/src/cpu/VirtualFluidsCore/Visitors/CoarsenCrossAndInsideGbObjectBlockVisitor.cpp @@ -1,7 +1,7 @@ #include "CoarsenCrossAndInsideGbObjectBlockVisitor.h" #include "Block3D.h" #include "Grid3D.h" -#include <numerics/geometry3d/GbObject3D.h> +#include <geometry3d/GbObject3D.h> CoarsenCrossAndInsideGbObjectBlockVisitor::CoarsenCrossAndInsideGbObjectBlockVisitor() : Block3DVisitor(), notActive(true) diff --git a/src/cpu/VirtualFluidsCore/Visitors/GenBlocksGridVisitor.cpp b/src/cpu/VirtualFluidsCore/Visitors/GenBlocksGridVisitor.cpp index 1d3f09c944ad233f411a1848bf28c92ce10a486b..020a9f493c144f4c0e57c630be657ce3431b627d 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/GenBlocksGridVisitor.cpp +++ b/src/cpu/VirtualFluidsCore/Visitors/GenBlocksGridVisitor.cpp @@ -4,7 +4,7 @@ #include "Block3D.h" #include "Grid3D.h" -#include <numerics/geometry3d/GbObject3D.h> +#include <geometry3d/GbObject3D.h> GenBlocksGridVisitor::GenBlocksGridVisitor(SPtr<GbObject3D> boundingBox) : boundingBox(boundingBox) diff --git a/src/cpu/VirtualFluidsCore/Visitors/RefineCrossAndInsideGbObjectBlockVisitor.cpp b/src/cpu/VirtualFluidsCore/Visitors/RefineCrossAndInsideGbObjectBlockVisitor.cpp index 64c7617d9cc0fb0e6d4637f73e94aef9cbad8ba9..ef6052170479d50813e5d5f059e2badf343dc6c2 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/RefineCrossAndInsideGbObjectBlockVisitor.cpp +++ b/src/cpu/VirtualFluidsCore/Visitors/RefineCrossAndInsideGbObjectBlockVisitor.cpp @@ -1,6 +1,6 @@ #include "RefineCrossAndInsideGbObjectBlockVisitor.h" -#include <numerics/geometry3d/GbObject3D.h> +#include <geometry3d/GbObject3D.h> #include "Grid3D.h" #include "Block3D.h" diff --git a/src/cpu/VirtualFluidsCore/Visitors/RefineInterGbObjectsVisitor.cpp b/src/cpu/VirtualFluidsCore/Visitors/RefineInterGbObjectsVisitor.cpp index 862ef47880e1d3cb19cc37af172adecaa2de736f..eb24f08d37bdce1e997dcf23ad3a5ae4401712bb 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/RefineInterGbObjectsVisitor.cpp +++ b/src/cpu/VirtualFluidsCore/Visitors/RefineInterGbObjectsVisitor.cpp @@ -1,6 +1,6 @@ #include "RefineInterGbObjectsVisitor.h" -#include <numerics/geometry3d/GbObject3D.h> +#include <geometry3d/GbObject3D.h> #include "Grid3D.h" #include "Block3D.h" diff --git a/src/cpu/VirtualFluidsCore/Visitors/SpongeLayerBlockVisitor.cpp b/src/cpu/VirtualFluidsCore/Visitors/SpongeLayerBlockVisitor.cpp index 4bbea1fd8c03d6f7f6dbc59589c09769ea22c45f..55edc6e1c2975a65c695b0edf12c5f8676916c0c 100644 --- a/src/cpu/VirtualFluidsCore/Visitors/SpongeLayerBlockVisitor.cpp +++ b/src/cpu/VirtualFluidsCore/Visitors/SpongeLayerBlockVisitor.cpp @@ -9,7 +9,7 @@ #include "D3Q27System.h" #include "BCArray3D.h" #include "BCProcessor.h" -#include <numerics/geometry3d/GbCuboid3D.h> +#include <geometry3d/GbCuboid3D.h> using namespace std; diff --git a/src/gpu/GksGpu/Analyzer/ConvergenceAnalyzer.h b/src/gpu/GksGpu/Analyzer/ConvergenceAnalyzer.h index c217227a33a9936003c347bdad73fa053c69b1fd..46e0315c21373dcad1b698b7121f63c3c0efd429 100644 --- a/src/gpu/GksGpu/Analyzer/ConvergenceAnalyzer.h +++ b/src/gpu/GksGpu/Analyzer/ConvergenceAnalyzer.h @@ -5,7 +5,7 @@ #include "VirtualFluidsDefinitions.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "Core/Timer/Timer.h" diff --git a/src/gpu/GksGpu/Analyzer/CupsAnalyzer.h b/src/gpu/GksGpu/Analyzer/CupsAnalyzer.h index 5438679c887d0f6f50c9cfed7b2cfd08ced93741..ffb03aed509570cf651469097804ad1ff997973d 100644 --- a/src/gpu/GksGpu/Analyzer/CupsAnalyzer.h +++ b/src/gpu/GksGpu/Analyzer/CupsAnalyzer.h @@ -5,7 +5,7 @@ #include "VirtualFluidsDefinitions.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "Core/Timer/Timer.h" diff --git a/src/gpu/GksGpu/Analyzer/EnstrophyAnalyzer.h b/src/gpu/GksGpu/Analyzer/EnstrophyAnalyzer.h index 16ffbeee7873f8e3f4d3d50f46926050d05db261..e8d3723d466c7c5acdfe6df5cd64aee78dc1e10b 100644 --- a/src/gpu/GksGpu/Analyzer/EnstrophyAnalyzer.h +++ b/src/gpu/GksGpu/Analyzer/EnstrophyAnalyzer.h @@ -6,7 +6,7 @@ #include "VirtualFluidsDefinitions.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "Parameters/Parameters.h" diff --git a/src/gpu/GksGpu/Analyzer/HeatFluxAnalyzer.h b/src/gpu/GksGpu/Analyzer/HeatFluxAnalyzer.h index 5e990ed6760c729e1032f34425e868bdd2cce77a..bf75028adfd7e8624e7fda9bf56b9796b56bc3e0 100644 --- a/src/gpu/GksGpu/Analyzer/HeatFluxAnalyzer.h +++ b/src/gpu/GksGpu/Analyzer/HeatFluxAnalyzer.h @@ -6,7 +6,7 @@ #include "VirtualFluidsDefinitions.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "GksGpu/BoundaryConditions/BoundaryCondition.h" diff --git a/src/gpu/GksGpu/Analyzer/KineticEnergyAnalyzer.h b/src/gpu/GksGpu/Analyzer/KineticEnergyAnalyzer.h index eb266ea5a00b7f9d9832da99990f134ce3925046..f5b0adcb44741f04b7c13e0e27ea7013c21c59e1 100644 --- a/src/gpu/GksGpu/Analyzer/KineticEnergyAnalyzer.h +++ b/src/gpu/GksGpu/Analyzer/KineticEnergyAnalyzer.h @@ -6,7 +6,7 @@ #include "VirtualFluidsDefinitions.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "FlowStateData/FlowStateData.cuh" diff --git a/src/gpu/GksGpu/Analyzer/PointTimeSeriesAnalyzer.h b/src/gpu/GksGpu/Analyzer/PointTimeSeriesAnalyzer.h index 9fbeeeca3fce4287ffe3821d01f40f18c872048b..8a5bb57bc1a88e5a993ed1ebc6e00c6daa35b58a 100644 --- a/src/gpu/GksGpu/Analyzer/PointTimeSeriesAnalyzer.h +++ b/src/gpu/GksGpu/Analyzer/PointTimeSeriesAnalyzer.h @@ -7,7 +7,7 @@ #include "VirtualFluidsDefinitions.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "Core/VectorTypes.h" diff --git a/src/gpu/GksGpu/Analyzer/PointTimeSeriesCollector.h b/src/gpu/GksGpu/Analyzer/PointTimeSeriesCollector.h index 022bd46c471436e5028c84023138f46eee9eb082..b591497be35b6a5f309a69113c1d8d3b43753a04 100644 --- a/src/gpu/GksGpu/Analyzer/PointTimeSeriesCollector.h +++ b/src/gpu/GksGpu/Analyzer/PointTimeSeriesCollector.h @@ -8,7 +8,7 @@ #include "VirtualFluidsDefinitions.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "Core/VectorTypes.h" diff --git a/src/gpu/GksGpu/Analyzer/TurbulenceAnalyzer.h b/src/gpu/GksGpu/Analyzer/TurbulenceAnalyzer.h index 553183f7bfc1908e26eddb466cad44ad77bd15e7..0f867fa34e55742cf939fb83fd104e8c800344c9 100644 --- a/src/gpu/GksGpu/Analyzer/TurbulenceAnalyzer.h +++ b/src/gpu/GksGpu/Analyzer/TurbulenceAnalyzer.h @@ -7,7 +7,7 @@ #include "VirtualFluidsDefinitions.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "FlowStateData/FlowStateData.cuh" diff --git a/src/gpu/GksGpu/Analyzer/package.include b/src/gpu/GksGpu/Analyzer/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/GksGpu/BoundaryConditions/AdiabaticWall.cu b/src/gpu/GksGpu/BoundaryConditions/AdiabaticWall.cu index 47786d2147963b3501b2d42a350f03938425ad05..a5b6a8812283528975461f50fc0d10ee5a0aeb6b 100644 --- a/src/gpu/GksGpu/BoundaryConditions/AdiabaticWall.cu +++ b/src/gpu/GksGpu/BoundaryConditions/AdiabaticWall.cu @@ -7,7 +7,7 @@ #include <cuda_runtime.h> #include <helper_cuda.h> -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/RealConstants.h" #include "DataBase/DataBase.h" diff --git a/src/gpu/GksGpu/BoundaryConditions/AdiabaticWall.h b/src/gpu/GksGpu/BoundaryConditions/AdiabaticWall.h index a171cc9f4c3d03c6de62faa85d25d3c9f625be46..e040828431d08e7973ebb3e8350bed93e2d43293 100644 --- a/src/gpu/GksGpu/BoundaryConditions/AdiabaticWall.h +++ b/src/gpu/GksGpu/BoundaryConditions/AdiabaticWall.h @@ -5,7 +5,7 @@ #include "VirtualFluidsDefinitions.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "Core/VectorTypes.h" diff --git a/src/gpu/GksGpu/BoundaryConditions/BoundaryCondition.h b/src/gpu/GksGpu/BoundaryConditions/BoundaryCondition.h index 15c36c0ffe63df5082ef01ec77bf554b8387f6c6..f4675a72c69f6d82bb925b2c1bd727b756019ee8 100644 --- a/src/gpu/GksGpu/BoundaryConditions/BoundaryCondition.h +++ b/src/gpu/GksGpu/BoundaryConditions/BoundaryCondition.h @@ -8,7 +8,7 @@ #include "VirtualFluidsDefinitions.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "Core/VectorTypes.h" diff --git a/src/gpu/GksGpu/BoundaryConditions/ConcreteHeatFlux.cu b/src/gpu/GksGpu/BoundaryConditions/ConcreteHeatFlux.cu index 00691bd4e639ccf3836d71488d77b572d9c57565..61f001d7b082be04b07dde525d9b0a961e6f89e4 100644 --- a/src/gpu/GksGpu/BoundaryConditions/ConcreteHeatFlux.cu +++ b/src/gpu/GksGpu/BoundaryConditions/ConcreteHeatFlux.cu @@ -10,7 +10,7 @@ #include <cuda_runtime.h> #include <helper_cuda.h> -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/RealConstants.h" #include "Core/Logger/Logger.h" diff --git a/src/gpu/GksGpu/BoundaryConditions/ConcreteHeatFlux.h b/src/gpu/GksGpu/BoundaryConditions/ConcreteHeatFlux.h index af5c6376eb2de435dc0f7d7e2e83f70a1e8f4f15..35ec0723566db5a82354b57c12cbb57479f7b95c 100644 --- a/src/gpu/GksGpu/BoundaryConditions/ConcreteHeatFlux.h +++ b/src/gpu/GksGpu/BoundaryConditions/ConcreteHeatFlux.h @@ -7,7 +7,7 @@ #include "VirtualFluidsDefinitions.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "Core/VectorTypes.h" diff --git a/src/gpu/GksGpu/BoundaryConditions/CreepingMassFlux.cu b/src/gpu/GksGpu/BoundaryConditions/CreepingMassFlux.cu index d7b7f72ce0d2af993b6f4a44d9dda061d7728d07..2b8b8174fd96d335a82cd80586415fc598576678 100644 --- a/src/gpu/GksGpu/BoundaryConditions/CreepingMassFlux.cu +++ b/src/gpu/GksGpu/BoundaryConditions/CreepingMassFlux.cu @@ -8,7 +8,7 @@ #include <cuda_runtime.h> #include <helper_cuda.h> -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/RealConstants.h" #include "DataBase/DataBase.h" diff --git a/src/gpu/GksGpu/BoundaryConditions/CreepingMassFlux.h b/src/gpu/GksGpu/BoundaryConditions/CreepingMassFlux.h index 7ac9692f1989d6e58007ed6c43fa439045d08a43..0e09a56a8436348a1f1b6ed8abb1791626887467 100644 --- a/src/gpu/GksGpu/BoundaryConditions/CreepingMassFlux.h +++ b/src/gpu/GksGpu/BoundaryConditions/CreepingMassFlux.h @@ -5,7 +5,7 @@ #include "VirtualFluidsDefinitions.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "Core/VectorTypes.h" diff --git a/src/gpu/GksGpu/BoundaryConditions/Extrapolation.cu b/src/gpu/GksGpu/BoundaryConditions/Extrapolation.cu index 67e936759b2cbee8fd024db2be77c283b9bb0329..34fa30611b33f7c6226a81955e7d637bd4010f17 100644 --- a/src/gpu/GksGpu/BoundaryConditions/Extrapolation.cu +++ b/src/gpu/GksGpu/BoundaryConditions/Extrapolation.cu @@ -7,7 +7,7 @@ #include <cuda_runtime.h> #include <helper_cuda.h> -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/RealConstants.h" #include "DataBase/DataBase.h" diff --git a/src/gpu/GksGpu/BoundaryConditions/Extrapolation.h b/src/gpu/GksGpu/BoundaryConditions/Extrapolation.h index 101f0296a1efb8a49568b64bc868cd80938560e1..c62673ef2cd9aec1bdfce56b30231552fe60b004 100644 --- a/src/gpu/GksGpu/BoundaryConditions/Extrapolation.h +++ b/src/gpu/GksGpu/BoundaryConditions/Extrapolation.h @@ -5,7 +5,7 @@ #include "VirtualFluidsDefinitions.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "Core/VectorTypes.h" diff --git a/src/gpu/GksGpu/BoundaryConditions/HeatFlux.cu b/src/gpu/GksGpu/BoundaryConditions/HeatFlux.cu index 402ca580bbf356f60d77c4cc61196a26af751863..3ecd1b6cd52c2210b0e67c48937f1db1b9420f2a 100644 --- a/src/gpu/GksGpu/BoundaryConditions/HeatFlux.cu +++ b/src/gpu/GksGpu/BoundaryConditions/HeatFlux.cu @@ -8,7 +8,7 @@ #include <cuda_runtime.h> #include <helper_cuda.h> -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/RealConstants.h" #include "DataBase/DataBase.h" diff --git a/src/gpu/GksGpu/BoundaryConditions/HeatFlux.h b/src/gpu/GksGpu/BoundaryConditions/HeatFlux.h index f4cfce3abcc6c60f3749b7c8d355f93b0807fcd2..c16389ff0d8766896c63d4904e0e9c984b16dfd0 100644 --- a/src/gpu/GksGpu/BoundaryConditions/HeatFlux.h +++ b/src/gpu/GksGpu/BoundaryConditions/HeatFlux.h @@ -5,7 +5,7 @@ #include "VirtualFluidsDefinitions.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "Core/VectorTypes.h" diff --git a/src/gpu/GksGpu/BoundaryConditions/Inflow.cu b/src/gpu/GksGpu/BoundaryConditions/Inflow.cu index cf7e8a1c01f27b49f50e72bf49a1bb7f4cfa46a9..21ab9829309e072fd5049026bfb74d79c4393acb 100644 --- a/src/gpu/GksGpu/BoundaryConditions/Inflow.cu +++ b/src/gpu/GksGpu/BoundaryConditions/Inflow.cu @@ -7,7 +7,7 @@ #include <cuda_runtime.h> #include <helper_cuda.h> -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/RealConstants.h" #include "DataBase/DataBase.h" diff --git a/src/gpu/GksGpu/BoundaryConditions/Inflow.h b/src/gpu/GksGpu/BoundaryConditions/Inflow.h index 637323f42fffb5434bc25f970921813e39923c81..3de5dd16024c81f95eb54a8114f8529f9d834b40 100644 --- a/src/gpu/GksGpu/BoundaryConditions/Inflow.h +++ b/src/gpu/GksGpu/BoundaryConditions/Inflow.h @@ -5,7 +5,7 @@ #include "VirtualFluidsDefinitions.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "Core/VectorTypes.h" diff --git a/src/gpu/GksGpu/BoundaryConditions/InflowComplete.cu b/src/gpu/GksGpu/BoundaryConditions/InflowComplete.cu index 77ef127f3183d9c0ffec9dee6661a1e2aa9e0a07..6cda5a57f8327c5782725c0b720c4b6ba8a11271 100644 --- a/src/gpu/GksGpu/BoundaryConditions/InflowComplete.cu +++ b/src/gpu/GksGpu/BoundaryConditions/InflowComplete.cu @@ -8,7 +8,7 @@ #include <cuda_runtime.h> #include <helper_cuda.h> -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/RealConstants.h" #include "DataBase/DataBase.h" diff --git a/src/gpu/GksGpu/BoundaryConditions/InflowComplete.h b/src/gpu/GksGpu/BoundaryConditions/InflowComplete.h index 112a4ab3b5c7aa2ce900b3ac8262b4a9694aef28..9db64f8269a97cc9ff647ac751d8af38997ddba2 100644 --- a/src/gpu/GksGpu/BoundaryConditions/InflowComplete.h +++ b/src/gpu/GksGpu/BoundaryConditions/InflowComplete.h @@ -5,7 +5,7 @@ #include "VirtualFluidsDefinitions.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "Core/VectorTypes.h" diff --git a/src/gpu/GksGpu/BoundaryConditions/IsothermalWall.cu b/src/gpu/GksGpu/BoundaryConditions/IsothermalWall.cu index f53387adb88100cc835900854713f55184f64497..5dee058d719527ad554ed866b53d7efab536e697 100644 --- a/src/gpu/GksGpu/BoundaryConditions/IsothermalWall.cu +++ b/src/gpu/GksGpu/BoundaryConditions/IsothermalWall.cu @@ -7,7 +7,7 @@ #include <cuda_runtime.h> #include <helper_cuda.h> -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/RealConstants.h" #include "DataBase/DataBase.h" diff --git a/src/gpu/GksGpu/BoundaryConditions/IsothermalWall.h b/src/gpu/GksGpu/BoundaryConditions/IsothermalWall.h index 2d474cc891090a370133c1a39de5cb25b1abf4f0..4e33255aa1e77bb65445c05bd2ec2911844bbf2e 100644 --- a/src/gpu/GksGpu/BoundaryConditions/IsothermalWall.h +++ b/src/gpu/GksGpu/BoundaryConditions/IsothermalWall.h @@ -5,7 +5,7 @@ #include "VirtualFluidsDefinitions.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "Core/VectorTypes.h" diff --git a/src/gpu/GksGpu/BoundaryConditions/MassCompensation.cu b/src/gpu/GksGpu/BoundaryConditions/MassCompensation.cu index b010ae8e3694350726d408632147cd1917635bb6..4aaf406348754db851e1c45be542f158d7621b36 100644 --- a/src/gpu/GksGpu/BoundaryConditions/MassCompensation.cu +++ b/src/gpu/GksGpu/BoundaryConditions/MassCompensation.cu @@ -8,7 +8,7 @@ #include <cuda_runtime.h> #include <helper_cuda.h> -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/RealConstants.h" #include "DataBase/DataBase.h" diff --git a/src/gpu/GksGpu/BoundaryConditions/MassCompensation.h b/src/gpu/GksGpu/BoundaryConditions/MassCompensation.h index 21f04c256cbe305a78c862f3dd6c733cf07f8c06..4c7b38b531a69731e749767c616908789968f254 100644 --- a/src/gpu/GksGpu/BoundaryConditions/MassCompensation.h +++ b/src/gpu/GksGpu/BoundaryConditions/MassCompensation.h @@ -5,7 +5,7 @@ #include "VirtualFluidsDefinitions.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "Core/VectorTypes.h" diff --git a/src/gpu/GksGpu/BoundaryConditions/Open.cu b/src/gpu/GksGpu/BoundaryConditions/Open.cu index 8afcee1b1ca001f6b390607964917ca57e52e9e4..9413d7015ac46b18395e8544df162a3868dd0204 100644 --- a/src/gpu/GksGpu/BoundaryConditions/Open.cu +++ b/src/gpu/GksGpu/BoundaryConditions/Open.cu @@ -7,7 +7,7 @@ #include <cuda_runtime.h> #include <helper_cuda.h> -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/RealConstants.h" #include "DataBase/DataBase.h" diff --git a/src/gpu/GksGpu/BoundaryConditions/Open.h b/src/gpu/GksGpu/BoundaryConditions/Open.h index 6c6862bf6074b7ee83fbd75267a87605982fde1a..3f23f0114883746a7d97e195fb2f76d34d3b82dc 100644 --- a/src/gpu/GksGpu/BoundaryConditions/Open.h +++ b/src/gpu/GksGpu/BoundaryConditions/Open.h @@ -5,7 +5,7 @@ #include "VirtualFluidsDefinitions.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "Core/VectorTypes.h" diff --git a/src/gpu/GksGpu/BoundaryConditions/PassiveScalarDiriclet.cu b/src/gpu/GksGpu/BoundaryConditions/PassiveScalarDiriclet.cu index 169afb42203ecb5dae867dd31bc13b8418848f0d..e8e29790157874ee9775eba84a48a62ca71bb18b 100644 --- a/src/gpu/GksGpu/BoundaryConditions/PassiveScalarDiriclet.cu +++ b/src/gpu/GksGpu/BoundaryConditions/PassiveScalarDiriclet.cu @@ -7,7 +7,7 @@ #include <cuda_runtime.h> #include <helper_cuda.h> -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/RealConstants.h" #include "DataBase/DataBase.h" diff --git a/src/gpu/GksGpu/BoundaryConditions/PassiveScalarDiriclet.h b/src/gpu/GksGpu/BoundaryConditions/PassiveScalarDiriclet.h index ef9cadf18443f7a224a2fc9124f97bb2293de7e7..f8e6e31b6a4ff983d8e3ebdae110b23dd7a19c11 100644 --- a/src/gpu/GksGpu/BoundaryConditions/PassiveScalarDiriclet.h +++ b/src/gpu/GksGpu/BoundaryConditions/PassiveScalarDiriclet.h @@ -5,7 +5,7 @@ #include "VirtualFluidsDefinitions.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "Core/VectorTypes.h" diff --git a/src/gpu/GksGpu/BoundaryConditions/Periodic.cu b/src/gpu/GksGpu/BoundaryConditions/Periodic.cu index c3811d5a1656cafcb971d43acb9e29fcfb01b0b6..559e4c6dac326b417cc98adb10db1dcab154a987 100644 --- a/src/gpu/GksGpu/BoundaryConditions/Periodic.cu +++ b/src/gpu/GksGpu/BoundaryConditions/Periodic.cu @@ -7,7 +7,7 @@ #include <cuda_runtime.h> #include <helper_cuda.h> -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/RealConstants.h" #include "GksMeshAdapter/GksMeshAdapter.h" diff --git a/src/gpu/GksGpu/BoundaryConditions/Periodic.h b/src/gpu/GksGpu/BoundaryConditions/Periodic.h index 61f5ecf88c13d440b5b721dfc6cf5bf900dcde1a..9f287de60304aab7d117098f1ff10806e437353f 100644 --- a/src/gpu/GksGpu/BoundaryConditions/Periodic.h +++ b/src/gpu/GksGpu/BoundaryConditions/Periodic.h @@ -5,7 +5,7 @@ #include "VirtualFluidsDefinitions.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "Core/VectorTypes.h" diff --git a/src/gpu/GksGpu/BoundaryConditions/Pressure.cu b/src/gpu/GksGpu/BoundaryConditions/Pressure.cu index 1823029a466eb7f303b863ab28dc018f0c0e36bd..8523eb18e7db60b79170eee5884d22a3a25abac5 100644 --- a/src/gpu/GksGpu/BoundaryConditions/Pressure.cu +++ b/src/gpu/GksGpu/BoundaryConditions/Pressure.cu @@ -7,7 +7,7 @@ #include <cuda_runtime.h> #include <helper_cuda.h> -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/RealConstants.h" #include "DataBase/DataBase.h" diff --git a/src/gpu/GksGpu/BoundaryConditions/Pressure.h b/src/gpu/GksGpu/BoundaryConditions/Pressure.h index 0eca81ca45fd020b29cf662fe2977bef6c287f44..f324037700a4cb6ecf31b8f5df7816441e29d2f7 100644 --- a/src/gpu/GksGpu/BoundaryConditions/Pressure.h +++ b/src/gpu/GksGpu/BoundaryConditions/Pressure.h @@ -5,7 +5,7 @@ #include "VirtualFluidsDefinitions.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "Core/VectorTypes.h" diff --git a/src/gpu/GksGpu/BoundaryConditions/Pressure2.cu b/src/gpu/GksGpu/BoundaryConditions/Pressure2.cu index 2caafeec36362dbd5bd69e5d153ead2dd7d402b6..c6b00d1ad5689efa1179415b3a6a3ff555700409 100644 --- a/src/gpu/GksGpu/BoundaryConditions/Pressure2.cu +++ b/src/gpu/GksGpu/BoundaryConditions/Pressure2.cu @@ -7,7 +7,7 @@ #include <cuda_runtime.h> #include <helper_cuda.h> -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/RealConstants.h" #include "DataBase/DataBase.h" diff --git a/src/gpu/GksGpu/BoundaryConditions/Pressure2.h b/src/gpu/GksGpu/BoundaryConditions/Pressure2.h index cad4376520d46e7565d61065ea2fba08e1679aa9..676a51c11593efb905ee3717fb7dd86d9963441f 100644 --- a/src/gpu/GksGpu/BoundaryConditions/Pressure2.h +++ b/src/gpu/GksGpu/BoundaryConditions/Pressure2.h @@ -5,7 +5,7 @@ #include "VirtualFluidsDefinitions.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "Core/VectorTypes.h" diff --git a/src/gpu/GksGpu/BoundaryConditions/SalinasVazquez.cu b/src/gpu/GksGpu/BoundaryConditions/SalinasVazquez.cu index 158378c4263095d20e4730008c4b0f1d511e6515..afb2065b4cbef2b60db5010d8eb0d750b0320dbd 100644 --- a/src/gpu/GksGpu/BoundaryConditions/SalinasVazquez.cu +++ b/src/gpu/GksGpu/BoundaryConditions/SalinasVazquez.cu @@ -7,7 +7,7 @@ #include <cuda_runtime.h> #include <helper_cuda.h> -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/RealConstants.h" #include "DataBase/DataBase.h" diff --git a/src/gpu/GksGpu/BoundaryConditions/SalinasVazquez.h b/src/gpu/GksGpu/BoundaryConditions/SalinasVazquez.h index f0ce0fa8ac2b22c0416428c1b6c040972aeddf80..c093a98251c8cd4c9b0054e7ddaf0ea902245d44 100644 --- a/src/gpu/GksGpu/BoundaryConditions/SalinasVazquez.h +++ b/src/gpu/GksGpu/BoundaryConditions/SalinasVazquez.h @@ -5,7 +5,7 @@ #include "VirtualFluidsDefinitions.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "Core/VectorTypes.h" diff --git a/src/gpu/GksGpu/BoundaryConditions/Symmetry.cu b/src/gpu/GksGpu/BoundaryConditions/Symmetry.cu index dc14b8b2dbde255e1e5f64ed3b65ff88d0dfb130..c4e104cf095125fd40bb0d06ab707697d84826ee 100644 --- a/src/gpu/GksGpu/BoundaryConditions/Symmetry.cu +++ b/src/gpu/GksGpu/BoundaryConditions/Symmetry.cu @@ -7,7 +7,7 @@ #include <cuda_runtime.h> #include <helper_cuda.h> -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/RealConstants.h" #include "DataBase/DataBase.h" diff --git a/src/gpu/GksGpu/BoundaryConditions/Symmetry.h b/src/gpu/GksGpu/BoundaryConditions/Symmetry.h index db3dee0cd71545cb8ce81a951e713390cdfe9f87..b88005ec3c242ed4b0e8a25915b851dfb27fa007 100644 --- a/src/gpu/GksGpu/BoundaryConditions/Symmetry.h +++ b/src/gpu/GksGpu/BoundaryConditions/Symmetry.h @@ -5,7 +5,7 @@ #include "VirtualFluidsDefinitions.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "Core/VectorTypes.h" diff --git a/src/gpu/GksGpu/BoundaryConditions/package.include b/src/gpu/GksGpu/BoundaryConditions/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/GksGpu/CellProperties/package.include b/src/gpu/GksGpu/CellProperties/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/GksGpu/CellUpdate/CellUpdate.cu b/src/gpu/GksGpu/CellUpdate/CellUpdate.cu index a133ad759ee2d018c7df5cb6238d7ce71c3f338c..ccc7ab12c8ffb9fa183873b36b5faef16a50d793 100644 --- a/src/gpu/GksGpu/CellUpdate/CellUpdate.cu +++ b/src/gpu/GksGpu/CellUpdate/CellUpdate.cu @@ -5,7 +5,7 @@ #include <helper_cuda.h> #include <math.h> -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/RealConstants.h" #include "DataBase/DataBaseStruct.h" diff --git a/src/gpu/GksGpu/CellUpdate/CellUpdate.h b/src/gpu/GksGpu/CellUpdate/CellUpdate.h index 25f2a838e6944d2498e5b37558c17ef6abc39995..9a8a8014239dffcb71254a69d2e7109d18fae8f1 100644 --- a/src/gpu/GksGpu/CellUpdate/CellUpdate.h +++ b/src/gpu/GksGpu/CellUpdate/CellUpdate.h @@ -3,7 +3,7 @@ #include "VirtualFluidsDefinitions.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "DataBase/DataBase.h" diff --git a/src/gpu/GksGpu/CellUpdate/Reaction.cuh b/src/gpu/GksGpu/CellUpdate/Reaction.cuh index 1e3c7b2f696f5a7597834505e1dc68dde0542a92..4bf317b2704d0111079fcb9888f62026265e6fd0 100644 --- a/src/gpu/GksGpu/CellUpdate/Reaction.cuh +++ b/src/gpu/GksGpu/CellUpdate/Reaction.cuh @@ -5,7 +5,7 @@ #include <helper_cuda.h> #include <math.h> -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/RealConstants.h" #include "DataBase/DataBaseStruct.h" diff --git a/src/gpu/GksGpu/CellUpdate/package.include b/src/gpu/GksGpu/CellUpdate/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/GksGpu/Communication/Communicator.cpp b/src/gpu/GksGpu/Communication/Communicator.cpp index 3e2eaca36adcaf43729e737210eed0646bee59c0..6f4fc0fa575e5c6908ca8a55000b40f78733a781 100644 --- a/src/gpu/GksGpu/Communication/Communicator.cpp +++ b/src/gpu/GksGpu/Communication/Communicator.cpp @@ -10,7 +10,7 @@ #include <math.h> #include <iostream> -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "GksMeshAdapter/GksMeshAdapter.h" diff --git a/src/gpu/GksGpu/Communication/Communicator.cu b/src/gpu/GksGpu/Communication/Communicator.cu index 5cdbcd69e54b9441aa832def6fcbc3b99ef9960c..58951afdef57d6eb53fd7b6ab278d0df63cf00d2 100644 --- a/src/gpu/GksGpu/Communication/Communicator.cu +++ b/src/gpu/GksGpu/Communication/Communicator.cu @@ -7,7 +7,7 @@ #include <cuda_runtime.h> #include <helper_cuda.h> -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/RealConstants.h" #include "GksMeshAdapter/GksMeshAdapter.h" diff --git a/src/gpu/GksGpu/Communication/Communicator.h b/src/gpu/GksGpu/Communication/Communicator.h index ecb7953e17f14c6edd572812b6e2ed54e985551a..40b9207ffd4575fc6b35e4b585ec2d0959a79ffe 100644 --- a/src/gpu/GksGpu/Communication/Communicator.h +++ b/src/gpu/GksGpu/Communication/Communicator.h @@ -8,7 +8,7 @@ #include "VirtualFluidsDefinitions.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "Core/VectorTypes.h" diff --git a/src/gpu/GksGpu/Communication/MpiUtility.h b/src/gpu/GksGpu/Communication/MpiUtility.h index eaf565365919abb158f9d95dac3ed2a49923e569..a26b089ea334f47d757f77733b9d3e4ee9bebba4 100644 --- a/src/gpu/GksGpu/Communication/MpiUtility.h +++ b/src/gpu/GksGpu/Communication/MpiUtility.h @@ -5,7 +5,7 @@ #include "VirtualFluidsDefinitions.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "Core/VectorTypes.h" diff --git a/src/gpu/GksGpu/Communication/package.include b/src/gpu/GksGpu/Communication/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/GksGpu/CudaUtility/package.include b/src/gpu/GksGpu/CudaUtility/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/GksGpu/DataBase/DataBase.h b/src/gpu/GksGpu/DataBase/DataBase.h index 4ecc2768a1d5947f602a6bafe4d83ced98660e28..e2725a93be3368ab43b55475e7ac9f00ee3379e5 100644 --- a/src/gpu/GksGpu/DataBase/DataBase.h +++ b/src/gpu/GksGpu/DataBase/DataBase.h @@ -6,7 +6,7 @@ #include <vector> #include <array> -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "Core/VectorTypes.h" #include "Core/ArrayTypes.h" diff --git a/src/gpu/GksGpu/DataBase/DataBaseAllocator.h b/src/gpu/GksGpu/DataBase/DataBaseAllocator.h index 0962ceb4d7866959408db047f5e6728061183531..a19ed987bfa3f125a6b7e146fe6294c751b651c7 100644 --- a/src/gpu/GksGpu/DataBase/DataBaseAllocator.h +++ b/src/gpu/GksGpu/DataBase/DataBaseAllocator.h @@ -5,7 +5,7 @@ #include <vector> #include "Core/DataTypes.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "VirtualFluidsDefinitions.h" diff --git a/src/gpu/GksGpu/DataBase/DataBaseAllocatorCPU.cpp b/src/gpu/GksGpu/DataBase/DataBaseAllocatorCPU.cpp index e1fe121b5cd370f6090ca2c82cd9a0f2448935ac..39d5f788c6a3b5332ded60378fdae8cd137d0b80 100644 --- a/src/gpu/GksGpu/DataBase/DataBaseAllocatorCPU.cpp +++ b/src/gpu/GksGpu/DataBase/DataBaseAllocatorCPU.cpp @@ -3,7 +3,7 @@ #include <cstring> #include "Core/DataTypes.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "GksMeshAdapter/GksMeshAdapter.h" diff --git a/src/gpu/GksGpu/DataBase/DataBaseAllocatorCPU.h b/src/gpu/GksGpu/DataBase/DataBaseAllocatorCPU.h index fdefb3a07849a0966550493cb706644e1ead431a..b42de3e4d1c24981531d066100598a95dd7a58fa 100644 --- a/src/gpu/GksGpu/DataBase/DataBaseAllocatorCPU.h +++ b/src/gpu/GksGpu/DataBase/DataBaseAllocatorCPU.h @@ -2,7 +2,7 @@ #define DatabaseAllocatorCPU_H #include "Core/DataTypes.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "DataBaseAllocator.h" diff --git a/src/gpu/GksGpu/DataBase/DataBaseAllocatorGPU.cpp b/src/gpu/GksGpu/DataBase/DataBaseAllocatorGPU.cpp index 9d1400d6f43cc669eba00401b1c30057330cf843..b2eb7d6f124bcb004ee900228a1631a452b6ff3a 100644 --- a/src/gpu/GksGpu/DataBase/DataBaseAllocatorGPU.cpp +++ b/src/gpu/GksGpu/DataBase/DataBaseAllocatorGPU.cpp @@ -6,7 +6,7 @@ #include <helper_cuda.h> #include "Core/DataTypes.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "GksMeshAdapter/GksMeshAdapter.h" diff --git a/src/gpu/GksGpu/DataBase/DataBaseAllocatorGPU.h b/src/gpu/GksGpu/DataBase/DataBaseAllocatorGPU.h index 359677195dac0dee08f2b68a68c0a9a2b6cc3cf9..44649060d45d7c67d4b233b3caf828bbce20659e 100644 --- a/src/gpu/GksGpu/DataBase/DataBaseAllocatorGPU.h +++ b/src/gpu/GksGpu/DataBase/DataBaseAllocatorGPU.h @@ -2,7 +2,7 @@ #define DatabaseAllocatorGPU_H #include "Core/DataTypes.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "DataBaseAllocator.h" diff --git a/src/gpu/GksGpu/DataBase/package.include b/src/gpu/GksGpu/DataBase/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/GksGpu/Definitions/package.include b/src/gpu/GksGpu/Definitions/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/GksGpu/FlowStateData/package.include b/src/gpu/GksGpu/FlowStateData/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/GksGpu/FluxComputation/FluxComputation.cu b/src/gpu/GksGpu/FluxComputation/FluxComputation.cu index df2a63bc80b9e84d2eb548c5e0c48f47e99f7cfa..8c935863615eb1c3f117c87b6ba57e92a0061c0f 100644 --- a/src/gpu/GksGpu/FluxComputation/FluxComputation.cu +++ b/src/gpu/GksGpu/FluxComputation/FluxComputation.cu @@ -4,7 +4,7 @@ #include <cuda_runtime.h> #include <helper_cuda.h> -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "DataBase/DataBaseStruct.h" diff --git a/src/gpu/GksGpu/FluxComputation/FluxComputation.h b/src/gpu/GksGpu/FluxComputation/FluxComputation.h index 3c24532e98eaff11f34e7fefd4540ec3c9c0cb9d..fac94847a8760e63cfcbb0b6df5f4497867d4c14 100644 --- a/src/gpu/GksGpu/FluxComputation/FluxComputation.h +++ b/src/gpu/GksGpu/FluxComputation/FluxComputation.h @@ -3,7 +3,7 @@ #include "VirtualFluidsDefinitions.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "DataBase/DataBase.h" diff --git a/src/gpu/GksGpu/FluxComputation/package.include b/src/gpu/GksGpu/FluxComputation/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/GksGpu/Initializer/Initializer.cpp b/src/gpu/GksGpu/Initializer/Initializer.cpp index ee1b8e89a9f5cb370e1783624cd6e687ff4de4b5..f5c2cf535aefaa4e5662ae8dc588859ccebdc008 100644 --- a/src/gpu/GksGpu/Initializer/Initializer.cpp +++ b/src/gpu/GksGpu/Initializer/Initializer.cpp @@ -4,7 +4,7 @@ #define _USE_MATH_DEFINES #include <math.h> -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/RealConstants.h" #include "DataBase/DataBaseStruct.h" diff --git a/src/gpu/GksGpu/Initializer/Initializer.h b/src/gpu/GksGpu/Initializer/Initializer.h index a005fb17085207f171b26403853cc77098a8344f..5dcadb696a76f3930ad12d6fba172991c27e54ab 100644 --- a/src/gpu/GksGpu/Initializer/Initializer.h +++ b/src/gpu/GksGpu/Initializer/Initializer.h @@ -7,7 +7,7 @@ #include "VirtualFluidsDefinitions.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "Core/VectorTypes.h" diff --git a/src/gpu/GksGpu/Initializer/InitializerKernel.cu b/src/gpu/GksGpu/Initializer/InitializerKernel.cu index a929f3b4f1b7c726b52754faa3a8f29bb5fcf543..8b456e9be744b0d7999ff0d5e585c55460b7dbcf 100644 --- a/src/gpu/GksGpu/Initializer/InitializerKernel.cu +++ b/src/gpu/GksGpu/Initializer/InitializerKernel.cu @@ -4,7 +4,7 @@ #include <cuda_runtime.h> #include <helper_cuda.h> -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/RealConstants.h" #include "DataBase/DataBaseStruct.h" diff --git a/src/gpu/GksGpu/Initializer/package.include b/src/gpu/GksGpu/Initializer/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/GksGpu/Interface/CoarseToFineKernel.cu b/src/gpu/GksGpu/Interface/CoarseToFineKernel.cu index b6536353f8260502c171bfd9a2ff99d5f49506f4..d1451db3c2595fc65a9f052033822459bb07000e 100644 --- a/src/gpu/GksGpu/Interface/CoarseToFineKernel.cu +++ b/src/gpu/GksGpu/Interface/CoarseToFineKernel.cu @@ -4,7 +4,7 @@ #include <cuda_runtime.h> #include <helper_cuda.h> -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "DataBase/DataBaseStruct.h" diff --git a/src/gpu/GksGpu/Interface/FineToCoarseKernel.cu b/src/gpu/GksGpu/Interface/FineToCoarseKernel.cu index b6b3bc32cde5ab138e5c0f7752d48c7283505670..e31fdb912d735669297027b4f15808869d17abf2 100644 --- a/src/gpu/GksGpu/Interface/FineToCoarseKernel.cu +++ b/src/gpu/GksGpu/Interface/FineToCoarseKernel.cu @@ -4,7 +4,7 @@ #include <cuda_runtime.h> #include <helper_cuda.h> -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "DataBase/DataBaseStruct.h" diff --git a/src/gpu/GksGpu/Interface/Interface.h b/src/gpu/GksGpu/Interface/Interface.h index 1e4fcf7dca74aa5f79039b746a95f86601a05147..53a2db5e71bfd2c6a915d3df81af19f3599a9785 100644 --- a/src/gpu/GksGpu/Interface/Interface.h +++ b/src/gpu/GksGpu/Interface/Interface.h @@ -3,7 +3,7 @@ #include "VirtualFluidsDefinitions.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "DataBase/DataBase.h" diff --git a/src/gpu/GksGpu/Interface/package.include b/src/gpu/GksGpu/Interface/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/GksGpu/Parameters/package.include b/src/gpu/GksGpu/Parameters/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/GksGpu/Restart/Restart.cpp b/src/gpu/GksGpu/Restart/Restart.cpp index 0f63e8c8f3c7483f9ae355f04c7be6b0c16a7853..5f593c22662f2a6c471d59d432b8694d9bdefc6d 100644 --- a/src/gpu/GksGpu/Restart/Restart.cpp +++ b/src/gpu/GksGpu/Restart/Restart.cpp @@ -3,7 +3,7 @@ #include <iostream> #include <fstream> -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/RealConstants.h" #include "Core/Logger/Logger.h" diff --git a/src/gpu/GksGpu/Restart/Restart.h b/src/gpu/GksGpu/Restart/Restart.h index d414e2b163878ac8e5856d330d6f9ecf7a833e1f..3603aff810620b74418fe59f7061329b77b75da5 100644 --- a/src/gpu/GksGpu/Restart/Restart.h +++ b/src/gpu/GksGpu/Restart/Restart.h @@ -6,7 +6,7 @@ #include <VirtualFluidsDefinitions.h> -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" namespace GksGpu { diff --git a/src/gpu/GksGpu/Restart/package.include b/src/gpu/GksGpu/Restart/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/GksGpu/TimeStepping/NestedTimeStep.h b/src/gpu/GksGpu/TimeStepping/NestedTimeStep.h index b139d1d8073610213b2e1842ef23675fcf91b53c..25cdf4d911f44bfc25a442d56996a7154dcc1159 100644 --- a/src/gpu/GksGpu/TimeStepping/NestedTimeStep.h +++ b/src/gpu/GksGpu/TimeStepping/NestedTimeStep.h @@ -3,7 +3,7 @@ #include "VirtualFluidsDefinitions.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "DataBase/DataBase.h" diff --git a/src/gpu/GksGpu/TimeStepping/package.include b/src/gpu/GksGpu/TimeStepping/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/GksGpu/package.include b/src/gpu/GksGpu/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/GksMeshAdapter/GksMeshAdapter.h b/src/gpu/GksMeshAdapter/GksMeshAdapter.h index 3efa7f98a019726bde2d1792270590bcd0469e63..18a7034cf7af50f1edda648f33f7469380ba6f41 100644 --- a/src/gpu/GksMeshAdapter/GksMeshAdapter.h +++ b/src/gpu/GksMeshAdapter/GksMeshAdapter.h @@ -6,7 +6,7 @@ #include <vector> #include "Core/DataTypes.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "MeshCell.h" #include "MeshFace.h" diff --git a/src/gpu/GksMeshAdapter/package.include b/src/gpu/GksMeshAdapter/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/GksVtkAdapter/VTKAdapter.h b/src/gpu/GksVtkAdapter/VTKAdapter.h index eebab036a24c1eec3215d7ec2f0462f223d62f8b..62bc8b25bb2bd3e8da3e97a6b3a7791b96423f5c 100644 --- a/src/gpu/GksVtkAdapter/VTKAdapter.h +++ b/src/gpu/GksVtkAdapter/VTKAdapter.h @@ -20,7 +20,7 @@ #include <functional> #include <string> -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "VirtualFluidsDefinitions.h" diff --git a/src/gpu/GksVtkAdapter/package.include b/src/gpu/GksVtkAdapter/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/GridGenerator/CMakeLists.txt b/src/gpu/GridGenerator/CMakeLists.txt index 7ec3d01d871944022e73d5064f0352958014836a..92f83cc1b27bbb7c130e24c55042ed6f27a841ec 100644 --- a/src/gpu/GridGenerator/CMakeLists.txt +++ b/src/gpu/GridGenerator/CMakeLists.txt @@ -1,26 +1,15 @@ -#include (${CMAKE_SOURCE_DIR}/${cmakeMacroPath}/Cuda/Link.cmake) -#linkCuda(${targetName}) -#include (${CMAKE_SOURCE_DIR}/${cmakeMacroPath}/MPI/Link.cmake) -#linkMPI(${targetName}) -#include (${CMAKE_SOURCE_DIR}/${cmakeMacroPath}/Boost/Link.cmake) -#linkBoost(${targetName} "serialization") -#include (${CMAKE_SOURCE_DIR}/${cmakeMacroPath}/Metis/Link.cmake) -#linkMetis(${targetName}) -#include (${CMAKE_SOURCE_DIR}/${cmakeMacroPath}/OpenMP/Link.cmake) -#linkOpenMP(${targetName}) - - vf_add_library(BUILDTYPE shared DEPENDS basics) -include (${CMAKE_PATH}/3rd/cuda.cmake) -include (${CMAKE_PATH}/3rd/OpenMP.cmake) +include (${VF_CMAKE_DIR}/3rd/cuda.cmake) +include (${VF_CMAKE_DIR}/3rd/OpenMP.cmake) vf_get_library_name(library_name) -target_include_directories(${library_name} PRIVATE "${CMAKE_SOURCE_DIR}/src/basics") -target_include_directories(${library_name} PRIVATE "${CMAKE_SOURCE_DIR}/src/gpu") -target_include_directories(${library_name} PRIVATE "${CMAKE_SOURCE_DIR}/src/basics/Core") +target_include_directories(${library_name} PRIVATE ${VF_SRC_DIR}/basics) +target_include_directories(${library_name} PRIVATE ${VF_SRC_DIR}/basics/geometry3d) +target_include_directories(${library_name} PRIVATE ${VF_SRC_DIR}/gpu) +target_include_directories(${library_name} PRIVATE ${VF_SRC_DIR}/basics/Core) set_property(TARGET ${library_name} PROPERTY CUDA_SEPARABLE_COMPILATION ON) \ No newline at end of file diff --git a/src/gpu/GridGenerator/StreetPointFinder/StreetPointFinder.h b/src/gpu/GridGenerator/StreetPointFinder/StreetPointFinder.h index 905ac7b2ff1907910663622123e57ac479a4679d..5c552d51572008615294f7fde583863b7b1a4523 100644 --- a/src/gpu/GridGenerator/StreetPointFinder/StreetPointFinder.h +++ b/src/gpu/GridGenerator/StreetPointFinder/StreetPointFinder.h @@ -6,7 +6,7 @@ #include "GridGenerator_export.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include <VirtualFluidsDefinitions.h> diff --git a/src/gpu/GridGenerator/StreetPointFinder/package.include b/src/gpu/GridGenerator/StreetPointFinder/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/GridGenerator/geometries/Arrow/package.include b/src/gpu/GridGenerator/geometries/Arrow/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/GridGenerator/geometries/BoundingBox/package.include b/src/gpu/GridGenerator/geometries/BoundingBox/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/GridGenerator/geometries/Conglomerate/package.include b/src/gpu/GridGenerator/geometries/Conglomerate/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/GridGenerator/geometries/Cuboid/package.include b/src/gpu/GridGenerator/geometries/Cuboid/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/GridGenerator/geometries/Point/package.include b/src/gpu/GridGenerator/geometries/Point/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/GridGenerator/geometries/Sphere/package.include b/src/gpu/GridGenerator/geometries/Sphere/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/GridGenerator/geometries/Triangle/package.include b/src/gpu/GridGenerator/geometries/Triangle/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/GridGenerator/geometries/TriangularMesh/TriangularMesh.cu b/src/gpu/GridGenerator/geometries/TriangularMesh/TriangularMesh.cu index e351b69fc4b38f983038680f93ee3f1b9fac2bc3..a856613875da5bd8179b9bb67fc707f84fec08cd 100644 --- a/src/gpu/GridGenerator/geometries/TriangularMesh/TriangularMesh.cu +++ b/src/gpu/GridGenerator/geometries/TriangularMesh/TriangularMesh.cu @@ -2,7 +2,7 @@ #include "Core/Timer/Timer.h" -#include "basics/numerics/geometry3d/GbTriFaceMesh3D.h" +#include "basics/geometry3d/GbTriFaceMesh3D.h" #include "geometries/TriangularMesh/triangleNeighborFinder/TriangleNeighborFinder.h" #include "geometries/TriangularMesh/TriangularMeshStrategy.h" diff --git a/src/gpu/GridGenerator/geometries/TriangularMesh/TriangularMeshStrategy.cpp b/src/gpu/GridGenerator/geometries/TriangularMesh/TriangularMeshStrategy.cpp index 3fea77f5434b7e1d02fef5fce096247727259e5c..f4d5d64c1b2c82a7855747343bcc2c04a7b192cb 100644 --- a/src/gpu/GridGenerator/geometries/TriangularMesh/TriangularMeshStrategy.cpp +++ b/src/gpu/GridGenerator/geometries/TriangularMesh/TriangularMeshStrategy.cpp @@ -2,7 +2,7 @@ #include "Core/Timer/Timer.h" -#include "basics/numerics/geometry3d/GbTriFaceMesh3D.h" +#include "basics/geometry3d/GbTriFaceMesh3D.h" #include "geometries/Triangle/Triangle.h" #include "geometries/TriangularMesh/TriangularMesh.h" diff --git a/src/gpu/GridGenerator/geometries/TriangularMesh/package.include b/src/gpu/GridGenerator/geometries/TriangularMesh/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/GridGenerator/geometries/TriangularMesh/triangleNeighborFinder/package.include b/src/gpu/GridGenerator/geometries/TriangularMesh/triangleNeighborFinder/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/GridGenerator/geometries/TriangularMesh/triangleRefinement/package.include b/src/gpu/GridGenerator/geometries/TriangularMesh/triangleRefinement/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/GridGenerator/geometries/Vertex/package.include b/src/gpu/GridGenerator/geometries/Vertex/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/GridGenerator/geometries/VerticalCylinder/package.include b/src/gpu/GridGenerator/geometries/VerticalCylinder/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/GridGenerator/geometries/package.include b/src/gpu/GridGenerator/geometries/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/GridGenerator/global.h b/src/gpu/GridGenerator/global.h index 87e198b69932fde220133064a6be8612b56193c6..517d905ff6dc64cdb9b9d2d2824da873788b00ac 100644 --- a/src/gpu/GridGenerator/global.h +++ b/src/gpu/GridGenerator/global.h @@ -10,7 +10,7 @@ #include "VirtualFluidsDefinitions.h" #include "GridGenerator_export.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "Core/Logger/Logger.h" diff --git a/src/gpu/GridGenerator/grid/BoundaryConditions/package.include b/src/gpu/GridGenerator/grid/BoundaryConditions/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/GridGenerator/grid/GridBuilder/package.include b/src/gpu/GridGenerator/grid/GridBuilder/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/GridGenerator/grid/GridStrategy/GridCpuStrategy/package.include b/src/gpu/GridGenerator/grid/GridStrategy/GridCpuStrategy/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/GridGenerator/grid/GridStrategy/GridGpuStrategy/package.include b/src/gpu/GridGenerator/grid/GridStrategy/GridGpuStrategy/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/GridGenerator/grid/GridStrategy/package.include b/src/gpu/GridGenerator/grid/GridStrategy/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/GridGenerator/grid/distributions/package.include b/src/gpu/GridGenerator/grid/distributions/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/GridGenerator/grid/kernel/package.include b/src/gpu/GridGenerator/grid/kernel/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/GridGenerator/grid/package.include b/src/gpu/GridGenerator/grid/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/GridGenerator/grid/partition/package.include b/src/gpu/GridGenerator/grid/partition/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/GridGenerator/io/GridVTKWriter/package.include b/src/gpu/GridGenerator/io/GridVTKWriter/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/GridGenerator/io/STLReaderWriter/package.include b/src/gpu/GridGenerator/io/STLReaderWriter/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/GridGenerator/io/SimulationFileWriter/package.include b/src/gpu/GridGenerator/io/SimulationFileWriter/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/GridGenerator/io/VTKWriterWrapper/package.include b/src/gpu/GridGenerator/io/VTKWriterWrapper/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/GridGenerator/io/package.include b/src/gpu/GridGenerator/io/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/GridGenerator/package.include b/src/gpu/GridGenerator/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/GridGenerator/utilities/cuda/package.include b/src/gpu/GridGenerator/utilities/cuda/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/GridGenerator/utilities/math/package.include b/src/gpu/GridGenerator/utilities/math/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/GridGenerator/utilities/package.include b/src/gpu/GridGenerator/utilities/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/GridGenerator/utilities/transformator/package.include b/src/gpu/GridGenerator/utilities/transformator/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/Traffic/CMakeLists.txt b/src/gpu/Traffic/CMakeLists.txt index e026bdd459642243f9c309e816fecad9ea86c00a..ce63e4a3cb2120d68c07b9dff4de55aca8b0b2ec 100644 --- a/src/gpu/Traffic/CMakeLists.txt +++ b/src/gpu/Traffic/CMakeLists.txt @@ -2,7 +2,7 @@ vf_add_library(BUILDTYPE shared DEPENDS GridGenerator basics) -include (${CMAKE_PATH}/3rd/cuda.cmake) +include (${VF_CMAKE_DIR}/3rd/cuda.cmake) vf_get_library_name(library_name) target_include_directories(${library_name} PRIVATE "${CMAKE_SOURCE_DIR}/src/basics") diff --git a/src/gpu/Traffic/GPU/TrafficTimestep.h b/src/gpu/Traffic/GPU/TrafficTimestep.h index 4040b993c89f356d33e53c0afd8891926321f572..d6355afb9ff95b02f74aaf5880a5ebd8ab004677 100644 --- a/src/gpu/Traffic/GPU/TrafficTimestep.h +++ b/src/gpu/Traffic/GPU/TrafficTimestep.h @@ -8,7 +8,7 @@ #include <curand_kernel.h> #include <VirtualFluidsDefinitions.h> -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "Traffic_export.h" diff --git a/src/gpu/Traffic/GPU/package.include b/src/gpu/Traffic/GPU/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/Traffic/Junction/package.include b/src/gpu/Traffic/Junction/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/Traffic/Output/package.include b/src/gpu/Traffic/Output/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/Traffic/RoadNetwork/package.include b/src/gpu/Traffic/RoadNetwork/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/Traffic/Sink/package.include b/src/gpu/Traffic/Sink/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/Traffic/Source/package.include b/src/gpu/Traffic/Source/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/Traffic/Utilities/package.include b/src/gpu/Traffic/Utilities/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/Traffic/package.include b/src/gpu/Traffic/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/CMakeLists.txt b/src/gpu/VirtualFluids_GPU/CMakeLists.txt index 6f1f638662e5ceeb968d630c534bc49c22fab1e0..415d25354d366218a588427d8e50b9099606a7b1 100644 --- a/src/gpu/VirtualFluids_GPU/CMakeLists.txt +++ b/src/gpu/VirtualFluids_GPU/CMakeLists.txt @@ -1,10 +1,3 @@ -#include (${CMAKE_SOURCE_DIR}/${cmakeMacroPath}/Cuda/Link.cmake) -#linkCuda(${targetName}) -#include (${CMAKE_SOURCE_DIR}/${cmakeMacroPath}/MPI/Link.cmake) -#linkMPI(${targetName}) -#include (${CMAKE_SOURCE_DIR}/${cmakeMacroPath}/Boost/Link.cmake) -#linkBoost(${targetName} "serialization") - IF(MSVC) set(libsToLink ws2_32 GridGenerator basics Traffic) # ws_32 throws an error on Phoenix @@ -16,26 +9,17 @@ ENDIF(MSVC) vf_add_library(BUILDTYPE shared DEPENDS ${libsToLink}) -include (${CMAKE_PATH}/3rd/cuda.cmake) -include (${CMAKE_PATH}/3rd/mpi.cmake) -include (${CMAKE_PATH}/3rd/boost.cmake) +include (${VF_CMAKE_DIR}/3rd/cuda.cmake) +include (${VF_CMAKE_DIR}/3rd/mpi.cmake) +include (${VF_CMAKE_DIR}/3rd/boost.cmake) linkBoost ("serialization") vf_get_library_name(library_name) -target_include_directories(${library_name} PRIVATE "${CMAKE_SOURCE_DIR}/src/basics") -target_include_directories(${library_name} PRIVATE "${CMAKE_SOURCE_DIR}/src/gpu") -target_include_directories(${library_name} PRIVATE "${CMAKE_SOURCE_DIR}/src/gpu/GridGenerator") -target_include_directories(${library_name} PRIVATE "${CMAKE_SOURCE_DIR}/src/basics/Core") - - +target_include_directories(${library_name} PRIVATE ${VF_SRC_DIR}/basics) +target_include_directories(${library_name} PRIVATE ${VF_SRC_DIR}/gpu) +target_include_directories(${library_name} PRIVATE ${VF_SRC_DIR}/gpu/GridGenerator) +target_include_directories(${library_name} PRIVATE ${VF_SRC_DIR}/basics/Core) -#set(includeDirectories ${CMAKE_SOURCE_DIR}/src/${targetName} -# ${CMAKE_SOURCE_DIR}/src -# ${CMAKE_SOURCE_DIR}/src/GridGenerator -# ${CMAKE_SOURCE_DIR}/src/VirtualFluidsBasics -# ${CMAKE_SOURCE_DIR}/src/Core -# ${CMAKE_SOURCE_DIR}/src/Traffic -# ) #SET(TPN_WIN32 "/EHsc") #https://stackoverflow.com/questions/6832666/lnk2019-when-including-asio-headers-solution-generated-with-cmake diff --git a/src/gpu/VirtualFluids_GPU/Calculation/package.include b/src/gpu/VirtualFluids_GPU/Calculation/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/Communication/package.include b/src/gpu/VirtualFluids_GPU/Communication/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridProvider.h b/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridProvider.h index bfa8be2e195fdd6791025ac32f5ad1981faef03a..1f33ad0374cc61a1f9d6317724dfcd1a95d1dcc3 100644 --- a/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridProvider.h +++ b/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridProvider.h @@ -6,7 +6,7 @@ #include <memory> #include <VirtualFluidsDefinitions.h> -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "VirtualFluids_GPU_export.h" #include <GridGenerator/io/SimulationFileWriter/SimulationFileWriter.h> diff --git a/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderFiles/package.include b/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderFiles/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderGenerator/package.include b/src/gpu/VirtualFluids_GPU/DataStructureInitializer/GridReaderGenerator/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/DataStructureInitializer/package.include b/src/gpu/VirtualFluids_GPU/DataStructureInitializer/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/FindInterface/package.include b/src/gpu/VirtualFluids_GPU/FindInterface/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/FindQ/package.include b/src/gpu/VirtualFluids_GPU/FindQ/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/GPU/CudaMemoryManager.h b/src/gpu/VirtualFluids_GPU/GPU/CudaMemoryManager.h index de26c1f7dfdb73e79d4269b2185cea16a2cceb4b..315c40e5d9dd0784a9753d565e9159449c396a33 100644 --- a/src/gpu/VirtualFluids_GPU/GPU/CudaMemoryManager.h +++ b/src/gpu/VirtualFluids_GPU/GPU/CudaMemoryManager.h @@ -4,7 +4,7 @@ #include <vector> #include <string> #include <memory> -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "VirtualFluids_GPU_export.h" #include "LBM/LB.h" diff --git a/src/gpu/VirtualFluids_GPU/GPU/EnstrophyAnalyzer.h b/src/gpu/VirtualFluids_GPU/GPU/EnstrophyAnalyzer.h index 2ba6fd2993b112d6aa90d9f9ae4445c2bd3e8bfb..05b5d79068cdde66f6615b470e0863a9350817e1 100644 --- a/src/gpu/VirtualFluids_GPU/GPU/EnstrophyAnalyzer.h +++ b/src/gpu/VirtualFluids_GPU/GPU/EnstrophyAnalyzer.h @@ -6,7 +6,7 @@ #include "VirtualFluidsDefinitions.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "VirtualFluids_GPU_export.h" diff --git a/src/gpu/VirtualFluids_GPU/GPU/KineticEnergyAnalyzer.h b/src/gpu/VirtualFluids_GPU/GPU/KineticEnergyAnalyzer.h index fcb2c323674023f3689ad9ead336a1c8f6a4e23c..1269167f5873497808162afa2d7761ecb5a1ef93 100644 --- a/src/gpu/VirtualFluids_GPU/GPU/KineticEnergyAnalyzer.h +++ b/src/gpu/VirtualFluids_GPU/GPU/KineticEnergyAnalyzer.h @@ -6,7 +6,7 @@ #include "VirtualFluidsDefinitions.h" -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "VirtualFluids_GPU_export.h" diff --git a/src/gpu/VirtualFluids_GPU/GPU/package.include b/src/gpu/VirtualFluids_GPU/GPU/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/Init/InitLattice.h b/src/gpu/VirtualFluids_GPU/Init/InitLattice.h index 9330deb23f6b0dd3cd2fdb77ea81c6a2e30b6647..4e781f96eead293631a8e1dcf3b5acf556cadb25 100644 --- a/src/gpu/VirtualFluids_GPU/Init/InitLattice.h +++ b/src/gpu/VirtualFluids_GPU/Init/InitLattice.h @@ -1,7 +1,7 @@ #ifndef INIT_LATTICE_H #define INIT_LATTICE_H -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" class Parameter; class PreProcessor; diff --git a/src/gpu/VirtualFluids_GPU/Init/package.include b/src/gpu/VirtualFluids_GPU/Init/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/Input/package.include b/src/gpu/VirtualFluids_GPU/Input/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Compressible/BGK/package.include b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Compressible/BGK/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Compressible/BGKPlus/package.include b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Compressible/BGKPlus/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Compressible/Cascade/package.include b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Compressible/Cascade/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Compressible/Cumulant/package.include b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Compressible/Cumulant/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Compressible/CumulantAll4/package.include b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Compressible/CumulantAll4/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Compressible/CumulantK15/package.include b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Compressible/CumulantK15/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Compressible/CumulantK15Bulk/package.include b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Compressible/CumulantK15Bulk/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Compressible/CumulantK15Sponge/package.include b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Compressible/CumulantK15Sponge/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Compressible/CumulantK17/package.include b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Compressible/CumulantK17/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Compressible/CumulantK17Bulk/package.include b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Compressible/CumulantK17Bulk/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Compressible/CumulantK18/package.include b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Compressible/CumulantK18/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Compressible/CumulantK20/package.include b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Compressible/CumulantK20/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Compressible/MRT/package.include b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Compressible/MRT/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Compressible/package.include b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Compressible/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Incompressible/BGK/package.include b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Incompressible/BGK/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Incompressible/BGKPlus/package.include b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Incompressible/BGKPlus/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Incompressible/Cascade/package.include b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Incompressible/Cascade/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Incompressible/Cumulant1hSP27/package.include b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Incompressible/Cumulant1hSP27/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Incompressible/CumulantIsoSP27/package.include b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Incompressible/CumulantIsoSP27/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Incompressible/CumulantK15/package.include b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Incompressible/CumulantK15/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Incompressible/MRT/package.include b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Incompressible/MRT/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Incompressible/package.include b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/Advection/Incompressible/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/AdvectionDiffusion/Compressible/Mod27/ADComp27/package.include b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/AdvectionDiffusion/Compressible/Mod27/ADComp27/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/AdvectionDiffusion/Compressible/Mod27/package.include b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/AdvectionDiffusion/Compressible/Mod27/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/AdvectionDiffusion/Compressible/Mod7/ADComp7/package.include b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/AdvectionDiffusion/Compressible/Mod7/ADComp7/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/AdvectionDiffusion/Compressible/Mod7/package.include b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/AdvectionDiffusion/Compressible/Mod7/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/AdvectionDiffusion/Compressible/package.include b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/AdvectionDiffusion/Compressible/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/AdvectionDiffusion/Incompressible/Mod27/ADIncomp27/package.include b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/AdvectionDiffusion/Incompressible/Mod27/ADIncomp27/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/AdvectionDiffusion/Incompressible/Mod27/package.include b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/AdvectionDiffusion/Incompressible/Mod27/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/AdvectionDiffusion/Incompressible/Mod7/ADIncomp7/package.include b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/AdvectionDiffusion/Incompressible/Mod7/ADIncomp7/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/AdvectionDiffusion/Incompressible/Mod7/package.include b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/AdvectionDiffusion/Incompressible/Mod7/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/AdvectionDiffusion/Incompressible/package.include b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/AdvectionDiffusion/Incompressible/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/AdvectionDiffusion/package.include b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/BasicKernels/AdvectionDiffusion/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/PorousMediaKernels/Advection/Compressible/CumulantOne/package.include b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/PorousMediaKernels/Advection/Compressible/CumulantOne/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/PorousMediaKernels/Advection/Compressible/package.include b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/PorousMediaKernels/Advection/Compressible/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/WaleKernels/Advection/Compressible/CumulantK15/package.include b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/WaleKernels/Advection/Compressible/CumulantK15/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/WaleKernels/Advection/Compressible/CumulantK15BySoniMalav/package.include b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/WaleKernels/Advection/Compressible/CumulantK15BySoniMalav/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/WaleKernels/Advection/Compressible/CumulantK17/package.include b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/WaleKernels/Advection/Compressible/CumulantK17/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/WaleKernels/Advection/Compressible/CumulantK17Debug/package.include b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/WaleKernels/Advection/Compressible/CumulantK17Debug/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Kernels/WaleKernels/Advection/Compressible/package.include b/src/gpu/VirtualFluids_GPU/Kernel/Kernels/WaleKernels/Advection/Compressible/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Utilities/CheckParameterStrategy/package.include b/src/gpu/VirtualFluids_GPU/Kernel/Utilities/CheckParameterStrategy/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Utilities/KernelFactory/package.include b/src/gpu/VirtualFluids_GPU/Kernel/Utilities/KernelFactory/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Utilities/Mapper/ADKernelMapper/package.include b/src/gpu/VirtualFluids_GPU/Kernel/Utilities/Mapper/ADKernelMapper/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Utilities/Mapper/KernelMapper/package.include b/src/gpu/VirtualFluids_GPU/Kernel/Utilities/Mapper/KernelMapper/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/Kernel/Utilities/package.include b/src/gpu/VirtualFluids_GPU/Kernel/Utilities/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/Kernel/package.include b/src/gpu/VirtualFluids_GPU/Kernel/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/LBM/Simulation.h b/src/gpu/VirtualFluids_GPU/LBM/Simulation.h index 04f2bc774769fc37770c660de6d202fb5c442f33..8a92184e504e008fccb488a192f59b67d4e1604d 100644 --- a/src/gpu/VirtualFluids_GPU/LBM/Simulation.h +++ b/src/gpu/VirtualFluids_GPU/LBM/Simulation.h @@ -3,7 +3,7 @@ #include <memory> #include <vector> -#include <Core/PointerDefinitions.h> +#include <PointerDefinitions.h> #include <VirtualFluidsDefinitions.h> diff --git a/src/gpu/VirtualFluids_GPU/LBM/package.include b/src/gpu/VirtualFluids_GPU/LBM/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/Output/DataWriter.h b/src/gpu/VirtualFluids_GPU/Output/DataWriter.h index 88ee578c9553db9263f41dc5c64db528ab4c77ed..0bba66ed8e5d89c4c6560087586b4395c735a445 100644 --- a/src/gpu/VirtualFluids_GPU/Output/DataWriter.h +++ b/src/gpu/VirtualFluids_GPU/Output/DataWriter.h @@ -1,7 +1,7 @@ #ifndef DATA_WRITER_H #define DATA_WRITER_H -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "Core/DataTypes.h" #include "VirtualFluids_GPU_export.h" diff --git a/src/gpu/VirtualFluids_GPU/Output/package.include b/src/gpu/VirtualFluids_GPU/Output/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/Parameter/Parameter.h b/src/gpu/VirtualFluids_GPU/Parameter/Parameter.h index e81a21acffe5e09d945ef806a7d1dce8bce15179..1a6aaa776d50de6f43ad3a85da77da37edb36568 100644 --- a/src/gpu/VirtualFluids_GPU/Parameter/Parameter.h +++ b/src/gpu/VirtualFluids_GPU/Parameter/Parameter.h @@ -22,7 +22,7 @@ //random numbers #include <curand.h> #include <curand_kernel.h> -#include "Core/PointerDefinitions.h" +#include "PointerDefinitions.h" #include "VirtualFluidsDefinitions.h" #include "VirtualFluids_GPU_export.h" diff --git a/src/gpu/VirtualFluids_GPU/Parameter/package.include b/src/gpu/VirtualFluids_GPU/Parameter/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/Particles/package.include b/src/gpu/VirtualFluids_GPU/Particles/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/PreProcessor/PreProcessorFactory/package.include b/src/gpu/VirtualFluids_GPU/PreProcessor/PreProcessorFactory/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/PreProcessor/PreProcessorStrategy/InitCompAD27/package.include b/src/gpu/VirtualFluids_GPU/PreProcessor/PreProcessorStrategy/InitCompAD27/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/PreProcessor/PreProcessorStrategy/InitCompAD7/package.include b/src/gpu/VirtualFluids_GPU/PreProcessor/PreProcessorStrategy/InitCompAD7/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/PreProcessor/PreProcessorStrategy/InitCompSP27/package.include b/src/gpu/VirtualFluids_GPU/PreProcessor/PreProcessorStrategy/InitCompSP27/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/PreProcessor/PreProcessorStrategy/InitF3/package.include b/src/gpu/VirtualFluids_GPU/PreProcessor/PreProcessorStrategy/InitF3/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/PreProcessor/PreProcessorStrategy/InitIncompAD27/package.include b/src/gpu/VirtualFluids_GPU/PreProcessor/PreProcessorStrategy/InitIncompAD27/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/PreProcessor/PreProcessorStrategy/InitIncompAD7/package.include b/src/gpu/VirtualFluids_GPU/PreProcessor/PreProcessorStrategy/InitIncompAD7/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/PreProcessor/PreProcessorStrategy/InitSP27/package.include b/src/gpu/VirtualFluids_GPU/PreProcessor/PreProcessorStrategy/InitSP27/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/PreProcessor/PreProcessorStrategy/package.include b/src/gpu/VirtualFluids_GPU/PreProcessor/PreProcessorStrategy/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/PreProcessor/package.include b/src/gpu/VirtualFluids_GPU/PreProcessor/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/Restart/package.include b/src/gpu/VirtualFluids_GPU/Restart/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/Temperature/package.include b/src/gpu/VirtualFluids_GPU/Temperature/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/Utilities/EnumMapper/package.include b/src/gpu/VirtualFluids_GPU/Utilities/EnumMapper/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/src/gpu/VirtualFluids_GPU/Utilities/package.include b/src/gpu/VirtualFluids_GPU/Utilities/package.include deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000