From: asl Date: Wed, 31 Aug 2016 11:10:30 +0000 (+0300) Subject: patch for automatic tests for HYDROData_Bathymetry X-Git-Tag: v1.6~82 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=614f315be8952978af8362e1f900ee6fe1841121;p=modules%2Fhydro.git patch for automatic tests for HYDROData_Bathymetry now they can be started on Windows without SALOME note that tests do not pass --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 54f22731..ceb5f5a6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,11 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8 FATAL_ERROR) -INCLUDE(CMakeDependentOption) +CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8 FATAL_ERROR) PROJECT(SalomeHYDRO C CXX) +ADD_SUBDIRECTORY (src/HYDRO_tests) + +INCLUDE(CMakeDependentOption) + # Ensure a proper linker behavior: CMAKE_POLICY(SET CMP0003 NEW) @@ -190,7 +193,6 @@ ADD_SUBDIRECTORY (src/HYDROData) ADD_SUBDIRECTORY (src/HYDROGUI) ADD_SUBDIRECTORY (src/HYDROPy) ADD_SUBDIRECTORY (src/HYDROTools) -ADD_SUBDIRECTORY (src/HYDRO_tests) IF(SALOME_BUILD_DOC) ADD_SUBDIRECTORY(doc) ENDIF() diff --git a/src/HYDROData/HYDROData_Bathymetry.cxx b/src/HYDROData/HYDROData_Bathymetry.cxx index 0a7e90ea..db677852 100644 --- a/src/HYDROData/HYDROData_Bathymetry.cxx +++ b/src/HYDROData/HYDROData_Bathymetry.cxx @@ -59,8 +59,10 @@ IMPLEMENT_STANDARD_HANDLE(HYDROData_Bathymetry, HYDROData_IAltitudeObject) IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Bathymetry, HYDROData_IAltitudeObject) //HYDROData_QuadtreeNode* HYDROData_Bathymetry::myQuadtree = 0; -#ifndef LIGHT_MODE + std::map HYDROData_Bathymetry::myQuadtrees; + +#ifndef LIGHT_MODE std::map HYDROData_Bathymetry::myDelaunay2D; #endif @@ -148,7 +150,7 @@ HYDROData_Bathymetry::AltitudePoints HYDROData_Bathymetry::GetAltitudePoints(boo return aPoints; } -#ifndef LIGHT_MODE + HYDROData_QuadtreeNode* HYDROData_Bathymetry::GetQuadtreeNodes() const { TDF_Label aLabel = myLab.FindChild(DataTag_AltitudePoints, false); @@ -194,6 +196,7 @@ HYDROData_QuadtreeNode* HYDROData_Bathymetry::GetQuadtreeNodes() const return myQuadtrees[labkey]; } +#ifndef LIGHT_MODE vtkPolyData* HYDROData_Bathymetry::GetVtkDelaunay2D() const { TDF_Label aLabel = myLab.FindChild(DataTag_AltitudePoints, false); @@ -353,6 +356,7 @@ bool interpolZtriangle(const gp_XY& point, vtkPolyData* delaunay2D, vtkIdList* t } return false; } +#endif double HYDROData_Bathymetry::GetAltitudeForPoint(const gp_XY& thePoint, int theMethod) const { @@ -391,6 +395,8 @@ double HYDROData_Bathymetry::GetAltitudeForPoint(const gp_XY& thePoint, int theM bool isBathyInterpolRequired = false; if (theMethod) isBathyInterpolRequired =true; + +#ifndef LIGHT_MODE if (isBathyInterpolRequired) { vtkPolyData* aDelaunay2D = GetVtkDelaunay2D(); @@ -416,9 +422,10 @@ double HYDROData_Bathymetry::GetAltitudeForPoint(const gp_XY& thePoint, int theM } if (!isInside) DEBTRACE(" point outside triangles, nearest z kept"); } + #endif return aResAltitude; } -#endif + void HYDROData_Bathymetry::SetFilePath( const TCollection_AsciiString& theFilePath ) { TDataStd_AsciiString::Set( myLab.FindChild( DataTag_FilePath ), theFilePath ); diff --git a/src/HYDRO_tests/CMakeLists.txt b/src/HYDRO_tests/CMakeLists.txt index 8a33dba0..8ff5e1c0 100644 --- a/src/HYDRO_tests/CMakeLists.txt +++ b/src/HYDRO_tests/CMakeLists.txt @@ -90,7 +90,7 @@ ENDIF() link_directories( $ENV{KERNEL_ROOT_DIR}/lib/salome $ENV{GUI_ROOT_DIR}/lib/salome $ENV{GEOM_ROOT_DIR}/lib/salome ) SET( GUI_LIBRARIES ImageComposer qtx suit LightApp CAM OCCViewer ) -SET( GEOM_LIBRARIES CurveCreator ) +SET( GEOM_LIBRARIES CurveCreator GeomUtils ) include_directories( ${CAS_INCLUDES} @@ -107,7 +107,7 @@ include_directories( source_group( "External files" FILES ${EXTERNAL_FILES} ) add_executable( HYDROData_tests ${PROJECT_SOURCES} ${PROJECT_HEADERS} ${EXTERNAL_FILES} ${PROJECT_MOC_HEADERS} ) -target_link_libraries( HYDROData_tests ${GUI_LIBRARIES} ${GEOM_LIBRARIES} ${CAS_LIBRARIES} ${QT_LIBRARIES} ${CPPUNIT_LIBRARIES} shapelib HYDROData) +target_link_libraries( HYDROData_tests ${GUI_LIBRARIES} ${GEOM_LIBRARIES} ${CAS_LIBRARIES} ${QT_LIBRARIES} ${CPPUNIT_LIBRARIES} shapelib ) #IF( ${WIN32} ) # add_custom_command( TARGET HYDROData_tests POST_BUILD COMMAND $(TargetPath) COMMENT "Running tests" ) diff --git a/src/HYDRO_tests/ExternalFiles.cmake b/src/HYDRO_tests/ExternalFiles.cmake index df610ea5..998b5c7d 100644 --- a/src/HYDRO_tests/ExternalFiles.cmake +++ b/src/HYDRO_tests/ExternalFiles.cmake @@ -9,6 +9,7 @@ set( EXTERNAL_FILES ../HYDROData/HYDROData_BSplineOperation.cxx ../HYDROData/HYDROData_CalculationCase.cxx ../HYDROData/HYDROData_Channel.cxx + ../HYDROData/HYDROData_ChannelAltitude.cxx ../HYDROData/HYDROData_Confluence.cxx ../HYDROData/HYDROData_Digue.cxx ../HYDROData/HYDROData_Document.cxx @@ -54,6 +55,9 @@ set( EXTERNAL_FILES ../HYDROData/HYDROData_SinusX.cxx ../HYDROData/HYDROData_ShapeFile.cxx ../HYDROData/HYDROData_LandCoverMap.cxx + ../HYDROData/HYDROData_QuadTree.cxx + ../HYDROData/HYDROData_QuadTreeNode.cxx + ../HYDROData/HYDROData_LCM_FaceClassifier.cxx ../HYDROGUI/HYDROGUI_ListModel.cxx ../HYDROGUI/HYDROGUI_DataObject.cxx